stoppedFlow
Class StoppedFlow

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 stoppedFlow.StoppedFlow
All Implemented Interfaces:
edu.davidson.tools.SDataSource, edu.davidson.tools.SStepable, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class StoppedFlow
extends edu.davidson.tools.SApplet
implements edu.davidson.tools.SStepable, edu.davidson.tools.SDataSource

This applet simulates a stopped-flow apparatus for performing kinetics studies. This applet functions as a data source in SDataSource, providing real-time data for time, absorbance (A), dA/dt, and concentrations (C) and dC/dt for the various species in the system. The rate law can be user-defined.

This applet uses Data Connections.

Applet Parameters

NAME Variable Type Default Description
BGColor String null The string is converted to an integer representing the RGB color to be used as the background color for the applet.
CalculationOnly boolean false If true, no image is displayed in the applet area and no animation is performed. The applet performs only the calculation.
CellLength double 0.5 The cell path length is used in computing the absorbance reading
Dt double 0.050 This is the time interval in seconds for the animation. The smaller this value the smoother the animation provided the CPU is sufficiently fast.
IsReady String   JavaScript variable that will be set to true when applet has initialized. Must use MAYSCRIPT in APPLET tag to use this feature.
IsVertical boolean false If true the stopped flow apparatus is oriented vertically; otherwise the orientation is horizontal.
SyringeHeight int 0 Sets the height of the syringe body in pixels. If a value of zero (the default) is supplied, the height of the syringe is scaled to fit the available space.
SyringeWidth int 0 Sets the width of the syringe body in pixels. If a value of zero (the default) is supplied, the width of the syringe is scaled to fit the available space.
TubeWidth int 10 Sets the width in pixels of the tubes in the stopped flow apparatus.

Version:
2.0
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
StoppedFlow()
           
 
Method Summary
 void clearCoefficients()
          Sets all stoichiometric coefficients to zero, except for that of species 0, which is set to -1.
 void clearColors()
          Sets the color for all species to the background color
 void clearConcentrationsA()
          Sets the concentrations of all species in the syringe A solution to zero.
 void clearConcentrationsB()
          Sets the concentrations of all species in the syringe B solution to zero.
 void clearMolarAbsorptivities()
          Sets all molar absorptivities to zero.
 void clearRateLaw()
          Sets all exponents in the rate law to zero.
 void destroy()
           
 double getAbsorbance(double[] _conc)
          Returns the absorbance for a set of molar concentrations.
 double[] getAbsorbanceDataSet()
          Returns the absorbance data set from the last simulation.
 double getAbsorbanceDataSet(int _i)
          Returns the absorbance at index _i.
 java.lang.String getAppletInfo()
           
 java.awt.Color getColor(double[] _conc)
          Returns the color for a set of concentrations.
 java.awt.Color getColor(int _red, int _green, int _blue)
          Returns the color with the indicated red, green, and blue components.
 double[][] getDataSet()
          Returns the data set from the last simulation.
 double[] getDataSet(int _n)
          Returns the data set for species _n.
 double getDataSet(int _n, int _i)
          Returns the concentration of species _n at index _i.
 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[][] getVariables()
          Gets the values of the variables for SDataSource.
element [0][0] is the time as provided by the timer, which might be disabled
element [0][1] is the number of photons emitted by the light source
element [0][2] is the number of photons detected by the detector
element [0][3] is the intensity (photons/sec), which is zero if the timer is off
element [0][4] is the transmittance, which is zero if the timer is off
element [0][5] is the absorbance, which is zero if the timer is off
The transmittance and absorbance are determined using the reference intensity, if it is defined; otherwise the source intensity is used.
 java.lang.String[] getVarStrings()
          Returns an array of the variable names supplied by this SDataSource.
t is the simulation time in seconds
A is the absorbance
C0 through C7 are concentrations of species 0 through 7
 void init()
           
 boolean isRunning()
          Returns true is a simulation is running.
 void paint(java.awt.Graphics g)
           
 void resetSimulation()
          Resets the simulation.
 void setCalculationOnly(boolean _calcOnly)
          Sets the calculation only flag.
 void setCellPathLength(double _length)
          Sets the cell path length (in centimeters)
 void setCoefficient(int _n, double _coef)
          Sets the stoichiometric coefficient for a single species.
 void setCoefficients(double[] _coef)
          Sets the stoichiometric coefficients for each species.
 void setColor(int _n, java.awt.Color _color)
          Sets the color of a single species.
 void setColor(int _n, java.lang.String _color)
          Sets the color of a single species.
 void setColors(java.awt.Color _color)
          Sets the color of all species to the indicated color.
 void setColors(java.awt.Color[] _colors)
          Sets the colors of all species.
 void setColors(java.lang.String _color)
          Sets the color of all species to the indicated color.
 void setColors(java.lang.String[] _colors)
          Sets the colors of all species.
 void setConcentrationA(int _n, double _conc)
          Sets the molar concentration of a single species in the liquid in syringe A.
 void setConcentrationB(int _n, double _conc)
          Sets the molar concentration of a single species in the liquid in syringe B.
 void setConcentrations(double[] _concA, double[] _concB)
          Sets the molar concentrations of species in the liquid in syringes.
 void setConcentrationsA(double[] _conc)
          Sets the molar concentrations of species in the liquid in syringe A.
 void setConcentrationsB(double[] _conc)
          Sets the molar concentrations of species in the liquid in syringe B.
 void setFractions(double _fractionA, double _fractionB)
          Sets the initial fractions of the total syringe volumes.
 void setFractionsDelivered(double _fractionA, double _fractionB)
          Sets the fractions of the total syringe volumes that are delivered in the simulation.
 void setLightColor(java.awt.Color _color)
          Sets the light color.
 void setLightColor(double _wavelength)
          Sets the light beam to the color corresponding with the indicated wavelength.
 void setMinimumStepSize(double _hmin)
          Sets the minimum step size in seconds for the Fourth Order Runge-Kutta-Fehlberg algorithm.
 void setMolarAbsorptivities(double[] _molAbs)
          Sets the molar absorptivities of the various species.
 void setMolarAbsorptivity(int _n, double _molAbs)
          Sets the molar absorptivity of a single species.
 void setOutputIncrement(double _dt)
          Sets the output increment for simulation data.
 void setOwner(edu.davidson.tools.SApplet owner)
          Sets the owner for the SDataSource.
 void setPrecision(double _tol)
          Sets the relative precision for the numerical calculations for the user-defined reaction order.
 void setRandom(long rnd)
          Sets the seed value for the random number generator.
 void setRateConstant(double _rateConstant)
          Sets the rate constant based upon species 0.
 void setRateLaw(double[] _exp)
          Sets the rate law for the user-defined kinetics option (see setReactionOrder).
 void setRateLaw(int _n, double _exp)
          Sets the exponent in the rate law for a given species for the user-defined kinetics option (see setReactionOrder).
 void setReactionOrder(int _rxnOrder)
          Sets the reaction order for the kinetics.
 void setStandardDeviation(double _std)
          Sets the standard deviation for the Gaussian error applied to the absorbance.
 void setStartTime(double _time)
          Sets the starting time for the chemical reaction.
 void setStopTime(double _time)
          Sets the stopping time for the simulation reaction.
 void setTimeIncrement(double _dt)
          Sets the time increment for the simulation.
 void start()
           
 void startSimulation()
          Starts the simulation.
 void step(double dt, double tm)
          Calculates state of system at each step in the simulation.
 void stop()
           
 void stopSimulation()
          Stops the simulation.
 
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

StoppedFlow

public StoppedFlow()
Method Detail

getParameter

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

init

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

start

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

startSimulation

public void startSimulation()
Starts the simulation. If a simulation has previously been run or parameters have been changed, it is necessary to reset the simulation prior to starting a new simulation.

See Also:
stopSimulation()

stop

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

stopSimulation

public void stopSimulation()
Stops the simulation.

See Also:
startSimulation()

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

getParameterInfo

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

clearCoefficients

public void clearCoefficients()
Sets all stoichiometric coefficients to zero, except for that of species 0, which is set to -1.


