org.apache.commons.math.ode
Class TestProblem2

java.lang.Object
  extended by org.apache.commons.math.ode.TestProblemAbstract
      extended by org.apache.commons.math.ode.TestProblem2
All Implemented Interfaces:
org.apache.commons.math.ode.FirstOrderDifferentialEquations

public class TestProblem2
extends TestProblemAbstract

This class is used in the junit tests for the ODE integrators.

This specific problem is the following differential equation :

    y' = t^3 - t y
 
with the initial condition y (0) = 0. The solution of this equation is the following function :
   y (t) = t^2 + 2 (exp (- t^2 / 2) - 1)
 


Field Summary
 
Fields inherited from class org.apache.commons.math.ode.TestProblemAbstract
calls, errorScale, n, t0, t1, y0
 
Constructor Summary
TestProblem2()
          Simple constructor.
TestProblem2(TestProblem2 problem)
          Copy constructor.
 
Method Summary
 double[] computeTheoreticalState(double t)
          Compute the theoretical state at the specified time.
 TestProblem2 copy()
          Copy operation.
 void doComputeDerivatives(double t, double[] y, double[] yDot)
           
 
Methods inherited from class org.apache.commons.math.ode.TestProblemAbstract
computeDerivatives, getCalls, getDimension, getErrorScale, getEventsHandlers, getFinalTime, getInitialState, getInitialTime, setErrorScale, setFinalConditions, setInitialConditions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestProblem2

public TestProblem2()
Simple constructor.


TestProblem2

public TestProblem2(TestProblem2 problem)
Copy constructor.

Parameters:
problem - problem to copy
Method Detail

copy

public TestProblem2 copy()
Copy operation.

Specified by:
copy in class TestProblemAbstract
Returns:
a copy of the instance

doComputeDerivatives

public void doComputeDerivatives(double t,
                                 double[] y,
                                 double[] yDot)
Specified by:
doComputeDerivatives in class TestProblemAbstract

computeTheoreticalState

public double[] computeTheoreticalState(double t)
Description copied from class: TestProblemAbstract
Compute the theoretical state at the specified time.

Specified by:
computeTheoreticalState in class TestProblemAbstract
Parameters:
t - time at which the state is required
Returns:
state vector at time t


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.