org.jscience.mathematics.analysis.taylor
Class TaylorDependant

java.lang.Object
  extended by org.jscience.mathematics.analysis.taylor.TaylorDouble
      extended by org.jscience.mathematics.analysis.taylor.TaylorDependant
All Implemented Interfaces:
java.io.Serializable

public class TaylorDependant
extends TaylorDouble

Implementation of an unknown function x(t) of the independent variable t.

When performing calculations, either the Taylor coefficients must be known and set with setCoeff,
or the TaylorDependant must be governed by an ODE

x'(t) = f (x,t)
The right-hand-side function should be dependent on x, that is first x is initialized, then f is evaluated using x, an finally the ODE dependence is set using the TaylorDependant setOde method. Now the kth Taylor coefficient can be obtained from the relation
(x)k = ( f )k-1 / k

See Also:
Serialized Form

Field Summary
protected  TaylorDouble rhs
          TaylorDouble expression for the ODE governing this variable.
 
Fields inherited from class org.jscience.mathematics.analysis.taylor.TaylorDouble
coeffs, constant, independent, order
 
Constructor Summary
TaylorDependant()
          Construct new dependent variable.
TaylorDependant(double[] xn)
          Construct new dependent variable of which the first n Taylor coefficients are xn[].
 
Method Summary
 void calcOrder(int k)
          If an ODE governing this TaylorDependant is provided, the kth Taylor coefficient can be determined if right-hand-side function is known to order k-1.
 int flops(int k)
          Return the number of flops required to calculate the kth coefficient of this TaylorDouble.
 void reset()
          This method is empty, use reset(double x0) instead.
 void reset(double x0)
          Signal shift of expansion point.
 void setCoeff(int k, double d)
          Set the kth Taylor coefficient.
 void setOde(TaylorDouble f)
          Set ODE governing this TaylorDependant.
 
Methods inherited from class org.jscience.mathematics.analysis.taylor.TaylorDouble
evaluate, expandToOrder, getCoeff, getOrder, setToLength, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rhs

protected TaylorDouble rhs
TaylorDouble expression for the ODE governing this variable.

Constructor Detail

TaylorDependant

public TaylorDependant()
Construct new dependent variable.


TaylorDependant

public TaylorDependant(double[] xn)
Construct new dependent variable of which the first n Taylor coefficients are xn[].

Method Detail

calcOrder

public void calcOrder(int k)
If an ODE governing this TaylorDependant is provided, the kth Taylor coefficient can be determined if right-hand-side function is known to order k-1.

If no ODE is available, the Taylor coefficients should be set using setCoeff.

Specified by:
calcOrder in class TaylorDouble

setCoeff

public void setCoeff(int k,
                     double d)
Set the kth Taylor coefficient.

It is assumed that (only) the first k coefficients are valid; the k+1th is set to d and the order is set to k.


setOde

public void setOde(TaylorDouble f)
Set ODE governing this TaylorDependant.

If this is xi, set xi'(t) = f(x,t).


reset

public void reset()
This method is empty, use reset(double x0) instead.

Specified by:
reset in class TaylorDouble

reset

public void reset(double x0)
Signal shift of expansion point. Set the expansion point for this to x0 and reset right-hand-side function.


flops

public int flops(int k)
Return the number of flops required to calculate the kth coefficient of this TaylorDouble.

Notice that flops changes the current order, so calcOrder and flops should be separated by a call to reset.

If no ODE is set, zero is returned.

Overrides:
flops in class TaylorDouble