clearColors

public void clearColors()
Sets the color for all species to the background color


clearConcentrationsA

public void clearConcentrationsA()
Sets the concentrations of all species in the syringe A solution to zero.


clearConcentrationsB

public void clearConcentrationsB()
Sets the concentrations of all species in the syringe B solution to zero.


clearMolarAbsorptivities

public void clearMolarAbsorptivities()
Sets all molar absorptivities to zero.


clearRateLaw

public void clearRateLaw()
Sets all exponents in the rate law to zero.


getAbsorbance

public double getAbsorbance(double[] _conc)
Returns the absorbance for a set of molar concentrations. Random error is NOT added to this value.


getAbsorbanceDataSet

public double[] getAbsorbanceDataSet()
Returns the absorbance data set from the last simulation. The user is expected to reconstruct the times, which are the index*(output time interval). This absorbance data, like the data supplied to DataConnections, has random error added.


getAbsorbanceDataSet

public double getAbsorbanceDataSet(int _i)
Returns the absorbance at index _i. The time is _i*(output time interval) This absorbance data, like the data supplied to DataConnections, has random error added.


getColor

public java.awt.Color getColor(int _red,
                               int _green,
                               int _blue)
Returns the color with the indicated red, green, and blue components. Each component has a value between 0 and 255.


getColor

public java.awt.Color getColor(double[] _conc)
Returns the color for a set of concentrations. Should be called after the simulation is reset, so changes in colors take effect.


getDataSet

public double[][] getDataSet()
Returns the data set from the last simulation. The user is expected to reconstruct the times, which are the index*(output time interval)


getDataSet

public double[] getDataSet(int _n)
Returns the data set for species _n. The user is expected to reconstruct the times, which are the index*(output time interval)


getDataSet

public double getDataSet(int _n,
                         int _i)
Returns the concentration of species _n at index _i. The time is _i*(output time interval)


getOwner

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

Specified by:
getOwner in interface edu.davidson.tools.SDataSource
Returns:
owner of the data source, which is this applet

getVariables

public double[][] getVariables()
Gets the values of the variables for SDataSource.
element [0][0] is the time as provided by the timer, which might be disabled
element [0][1] is the number of photons emitted by the light source
element [0][2] is the number of photons detected by the detector
element [0][3] is the intensity (photons/sec), which is zero if the timer is off
element [0][4] is the transmittance, which is zero if the timer is off
element [0][5] is the absorbance, which is zero if the timer is off
The transmittance and absorbance are determined using the reference intensity, if it is defined; otherwise the source intensity is used.

Specified by:
getVariables in interface edu.davidson.tools.SDataSource
Returns:
a one-by-three array

getVarStrings

public java.lang.String[] getVarStrings()
Returns an array of the variable names supplied by this SDataSource.
t is the simulation time in seconds
A is the absorbance
C0 through C7 are concentrations of species 0 through 7

Specified by:
getVarStrings in interface edu.davidson.tools.SDataSource

paint

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

isRunning

public boolean isRunning()
Returns true is a simulation is running.


resetSimulation

public void resetSimulation()
Resets the simulation. This method should be run before beginning a new simulation.


setCalculationOnly

public void setCalculationOnly(boolean _calcOnly)
Sets the calculation only flag. If true, no image is displayed and no animation is performed. The applet only calculates the data in the time interval t = 0 to the stop time (in seconds). The calculation does not occur in real time. The normal operation of the applet corresponds with this value being false.


setCellPathLength

public void setCellPathLength(double _length)
Sets the cell path length (in centimeters)


setCoefficient

public void setCoefficient(int _n,
                           double _coef)
Sets the stoichiometric coefficient for a single species. The stoichiometric coefficient for species 0 cannot be zero; it must be negative. Reactants have negative stoichiometric coefficients; products have positive stoichiometric coefficients. This method should not be called while a simulation is running.

Parameters:
_n - species number (0 through 7)
_coef - stoichiometric coefficient

setCoefficients

