module

CrySpace::Solver

Instance methods

copy_to_matrix(matrix : Float64Tensor, row : Int, vector : Float64Tensor)
Source
euler(f : Proc(Float64Tensor, Float64, Float64Tensor), x0 : Float64Tensor, t_span : Tuple(Float64, Float64), dt : Float64)

Solves an ODE of the form dx/dt = f(x, t) using the Forward Euler method.

Source
euler(f : Proc(Float64Tensor, Float64, Float64Tensor), x0 : Float64Tensor, t_vec : Float64Tensor)

Vectorized Euler: optimized to pre-allocate result matrix and avoid copies

Source
rk4(f : Proc(Float64Tensor, Float64, Float64Tensor), x0 : Float64Tensor, t_span : Tuple(Float64, Float64), dt : Float64)

Solves an ODE of the form dx/dt = f(x, t) using the 4th Order Runge-Kutta method.

Source
rk4(f : Proc(Float64Tensor, Float64, Float64Tensor), x0 : Float64Tensor, t_vec : Float64Tensor)

Vectorized RK4: optimized to pre-allocate result matrix and avoid copies

Source
rk45(f : Proc(Float64Tensor, Float64, Float64Tensor), x0 : Float64Tensor, t_span : Tuple(Float64, Float64), tol = 1e-6)

Solves an ODE of the form dx/dt = f(x, t) using the Runge-Kutta-Fehlberg 4(5) adaptive step solver.

Source