chore: update
This commit is contained in:
parent
4776edc9db
commit
416d97c513
25 changed files with 1653 additions and 283 deletions
21
exm/sincos/sincos.zls
Normal file
21
exm/sincos/sincos.zls
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
let dt = 0.001 (* Integration step *)
|
||||
|
||||
let node f_integr (x0, x') = x where (* Forward Euler integrator *)
|
||||
rec x = x0 -> pre (x +. x' *. dt)
|
||||
let node b_integr (x0, x') = x where (* Backward Euler integrator *)
|
||||
rec x = x0 -> (pre x) +. x' *. dt
|
||||
|
||||
let node sincos () = (sin, cos) where
|
||||
rec sin = f_integr(0.0, cos)
|
||||
and cos = b_integr(1.0, -. sin)
|
||||
|
||||
let node main () =
|
||||
let rec t = 0.0 -> pre t +. dt in
|
||||
let (sin, cos) = sincos () in
|
||||
match t <= 500.0 with
|
||||
| true ->
|
||||
(print_float t; print_string "\t";
|
||||
print_float sin; print_string "\t";
|
||||
print_float cos; print_newline ())
|
||||
| false -> ()
|
||||
Loading…
Add table
Add a link
Reference in a new issue