1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# 1 "src/ode/native/native_d.ml"
type mat = Owl_dense_matrix_d.mat
include Native_generic.Make (Owl_dense_ndarray.D)
module Euler = struct
type state = mat
type f = mat -> float -> mat
type step_output = mat * float
type solve_output = mat * mat
let step = euler_s
let solve = prepare step
end
module Midpoint = struct
type state = mat
type f = mat -> float -> mat
type step_output = mat * float
type solve_output = mat * mat
let step = midpoint_s
let solve = prepare step
end
module RK4 = struct
type state = mat
type f = mat -> float -> mat
type step_output = mat * float
type solve_output = mat * mat
let step = rk4_s
let solve = prepare step
end
module RK23 = struct
type state = mat
type f = mat -> float -> mat
type step_output = mat * float * float * bool
type solve_output = mat * mat
let step = rk23_s ~tol:1e-7 ~dtmax:1E-4
let solve = adaptive_prepare (rk23_s ~tol:1E-7)
end
module RK45 = struct
type state = mat
type f = mat -> float -> mat
type step_output = mat * float * float * bool
type solve_output = mat * mat
let step = rk45_s ~tol:1e-7 ~dtmax:1E-4
let solve = adaptive_prepare (rk45_s ~tol:1E-7)
end