calorimeter
Class Calorimeter

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by edu.davidson.tools.SApplet
                      extended by calorimeter.Calorimeter
All Implemented Interfaces:
edu.davidson.tools.SDataSource, edu.davidson.tools.SStepable, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Runnable, javax.accessibility.Accessible

public class Calorimeter
extends edu.davidson.tools.SApplet
implements edu.davidson.tools.SDataSource, edu.davidson.tools.SStepable, java.lang.Runnable

This applet draws a calorimeter (there are three styles available) and simulates a calorimetry experiment.
Style 0 shows no calorimeter (blank applet box)
Style 1 shows a standard calorimeter.
Style 2 shows a thermos-type calorimeter.
Style 3 shows a bomb calorimeter.
Style 4 shows a thermos-type calorimeter with a reservoir that drains into the calorimeter.

Configurable Options include the sample, a heating filament, and a stirrer.

The applet serves as a DataSource (DataConnections) that supplies time-temperature data during the experiment.

Temperature and energy are in arbitrary units, but typically one would use oC and joules. Time is in units of seconds and is real time.

APPLET PARAMETERS

IsReady String   JavaScript variable that will be set to true when applet has initialized. Must use MAYSCRIPT in APPLET tag to use this feature.

Version:
2.0, September 2008
Author:
David N. Blauch
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class edu.davidson.tools.SApplet
autoRefresh, clock, dataConnections, dataListeners, dataSources, lock, oneShotMsg
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Calorimeter()
           
 
Method Summary
 void destroy()
           
 java.lang.String getAppletInfo()
           
 double getMaxTemperature()
          Gets the maximum temperature likely to be returned during a simulation.
 double getMinTemperature()
          Gets the minimum temperature likely to be returned during a simulation.
 edu.davidson.tools.SApplet getOwner()
          Gets the owner of the data source.
 java.lang.String getParameter(java.lang.String key, java.lang.String def)
           
 java.lang.String[][] getParameterInfo()
           
 double getTemperature()
          Gets the current temperature, which includes noise.
 double getTemperature(double tm)
          Gets the temperature at a specific time in the simulation.
 double[][] getVariables()
          Gets the values of the variables for the data source.
 java.lang.String[] getVarStrings()
          Gets the variable strings that the data source supplied.
 void init()
           
 boolean isRunning()
          Returns true if a simulation is running and false if not.
 void paint(java.awt.Graphics g)
           
 void resetSimulation()
          Resets the simulation.
 void run()
           
 void setBackgroundColor(java.lang.String rgb)
          Sets the background color of the applet
 void setBombColor(java.lang.String rgb)
          Sets the color of the bomb in the bomb calorimeter
 void setBombHeight(int val)
          Sets the height of the bomb.
 void setBombThickness(int val)
          Sets the thickness of the walls of the bomb.
 void setBombWidth(int val)
          Sets the width of the bomb.
 void setCalorimeterBodyCurvature(int val)
          Sets the curvature used in drawing the rounded edges of the calorimeter.
 void setCalorimeterColor(java.lang.String rgb)
          Sets the color of the calorimeter body
 void setCalorimeterFraction(double val)
          Sets the fraction of the applet region that is occupied by the calorimeter.
 void setCalorimeterTopHeight(int val)
          Sets the thickness of the top of the calorimeter (Style 1 only).
 void setCalorimeterWallThickness(int val)
          Sets the thickness of the walls of the calorimeter.
 void setDelay(long val)
          Sets the delay time for the animation loop that starts the reaction or process.
 void setFilamentHeight(int val)
          Sets the height of the filament above the bottom of the calorimeter.
 void setFilamentOffset(int val)
          Sets the distance the left edge of the filament is positioned from the inside left wall of the calorimeter.
 void setFilamentSectionCount(int val)
          Sets the number of sections in the filament, which has a zig-zag design.
 void setFilamentSectionWidth(int val)
          Sets the width of each section in the filament, which has a zig-zag design.
 void setFilamentTime(double val)
          Sets the time during which the filament is active.
 void setFinalSlope(double val)
          Sets the slope of the time-temperature plot after the reaction or process has started.
 void setHeatCapacity(double val)
          Sets the heat capacity of the calorimeter (includes the calorimeter body and the liquid in the calorimeter.
 void setHeatFlow(double val)
          Sets the heat flow for the calorimeter attributable to the reaction or process.
 void setHeatingRate(double val)
          Sets the heating rate for the filament, which must be a possible value.
 void setInitialSlope(double val)
          Sets the slope of the time-temperature plot prior to the start of the reaction or process.
 void setInitialTemperature(double val)
          Sets the initial temperature for the calorimeter (the temperature when the simulation begins).
 void setLiquidColor(java.lang.String rgb)
          Sets the color of the liquid in the calorimeter (Style 1 and 2 only).
 void setLiquidFraction(double val)
          Sets the fraction of the calorimeter body that is filled with the liquid.
 void setMaxCnt(int val)
          Sets the number of increments in the animation loop.
 void setOwner(edu.davidson.tools.SApplet owner)
          Sets the owner for the data source.
 void setRandom(long rnd)
          Sets the seed value for the random number generator.
 void setReservoirHeight(int val)
          Sets the height of the reservoir.
 void setReservoirLiquidFraction(double val)
          Sets the fraction of the reservoir filled with liquid.
 void setReservoirOffset(int val)
          Sets the offset of the reservoir from the left edge of the calorimeter.
 void setReservoirThickness(int val)
          Sets the thickness of the reservoir walls.
 void setReservoirWidth(int val)
          Sets the width of the reservoir.
 void setSampleColor(java.lang.String rgb)
          Sets the color of the sample in the calorimeter (Style 1 and 2 only).
 void setSampleDiameter(int val)
          Sets the diameter of the sample itself.
 void setSampleHeight(int val)
          Sets the height of the sample region.
 void setSampleOffset(int val)
          Sets the distance the sample is positioned from the inside wall.
 void setSampleWidth(int val)
          Sets the width (thickness)of hammer.
 void setStandardDeviation(double val)
          Sets the standard deviation for the Gaussian noise applied to the temperature.
 void setStartTime(double val)
          Sets the time at which the reaction or process starts.
 void setStirrerColor(java.lang.String rgb)
          Sets the color of the stirrer
 void setStirrerOffsetX(int val)
          Sets the distance the stirrer is offset from the inside left wall of the calorimeter.
 void setStirrerOffsetY(int val)
          Sets the distance the stirrer is offset from the bottom of the calorimeter.
 void setStirrerWidth(int val)
          Sets the width and height of the vanes on the stirrer.
 void setStopTime(double val)
          Sets the time at which the simulation stops.
 void setThermometerFraction(double val)
          Sets the height of the liquid in the thermometer as a fraction of the length of the thermometer
 void setThermometerOffsetX(int val)
          Sets the position of the right edge of the thermometer from the inside right wall of the calorimeter
 void setThermometerOffsetY(int val)
          Sets the position of the bottom of the thermometer from the inside bottom of the calorimeter
 void setTimeConstant(double val)
          Sets the time constant for the simulation.
 void setTimeIncrement(double val)
          Sets the simulation time increment, the time between points in the simulation.
 void setUseFilament(boolean s)
          Determines whether the filament is used during a simulation (Style 1 only).
 void showFilament(boolean s)
          Determines whether the filament is shown in the calorimeter (Style 1 only).
 void showSample(boolean s)
          Determines whether the sample is shown in the calorimeter (Styles 1 and 2 only).
 void showStirrer(boolean s)
          Determines whether the stirrer is shown in the calorimeter (all Styles).
 void start()
           
 void startSimulation()
          Starts the simulation.
 void step(double dt, double tm)
          The step method required for the SStepable interface.
 void stop()
           
 void stopSimulation()
          Stops the simulation, but not change is made to the temperature or to the appearance of the calorimeter
 
Methods inherited from class edu.davidson.tools.SApplet
addDataListener, addDataSource, cleanupDataConnections, clearAllData, clearData, cyclingClock, deleteDataConnection, deleteDataConnections, forward, getClockID, getClockTime, getDataConnectionFromDL, getDataConnectionFromDS, getDataFromDS, getDataListener, getDataListener, getDataSource, getDataSource, getID, getRunningID, getSourceData, getSourceVariables, isAutoRefresh, isClockRunning, makeDataConnection, pause, pausingClock, removeDataListener, removeDataSource, reset, reverse, setAutoRefresh, setClockContinous, setClockCycle, setClockOneShot, setClockTime, setConnectionBlock, setConnectionListener, setConnectionSmoothing, setConnectionSource, setConnectionStride, setDefault, setDt, setExternalClock, setFPS, setRunningID, setRunningID, setTimeContinuous, setTimeCycle, setTimeOneShot, startClock, stepClock, stepTime, stepTimeBack, stepTimeForward, stopClock, stoppingClock, updateDataConnection, updateDataConnections
 
Methods inherited from class java.applet.Applet
getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.davidson.tools.SDataSource
getID
 

Constructor Detail

Calorimeter

public Calorimeter()
Method Detail

destroy

public void destroy()
Overrides:
destroy in class edu.davidson.tools.SApplet

getAppletInfo

public java.lang.String getAppletInfo()
Overrides:
getAppletInfo in class java.applet.Applet

getMaxTemperature

public double getMaxTemperature()
Gets the maximum temperature likely to be returned during a simulation. Determines the maximum temperature in the absence of noise and adds three times the standard deviation.

Returns:
the maximum temperature

getMinTemperature

public double getMinTemperature()
Gets the minimum temperature likely to be returned during a simulation. Determines the minimum temperature in the absence of noise and subtracts three times the standard deviation.

Returns:
the minimum temperature

getOwner

public edu.davidson.tools.SApplet getOwner()
Gets the owner of the data source.

Specified by:
getOwner in interface edu.davidson.tools.SDataSource
Returns:
the owner of the data source

getParameter

public java.lang.String getParameter(java.lang.String key,
                                     java.lang.String def)

getParameterInfo

public java.lang.String[][] getParameterInfo()
Overrides:
getParameterInfo in class java.applet.Applet

getTemperature

public double getTemperature()
Gets the current temperature, which includes noise.

Returns:
the temperature

getTemperature

public double getTemperature(double tm)
Gets the temperature at a specific time in the simulation. This temperature does not include noise.

Parameters:
tm - the time (in seconds)
Returns:
the temperature

getVariables

public double[][] getVariables()
Gets the values of the variables for the data source.

Specified by:
getVariables in interface edu.davidson.tools.SDataSource
Returns:
a one-by-two array with element [0][0] being the time and element [0][1] being the temperature

getVarStrings

public java.lang.String[] getVarStrings()
Gets the variable strings that the data source supplied. The applet supplies time-temperature data (t,T).

Specified by:
getVarStrings in interface edu.davidson.tools.SDataSource
Returns:
the variable strings.

init

public void init()
Overrides:
init in class java.applet.Applet

isRunning

public boolean isRunning()
Returns true if a simulation is running and false if not.


paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class java.awt.Container

resetSimulation

public void resetSimulation()
Resets the simulation. If a simulation is running, the simulation is stopped. If the sample is to be shown, it is reset to the initial state. If the filament is to be shown, it is set to the initial state. All changes in the appearance of the calorimeter, sample, and filament are applied.

See Also:
showFilament, showSample, stopSimulation()

setBackgroundColor

public void setBackgroundColor(java.lang.String rgb)
Sets the background color of the applet

Parameters:
rgb - this string is converted into a 24-bit integer that defines the color

setBombColor

public void setBombColor(java.lang.String rgb)
Sets the color of the bomb in the bomb calorimeter

Parameters:
rgb - this string is converted into a 24-bit integer that defines the color

setBombHeight

public void setBombHeight(int val)
Sets the height of the bomb.

Parameters:
val - height in pixels

setBombThickness

public void setBombThickness(int val)
Sets the thickness of the walls of the bomb.

Parameters:
val - thickness in pixels

setBombWidth

public void setBombWidth(int val)
Sets the width of the bomb.

Parameters:
val - width in pixels

setCalorimeterBodyCurvature

public void setCalorimeterBodyCurvature(int val)
Sets the curvature used in drawing the rounded edges of the calorimeter.

Parameters:
val - the width/height of an arc in pixels

setCalorimeterColor

public void setCalorimeterColor(java.lang.String rgb)
Sets the color of the calorimeter body

Parameters:
rgb - this string is converted into a 24-bit integer that defines the color

setCalorimeterFraction

public void setCalorimeterFraction(double val)
Sets the fraction of the applet region that is occupied by the calorimeter. The thermometer always extends to the top of the applet region.

Parameters:
val - the vertical fraction of the applet box to be occupied by the calorimeter

setCalorimeterTopHeight

public void setCalorimeterTopHeight(int val)
Sets the thickness of the top of the calorimeter (Style 1 only).

Parameters:
val - the thickness (in pixels) of the top of the calorimeter

setCalorimeterWallThickness

public void setCalorimeterWallThickness(int val)
Sets the thickness of the walls of the calorimeter.

Parameters:
val - the thickness (in pixels) of the calorimeter walls

setDelay

public void setDelay(long val)
Sets the delay time for the animation loop that starts the reaction or process. The total time required for the animation equals the product of the delay time and the maximum count

Parameters:
val - delay time in milliseconds
See Also:
setMaxCnt(int)

setFilamentHeight

public void setFilamentHeight(int val)
Sets the height of the filament above the bottom of the calorimeter.

Parameters:
val - the height (in pixels) of the filament

setFilamentOffset

public void setFilamentOffset(int val)
Sets the distance the left edge of the filament is positioned from the inside left wall of the calorimeter.

Parameters:
val - the distance (in pixel) the filament is positioned from the calorimeter wall

setFilamentSectionCount

public void setFilamentSectionCount(int val)
Sets the number of sections in the filament, which has a zig-zag design. There are always an even number of segments. If an odd value is specified, the next higher integer is actually used.

Parameters:
val - the number of sections

setFilamentSectionWidth

public void setFilamentSectionWidth(int val)
Sets the width of each section in the filament, which has a zig-zag design. The total width of the filament is the section width multiplied by the number of sections.

Parameters:
val - the width (in pixels) of a section of the filament

setFilamentTime

public void setFilamentTime(double val)
Sets the time during which the filament is active.

Parameters:
val - the time (in seconds) that the filament is active

setFinalSlope

public void setFinalSlope(double val)
Sets the slope of the time-temperature plot after the reaction or process has started. The default is zero.

Parameters:
val - the initial slope (energy/second)

setHeatCapacity

public void setHeatCapacity(double val)
Sets the heat capacity of the calorimeter (includes the calorimeter body and the liquid in the calorimeter.

Parameters:
val - the heat capacity

setHeatFlow

public void setHeatFlow(double val)
Sets the heat flow for the calorimeter attributable to the reaction or process. A positive value results in an increase in temperature. The user is expected to calculate this value for the process being modeled. It is possible to run a reaction and use the filament simultaneously.

Parameters:
val - the heat flow
See Also:
setHeatingRate(double)

setHeatingRate

public void setHeatingRate(double val)
Sets the heating rate for the filament, which must be a possible value. It is possible to run a reaction and use the filament simultaneously.

Parameters:
val - heating rate (energy/second)
See Also:
setHeatFlow(double)

setInitialSlope

public void setInitialSlope(double val)
Sets the slope of the time-temperature plot prior to the start of the reaction or process. The default is zero.

Parameters:
val - the initial slope (energy/second)

setInitialTemperature

public void setInitialTemperature(double val)
Sets the initial temperature for the calorimeter (the temperature when the simulation begins).

Parameters:
val - the initial temperature

setLiquidColor

public void setLiquidColor(java.lang.String rgb)
Sets the color of the liquid in the calorimeter (Style 1 and 2 only).

Parameters:
rgb - this string is converted into a 24-bit integer that defines the color

setLiquidFraction

public void setLiquidFraction(double val)
Sets the fraction of the calorimeter body that is filled with the liquid.

Parameters:
val - the vertical fraction of the calorimeter body filled with the liquid

setOwner

public void setOwner(edu.davidson.tools.SApplet owner)
Sets the owner for the data source.

Specified by:
setOwner in interface edu.davidson.tools.SDataSource
Parameters:
owner - the owner of the data source

setMaxCnt

public void setMaxCnt(int val)
Sets the number of increments in the animation loop. The duration of the animation is the product of the delay time and the maximum count.

Parameters:
val - maximum number of steps
See Also:
setDelay(long)

setRandom

public void setRandom(long rnd)
Sets the seed value for the random number generator. Allows users to obtain a reproducible set of values from the simulation. Valid only if a simulation is not in progress.

Parameters:
rnd - the seed value for the random number generator

setReservoirHeight

public void setReservoirHeight(int val)
Sets the height of the reservoir.

Parameters:
val - height in pixels

setReservoirLiquidFraction

public void setReservoirLiquidFraction(double val)
Sets the fraction of the reservoir filled with liquid.

Parameters:
val - fraction

setReservoirOffset

public void setReservoirOffset(int val)
Sets the offset of the reservoir from the left edge of the calorimeter.

Parameters:
val - offset in pixels

setReservoirThickness

public void setReservoirThickness(int val)
Sets the thickness of the reservoir walls.

Parameters:
val - thickness in pixels

setReservoirWidth

public void setReservoirWidth(int val)
Sets the width of the reservoir.

Parameters:
val - width in pixels

setSampleColor

public void setSampleColor(java.lang.String rgb)
Sets the color of the sample in the calorimeter (Style 1 and 2 only).

Parameters:
rgb - this string is converted into a 24-bit integer that defines the color

setSampleDiameter

public void setSampleDiameter(int val)
Sets the diameter of the sample itself.

Parameters:
val - diameter in pixels

setSampleHeight

public void setSampleHeight(int val)
Sets the height of the sample region. This does not affect the size of the sample itself.

Parameters:
val - height in pixels

setSampleOffset

public void setSampleOffset(int val)
Sets the distance the sample is positioned from the inside wall. For Styles 1 and 2, the offset is the distance from the left wall of the calorimeter. For Style 3 (the bomb calorimeter), the offset is the distance from the right wall of the bomb.

Parameters:
val - the distance (in pixels) the sample is positioned from the calorimeter wall

setSampleWidth

public void setSampleWidth(int val)
Sets the width (thickness)of hammer. Use the height attribute to change the size of the sample region. This does not affect the size of the sample itself.

Parameters:
val - width in pixels
See Also:
setSampleHeight(int)

setStandardDeviation

public void setStandardDeviation(double val)
Sets the standard deviation for the Gaussian noise applied to the temperature. Valid only if a simulation is not running.

Parameters:
val - the standard deviation of the Gaussian noise

setStartTime

public void setStartTime(double val)
Sets the time at which the reaction or process starts. The time prior to the start of the reaction establishes the baseline.

Parameters:
val - the starting time (in seconds) for the reaction

setStirrerColor

public void setStirrerColor(java.lang.String rgb)
Sets the color of the stirrer

Parameters:
rgb - this string is converted into a 24-bit integer that defines the color

setStirrerOffsetX

public void setStirrerOffsetX(int val)
Sets the distance the stirrer is offset from the inside left wall of the calorimeter.

Parameters:
val - x offset in pixels

setStirrerOffsetY

public void setStirrerOffsetY(int val)
Sets the distance the stirrer is offset from the bottom of the calorimeter.

Parameters:
val - offset in pixels

setStirrerWidth

public void setStirrerWidth(int val)
Sets the width and height of the vanes on the stirrer. The width of a vane is three times this value, and the height of the vane is twice this value.

Parameters:
val - size in pixels

setStopTime

public void setStopTime(double val)
Sets the time at which the simulation stops. The simulation operates in real time.

Parameters:
val - the time (in seconds) when the simulation ends

setThermometerFraction

public void setThermometerFraction(double val)
Sets the height of the liquid in the thermometer as a fraction of the length of the thermometer

Parameters:
val - the fraction of the thermometer body filled with liquid

setThermometerOffsetX

public void setThermometerOffsetX(int val)
Sets the position of the right edge of the thermometer from the inside right wall of the calorimeter

Parameters:
val - the distance (in pixels) from the right calorimeter wall

setThermometerOffsetY

public void setThermometerOffsetY(int val)
Sets the position of the bottom of the thermometer from the inside bottom of the calorimeter

Parameters:
val - the distance (in pixels) from the bottom of the calorimeter

setTimeConstant

public void setTimeConstant(double val)
Sets the time constant for the simulation. The time constant determines the time required for the simulation to reach the final temperature.

Parameters:
val - the time constant (in seconds)

setTimeIncrement

public void setTimeIncrement(double val)
Sets the simulation time increment, the time between points in the simulation. The simulation is always set to run in real time.

Parameters:
val - the time increment (in seconds) for the simulation

setUseFilament

public void setUseFilament(boolean s)
Determines whether the filament is used during a simulation (Style 1 only). If the filament is used, the filament is set to red during the simulation and a linear temperature ramp is applied. This value is not used if showFilament is false.

Parameters:
s - if true the filament is to be used
See Also:
showFilament(boolean)

showFilament

public void showFilament(boolean s)
Determines whether the filament is shown in the calorimeter (Style 1 only). Note that the filament might be shown but not used.

Parameters:
s - if true the filament is shown
See Also:
setUseFilament(boolean)

showSample

public void showSample(boolean s)
Determines whether the sample is shown in the calorimeter (Styles 1 and 2 only). If the sample is shown, the simulation includes a change in the sample at the time the reaction is started.
For style 1, a bar descends and breaks the sample ampule.
For style 2, the sample (a ball) is dropped into the calorimeter.
For style 3, the sample disappears after combustion.

Parameters:
s - of true the sample is shown

showStirrer

public void showStirrer(boolean s)
Determines whether the stirrer is shown in the calorimeter (all Styles).

Parameters:
s - if true the stirrer is shown

start

public void start()
Overrides:
start in class java.applet.Applet

startSimulation

public void startSimulation()
Starts the simulation. The temperature is set to the initial value and noise is applied. It is not possible to start the simulation until the simulation is reset.

See Also:
resetSimulation(), stopSimulation()

step

public void step(double dt,
                 double tm)
The step method required for the SStepable interface. This method is used by the clock to perform the simulation. After this method has executed, the simulation variables are updated for time tm + dt.

Specified by:
step in interface edu.davidson.tools.SStepable
Parameters:
dt - the time increment (in seconds)
tm - the current time (in seconds)
See Also:
SStepable

stop

public void stop()
Overrides:
stop in class java.applet.Applet

stopSimulation

public void stopSimulation()
Stops the simulation, but not change is made to the temperature or to the appearance of the calorimeter

See Also:
resetSimulation(), startSimulation()

run

public void run()
Specified by:
run in interface java.lang.Runnable