public void setCoefficients(double[] _coef)
Sets the stoichiometric coefficients for each species. The stoichiometric coefficient for species 0 cannot be zero; it must be negative. Reactants have negative stoichiometric coefficients; products have positive stoichiometric coefficients. This method should not be called while a simulation is running.


setColor

public void setColor(int _n,
                     java.awt.Color _color)
Sets the color of a single species.

Parameters:
_n - species number (0 through 7)
_color - color of species

setColor

public void setColor(int _n,
                     java.lang.String _color)
Sets the color of a single species.

Parameters:
_n - species number (0 through 7)
_color - string containing a RGB number, e.g., #FF00FF

setColors

public void setColors(java.awt.Color _color)
Sets the color of all species to the indicated color.


setColors

public void setColors(java.lang.String _color)
Sets the color of all species to the indicated color.

Parameters:
_color - string containing a RGB number, e.g., #FF00FF

setColors

public void setColors(java.awt.Color[] _colors)
Sets the colors of all species.


setColors

public void setColors(java.lang.String[] _colors)
Sets the colors of all species.

Parameters:
_colors - array of strings containing a RGB numbers, e.g., #FF00FF

setConcentrationA

public void setConcentrationA(int _n,
                              double _conc)
Sets the molar concentration of a single species in the liquid in syringe A.

Parameters:
_n - species number (0 through 7)
_conc - molar concentration
See Also:
setConcentrationB(int, double)

setConcentrationsA

public void setConcentrationsA(double[] _conc)
Sets the molar concentrations of species in the liquid in syringe A. The simulation provides for eight concentrations. Additions array elements are disregarded; missing array elements are given a value of zero.

See Also:
setConcentrationsB(double[]), setConcentrations(double[], double[])

setConcentrationB

public void setConcentrationB(int _n,
                              double _conc)
Sets the molar concentration of a single species in the liquid in syringe B.

Parameters:
_n - species number (0 through 7)
_conc - molar concentration
See Also:
setConcentrationA(int, double)

setConcentrationsB

public void setConcentrationsB(double[] _conc)
Sets the molar concentrations of species in the liquid in syringe B. The simulation provides for eight concentrations. Additions array elements are disregarded; missing array elements are given a value of zero.

See Also:
setConcentrationsA(double[]), setConcentrations(double[], double[])

setConcentrations

public void setConcentrations(double[] _concA,
                              double[] _concB)
Sets the molar concentrations of species in the liquid in syringes. The simulation provides for eight concentrations. Additions array elements are disregarded; missing array elements are given a value of zero.

Parameters:
_concA - array containing concentrations of species in syringe A
_concB - array containing concentrations of species in syringe B
See Also:
setConcentrationsA(double[]), setConcentrationsB(double[])

setFractions

public void setFractions(double _fractionA,
                         double _fractionB)
Sets the initial fractions of the total syringe volumes.

Parameters:
_fractionA - fraction of total volume of syringe A
_fractionB - fraction of total volume of syringe B
See Also:
setFractionsDelivered(double, double)

setFractionsDelivered

public void setFractionsDelivered(double _fractionA,
                                  double _fractionB)
Sets the fractions of the total syringe volumes that are delivered in the simulation. The fractions must lie between 0.1 and 1.0. The user must arbitrarily decide the total volume of liquid contained in each syringe. The simulation must not be running when this method is called. The initial volumes of each syringe should be set prior to calling this method.

Parameters:
_fractionA - fraction of total volume of syringe A delivered
_fractionB - fraction of total volume of syringe B delivered
See Also:
setFractions(double, double)

setMolarAbsorptivity

public void setMolarAbsorptivity(int _n,
                                 double _molAbs)
Sets the molar absorptivity of a single species. Units should be in L / (mole cm)

Parameters:
_n - species number (0 through 7)
_molAbs - molar absorptivity

setLightColor

public void setLightColor(double _wavelength)
Sets the light beam to the color corresponding with the indicated wavelength.

Parameters:
_wavelength - wavelength in nanometers (must lie between 380 and 780 nm)

setLightColor

public void setLightColor(java.awt.Color _color)
Sets the light color.


setMinimumStepSize

