|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJxnODE
public class JxnODE
Wrapper used to pass a system of first order differential equations (odes) to Commons Math algorithms.
Computes the derivatives dy
i/dt
defined as String[] odes
.
See CommonsMath_ODE_Lotka_Volterra~Test.jxn
for an example.
Constructor Summary | |
---|---|
JxnODE(KmgFormelInterpreter fi,
java.lang.String[] odes)
Constructs a FirstOrderDifferentialEquations
instance to be used by Commons Math algorithms. |
|
JxnODE(KmgFormelInterpreter fi,
java.lang.String init,
java.lang.String[] odes,
double[] parameters)
See JxnODE(KmgFormelInterpreter, java.lang.String, java.lang.String[], double[]) . |
Method Summary | |
---|---|
void |
computeDerivatives(double t,
double[] y,
double[] ydot)
Computes derivatives ydot from y and t (internally called by Commons Math algorithms). |
int |
getDimension()
Returns the number of states. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JxnODE(KmgFormelInterpreter fi, java.lang.String[] odes)
FirstOrderDifferentialEquations
instance to be used by Commons Math algorithms. ode = @JxODE( $this, { "$y[0]*( a - b $y[1] );", "$y[1]*( d $y[0] - c );" } )
fi
- instance of KmgFormelInterpreter
on which the definitions in odes[...]
are executedodes
- array of statement_sequences (one or more statements separated by ';
').
The definitions in odes[...]
must use double[] $y
and $t
to calculate the derivatives dy/dt
.
If the definition in odes[i]
ends with ';
', log output of intermediate steps is suppressed for the definition.public JxnODE(KmgFormelInterpreter fi, java.lang.String init, java.lang.String[] odes, double[] parameters)
JxnODE(KmgFormelInterpreter, java.lang.String, java.lang.String[], double[])
.
init
- statement_sequence (one or more statements separated by ';
'). init
is evaluated before evaluating odes
and
can use double[] $y
and $t
. If init
ends with ';
', log output is suppressed.parameters
- the values can be used in the init
and odes
definitions via the array variable $p[...]
Method Detail |
---|
public int getDimension()
getDimension
in interface FirstOrderDifferentialEquations
public void computeDerivatives(double t, double[] y, double[] ydot)
ydot
from y
and t
(internally called by Commons Math algorithms).
computeDerivatives
in interface FirstOrderDifferentialEquations
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |