feat: a LOT of stuff (final report, examples, simulation of a single assert, move from node instances to node definitions, etc.)
This commit is contained in:
parent
ba5db5bd99
commit
f2c545ce2c
49 changed files with 12377 additions and 1898 deletions
37
exm/zelus/odes/odes.zls
Normal file
37
exm/zelus/odes/odes.zls
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
|
||||
let hybrid vdp mu () = (x, y) where
|
||||
rec der x = y init 1.0
|
||||
and der y = (mu *. (1.0 -. (x *. x)) *. y) -. x init 1.0
|
||||
|
||||
let hybrid sincos () = (sin, cos) where
|
||||
rec der sin = cos init 0.0
|
||||
and der cos = -. sin init 1.0
|
||||
|
||||
let hybrid both () = (x, y, s, c) where
|
||||
(x, y) = vdp 5.0 ()
|
||||
and (s, c) = sincos ()
|
||||
|
||||
let vdp_d = Solve.solve_sundials (vdp 5.0)
|
||||
let sincos_d = Solve.solve_sundials sincos
|
||||
let both_d = Solve.solve_sundials both
|
||||
|
||||
let main_d = Solve.synchr sincos_d both_d
|
||||
|
||||
let node print_vdp (now, (x, y)) =
|
||||
print_endline (String.concat ",\t\t" (List.map string_of_float [now;x;y]))
|
||||
|
||||
let node print_sincos (now, (s, c)) =
|
||||
print_endline (String.concat ",\t\t" (List.map string_of_float [now;s;c]))
|
||||
|
||||
let node print_both (now, (x, y, s, c)) =
|
||||
print_endline (String.concat ",\t\t" (List.map string_of_float [now;x;y;s;c]))
|
||||
|
||||
let node print_main (now, ((s1, c1), (x, y, s2, c2))) =
|
||||
print_endline (String.concat ",\t\t" (List.map string_of_float [now;x;y]))
|
||||
|
||||
let input _ = ()
|
||||
|
||||
let node main () =
|
||||
let i = Some (Solve.make(1000.0, input)) fby None in
|
||||
let o = run main_d i in
|
||||
Solve.period'_t 0.01 print_main o
|
||||
Loading…
Add table
Add a link
Reference in a new issue