feat (notes): reorganise and update (and some formatting)

This commit is contained in:
Henri Saudubray 2025-05-01 12:05:09 +02:00
parent 3b5e01b163
commit dd6152833f
Signed by: hms
GPG key ID: 7065F57ED8856128
6 changed files with 211 additions and 209 deletions

View file

@ -13,7 +13,7 @@ let zsize = 1
let fzer _ _ _ = zout
let fout _ _ y = of_array [| y.{0}; y.{1}; y.{2} |]
let cget s = s.sx
let cset s lx = { s with sx = lx }
let cset s lx = { s with sx=lx }
let zset s _ = s
let jump _ = true
let horizon _ = max_float
@ -25,11 +25,11 @@ let sinus_cosinus theta0 omega =
yd.{0} <- omega *. y.{1}; yd.{1} <- -.omega *. y.{0}; yd.{2} <- 1.0; yd in
let step { si; sx } _ =
let sx = if si then of_array [| sin0; cos0; 0.0 |] else sx in
of_array [| sx.{0}; sx.{1}; sx.{2} |], { sx; si = false } in
let state = { sx = of_array [| sin0; cos0; 0.0 |]; si = true } in
of_array [| sx.{0}; sx.{1}; sx.{2} |], { sx; si=false } in
let state = { sx=of_array [| sin0; cos0; 0.0 |]; si=true } in
let reset _ _ = state in
HNode {
state; fder; fzer; fout; step; horizon; cset; cget; zset; zsize; reset; jump
state; fder; fzer; fout; step; horizon; cset; cget; zset; zsize; reset; jump
}
let errmsg_invalid = "Invalid arguments to model (needed: 2 floats)"