|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
edu.davidson.tools.SApplet
stoppedFlow.StoppedFlow
public class StoppedFlow
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. |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.BaselineResizeBehavior |
| Field Summary |
|---|
| Fields inherited from class edu.davidson.tools.SApplet |
|---|
clock, dataConnections, dataListeners, dataSources, lock |
| 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, deleteDataConnection, deleteDataConnections, forward, getClockID, getClockTime, getDataConnectionFromDL, getDataConnectionFromDS, getDataFromDS, getDataListener, getDataListener, getDataSource, getDataSource, getID, getRunningID, getSourceData, getSourceVariables, isAutoRefresh, isClockRunning, makeDataConnection, pause, 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, 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, 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, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, 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 |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.davidson.tools.SDataSource |
|---|
getID |
| Constructor Detail |
|---|
public StoppedFlow()
| Method Detail |
|---|
public java.lang.String getParameter(java.lang.String key,
java.lang.String def)
public void init()
init in class java.applet.Appletpublic void start()
start in class java.applet.Appletpublic void startSimulation()
stopSimulation()public void stop()
stop in class java.applet.Appletpublic void stopSimulation()
startSimulation()public void destroy()
destroy in class edu.davidson.tools.SAppletpublic java.lang.String getAppletInfo()
getAppletInfo in class java.applet.Appletpublic java.lang.String[][] getParameterInfo()
getParameterInfo in class java.applet.Appletpublic void clearCoefficients()
public void clearColors()
public void clearConcentrationsA()
public void clearConcentrationsB()
public void clearMolarAbsorptivities()
public void clearRateLaw()
public double getAbsorbance(double[] _conc)
public double[] getAbsorbanceDataSet()
public double getAbsorbanceDataSet(int _i)
public java.awt.Color getColor(int _red,
int _green,
int _blue)
public java.awt.Color getColor(double[] _conc)
public double[][] getDataSet()
public double[] getDataSet(int _n)
public double getDataSet(int _n,
int _i)
public edu.davidson.tools.SApplet getOwner()
getOwner in interface edu.davidson.tools.SDataSourcepublic double[][] getVariables()
getVariables in interface edu.davidson.tools.SDataSourcepublic java.lang.String[] getVarStrings()
getVarStrings in interface edu.davidson.tools.SDataSourcepublic void paint(java.awt.Graphics g)
paint in class java.awt.Containerpublic boolean isRunning()
public void resetSimulation()
public void setCalculationOnly(boolean _calcOnly)
public void setCellPathLength(double _length)
public void setCoefficient(int _n,
double _coef)
_n - species number (0 through 7)_coef - stoichiometric coefficientpublic void setCoefficients(double[] _coef)
public void setColor(int _n,
java.awt.Color _color)
_n - species number (0 through 7)_color - color of species
public void setColor(int _n,
java.lang.String _color)
_n - species number (0 through 7)_color - string containing a RGB number, e.g., #FF00FFpublic void setColors(java.awt.Color _color)
public void setColors(java.lang.String _color)
_color - string containing a RGB number, e.g., #FF00FFpublic void setColors(java.awt.Color[] _colors)
public void setColors(java.lang.String[] _colors)
_color - array of strings containing a RGB numbers, e.g., #FF00FF
public void setConcentrationA(int _n,
double _conc)
_n - species number (0 through 7)_conc - molar concentrationsetConcentrationB(int, double)public void setConcentrationsA(double[] _conc)
setConcentrationsB(double[]),
setConcentrations(double[], double[])
public void setConcentrationB(int _n,
double _conc)
_n - species number (0 through 7)_conc - molar concentrationsetConcentrationA(int, double)public void setConcentrationsB(double[] _conc)
setConcentrationsA(double[]),
setConcentrations(double[], double[])
public void setConcentrations(double[] _concA,
double[] _concB)
_concA - array containing concentrations of species in syringe A_concB - array containing concentrations of species in syringe BsetConcentrationsA(double[]),
setConcentrationsB(double[])
public void setFractions(double _fractionA,
double _fractionB)
_fractionA - fraction of total volume of syringe A_fractionB - fraction of total volume of syringe BsetFractionsDelivered(double, double)
public void setFractionsDelivered(double _fractionA,
double _fractionB)
_fractionA - fraction of total volume of syringe A delivered_fractionB - fraction of total volume of syringe B deliveredsetFractions(double, double)
public void setMolarAbsorptivity(int _n,
double _molAbs)
_n - species number (0 through 7)_molAbs - molar absorptivitypublic void setLightColor(double _wavelength)
_wavelength - wavelength in nanometers (must lie between 380 and 780 nm)public void setLightColor(java.awt.Color _color)
public void setMinimumStepSize(double _hmin)
public void setMolarAbsorptivities(double[] _molAbs)
public void setOutputIncrement(double _dt)
_dt - output time increment in secondssetTimeIncrement(double)public void setOwner(edu.davidson.tools.SApplet owner)
setOwner in interface edu.davidson.tools.SDataSourceowner - owner of the data sourcepublic void setPrecision(double _tol)
public void setRandom(long rnd)
rnd - the seed value for the random number generatorpublic void setRateConstant(double _rateConstant)
public void setRateLaw(double[] _exp)
setReactionOrder(int)
public void setRateLaw(int _n,
double _exp)
_n - species number_exp - exponent for species in the rate lawsetReactionOrder(int)public void setReactionOrder(int _rxnOrder)
setRateConstant(double),
setConcentrationsA(double[]),
setConcentrationsB(double[]),
setConcentrations(double[], double[]),
setFractions(double, double),
setFractionsDelivered(double, double),
setRateLaw(double[])public void setStandardDeviation(double _std)
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.
_std - the standard deviation of the Gaussian noisepublic void setTimeIncrement(double _dt)
_dt - time increment in secondssetOutputIncrement(double),
setStartTime(double)public void setStartTime(double _time)
_time - starting time in secondspublic void setStopTime(double _time)
_time - stopping time in seconds
public void step(double dt,
double tm)
step in interface edu.davidson.tools.SStepable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||