feat: support for model-requested horizons
This commit is contained in:
parent
685de96eec
commit
ac4e066bf8
24 changed files with 170 additions and 93 deletions
|
|
@ -11,7 +11,7 @@ let zsize = 1
|
|||
|
||||
let fder y yd omega =
|
||||
yd.{0} <- omega *. y.{1}; yd.{1} <- -.omega *. y.{0}; yd.{2} <- 1.0; yd
|
||||
let fout _ _ y = of_array [| y.{0}; y.{1}; y.{2} |]
|
||||
let fout _ _ _ y = of_array [| y.{0}; y.{1}; y.{2} |]
|
||||
let step { si; sx } sin0 cos0 =
|
||||
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 }
|
||||
|
|
@ -26,9 +26,9 @@ let sinus_cosinus theta0 omega =
|
|||
let cos0 = Float.cos theta0 in
|
||||
let yd = cmake csize in
|
||||
let zout = cmake zsize in
|
||||
let fder _ _ y = fder y yd omega in
|
||||
let fzer _ _ _ = zout in
|
||||
let step s _ = step s sin0 cos0 in
|
||||
let fder _ _ _ y = fder y yd omega in
|
||||
let fzer _ _ _ _ = zout in
|
||||
let step s _ _ = step s sin0 cos0 in
|
||||
let state = { sx=of_array [| sin0; cos0; 0.0 |]; si=true } in
|
||||
let reset _ _ = state in
|
||||
HNode { state; fder; fzer; fout; step; reset; horizon;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue