package odend; import Jama.*; /** * a simple ODE for test purposes<br> * time dependent<br> * can be solved analytically */ public class SimpleODE extends ODE { /** * construct from given initial conditions x(t0) */ public SimpleODE(double x0, double t0) { super(new Matrix(new double[] {x0}, 1), t0); } /** * right hand side of ODE<br> * has explicit time dependence */ public Matrix f(Matrix x, double t) { Matrix result = new Matrix(1,1); result.set(0,0, -x.get(0,0) * Math.sin(t)); return result; } }