current time step
time dependant vector field f
time elapsed, incremented each time step
or solve
methods are called
buffer value, stores the value of the last f(u, t)
computed
last initial condition used
last solution computed
initial condition
time step
Generated using TypeDoc
Brief
Solver is a tool class to represent ordinary differential equation between vector-valued functions
Main features
Getting started
A solver is an object that models an ode between any object of type Vector. The equation has the following form
Where
u
is an unknown vector valued function andf
a smooth time dependant vector field.Initialize a solver
Solver objects are initialized with the value of the initial condition
u0
, the functionf
and the time stepdt
Therefore to initialize a solver, simply choose values of theses parameters that models your problem.Example
let f = u => u; // equation du/dt = u first order linear equation let dt = 0.1; // time step let u0 = new Vector3(1, 0, 0); // initial condition let solver = new Solver(f, dt, u0), console.log(solver.dt) // prints 0.1
Solve equations
Once you've initialized the solver, you can start compute solutions of your equation. There is two ways to do that :
let u = solver.step(); let v = solver.solve(tmax);
You can change initial condition and time step each time you call
step
andsolve
methods.let u0 = Vector3(2, 3, 7); let dt = 0.1; let u = solver.step(u0, dt);
Note currently only Euler's explicit method is provided.
Time dependant equations
Time dependant equations uses the member
t
to count time from the last initialisation/reset of the solver. Each time an equation is solved,t
is set to it's final value after solving. If you want to reset the value oft
, call thereset
method.