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:
Henri Saudubray 2025-08-20 18:20:46 +02:00
parent ba5db5bd99
commit f2c545ce2c
Signed by: hms
GPG key ID: 7065F57ED8856128
49 changed files with 12377 additions and 1898 deletions

View file

@ -0,0 +1,28 @@
(* The Brusselator. *)
let hybrid brusselator(a, b) = (x, y) where
rec der x = a +. x *. x *. y -. b *. x -. x init 1.0
and der y = b *. x -. x *. x *. y init 1.0
let pi = 3.141592653589793
(* Add another oscillator. *)
let hybrid harmonic(p) = x where
rec der x = v init 1.0
and der v = -2.0 *. pi *. x /. p init 0.0
(* Putting the harmonic besides the brusselator changes the output of the first.
To visualize:
dune exec ./run.exe -- -speedup 1000 -maxstep 1.0 | feedgnuplot --stream --domain --lines
*)
let hybrid print(t, x) =
present (period (100.0)) ->
(print_endline (String.concat " " (List.map string_of_float [t; x])))
else ()
let hybrid simu() =
let der t = 1.0 init 0.0 in
let (x, y) = brusselator(1.0, 2.001) in
let z = harmonic(1e-5) in
print(t, x)