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
28
exm/zelus/brusselator/brusselator.zls
Normal file
28
exm/zelus/brusselator/brusselator.zls
Normal 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)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue