cviode

Contact variational integrators - native ocaml version
Library cviode
Module Cviode . S . Contact1_damped

Parameters

module A : sig ... end

Signature

type state = mat * mat

state is the type of the state (and thus also of the initial condition) provided to Owl_ode_base.Ode.odeint. For example Owl.Mat.mat.

type f = (mat * mat) -> float -> mat

f is type of the evolution function. For example, in the case of sympletic solvers, type state = Owl.Mat.(mat*mat) and type f = state -> float -> Owl.Mat.mat.

type step_output = (mat * mat) * float

step_output defines the type of the output of Owl_ode.Ode.step. For example, in the case of native adaptive solvers, type output = Owl.Mat.(mat * float * float * bool), corresponds to matrices and floats that contain respectively the y1, t1, dt, and whether this step was valid

type solve_output = mat * mat * mat

solve_output defines the type of the output of Owl_ode.Ode.odeint. For example, in the case of sympletc solvers, type output = Owl.Mat.(mat * mat * mat), corresponds to matrices that contain respectively the time, position, and momentum coordinates of the integrated solution

val step : f -> dt:float -> state -> float -> step_output

step f dt y0 t0 () solves for one step given dt, y0, t0 and the evolution function. Several such functions have already been implemented in this library and can be used as reference.

val solve : f -> state -> Owl_ode.Types.tspec -> unit -> solve_output

solve f y0 tspec () solves the initial value problem

∂ₜ y = f(y, t) y(t₀) = y₀

with the given evolution function f, initial condition y0, and temporal specification tspec, and returns the desired outputs of type output. Several such functions have already been implemented in this library and can be used as reference.