package odeadapt;
import Jama.*;
/**
* a simple ODE for testing
*/
public class SimpleODE extends ODE {
/**
* construct from given initial conditions x(t0)
*/
public SimpleODE(double x0, double t0) {
super(new Matrix(1,1), t0);
this.x0.set(0,0, x0);
}
/**
* 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;
}
}
![]()