public void setMinimumStepSize(double _hmin)
Sets the minimum step size in seconds for the Fourth Order Runge-Kutta-Fehlberg algorithm. Default is 0.00001 sec.


setMolarAbsorptivities

public void setMolarAbsorptivities(double[] _molAbs)
Sets the molar absorptivities of the various species. Units should be in L / (mole cm)


setOutputIncrement

public void setOutputIncrement(double _dt)
Sets the output increment for simulation data. The simulation must be stopped before calling this method.

Parameters:
_dt - output time increment in seconds
See Also:
setTimeIncrement(double)

setOwner

public void setOwner(edu.davidson.tools.SApplet owner)
Sets the owner for the SDataSource. (In this implementation, this method does not do anything.

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

setPrecision

public void setPrecision(double _tol)
Sets the relative precision for the numerical calculations for the user-defined reaction order. Default is 0.0001


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

setRateConstant

public void setRateConstant(double _rateConstant)
Sets the rate constant based upon species 0. The units should involve, where appropriate, mole, liter, and seconds. The simulation must not be running when this method is called.


setRateLaw

public void setRateLaw(double[] _exp)
Sets the rate law for the user-defined kinetics option (see setReactionOrder). The rate law is assumed to be of the form
rate = k [A]^a [B]^b ...
The parameter _exp is an array containing the rate law exponents for each species including products. If a species does not appear in the rate law, the exponent should be set to zero.

See Also:
setReactionOrder(int)

setRateLaw

public void setRateLaw(int _n,
                       double _exp)
Sets the exponent in the rate law for a given species for the user-defined kinetics option (see setReactionOrder). The rate law is assumed to be of the form
rate = k [A]^a [B]^b ...

Parameters:
_n - species number
_exp - exponent for species in the rate law
See Also:
setReactionOrder(int)

setReactionOrder

public void setReactionOrder(int _rxnOrder)
Sets the reaction order for the kinetics. The reaction involves at least two reactants, species 0 and species 1, which are contained in the two syringes. The rate law is formulated in terms of species 0. The user is responsible to making sure species 0 is the limiting reactant in cases where this issue is relevant.

The argument _rxnOrder has the following significance:
0 = zero-order kinetics
1 = first-order kinetics (default)
2 = second-order kinetics (species 0 only)
3 = second-order kinetics (species 0 and species 1)
4 = user-defined kinetics (use setRateLaw to define coefficients)

See Also:
setRateConstant(double), setConcentrationsA(double[]), setConcentrationsB(double[]), setConcentrations(double[], double[]), setFractions(double, double), setFractionsDelivered(double, double), setRateLaw(double[])

setStandardDeviation

public void setStandardDeviation(double _std)
Sets the standard deviation for the Gaussian error applied to the absorbance. The error is treated as an absolute error in the power or intensity of light reaching the detector. The relative error in the absorbance thus gets increasingly large as the absorbance approaches zero or as the absorbance becomes large.

If the standard deviation is set to 0.001, for example,

At A = 0.0100 the uncertainty is 0.0004

At A = 0.100 the uncertainty is 0.0005

At A = 1.00 the uncertainty is 0.004

At A = 2.00 the uncertainty is 0.04

At A = 3.00 the uncertainty is 0.4

Valid only if a simulation is not running.

Parameters:
_std - the standard deviation of the Gaussian noise

setTimeIncrement

public void setTimeIncrement(double _dt)
Sets the time increment for the simulation. The simulation must be stopped before calling this method. The start time must be an integer multiple of the time increment.

Parameters:
_dt - time increment in seconds
See Also:
setOutputIncrement(double), setStartTime(double)

setStartTime

public void setStartTime(double _time)
Sets the starting time for the chemical reaction. The starting time is the time required to depresses the syringe barrels to the specified position.

Parameters:
_time - starting time in seconds

setStopTime

public void setStopTime(double _time)
Sets the stopping time for the simulation reaction.

Parameters:
_time - stopping time in seconds

step

public void step(double dt,
                 double tm)
Calculates state of system at each step in the simulation. Called only by the clock.

Specified by:
step in interface edu.davidson.tools.SStepable