feat: start of lift, debugging, cleanup
This commit is contained in:
parent
883e5fff01
commit
589f89c768
31 changed files with 1297 additions and 51 deletions
|
|
@ -40,7 +40,7 @@ let step ({ zin; lx; _ } as s) zfalse =
|
|||
of_array [| -. 0.8 *. lx.{0}; 0.0; lx.{2}; lx.{3} |] else lx in
|
||||
of_array [| s.lx.{1} |], { zin=zfalse; lx; i=false }
|
||||
|
||||
let bouncing_ball () : (_, _, carray, carray, carray, zarray, carray) hnode =
|
||||
let bouncing_ball () : (_, _, _, carray, carray, carray, zarray, carray) hrec =
|
||||
let yd = cmake csize in
|
||||
let zout = cmake zsize in
|
||||
let zfalse = zmake 1 in
|
||||
|
|
@ -49,10 +49,10 @@ let bouncing_ball () : (_, _, carray, carray, carray, zarray, carray) hnode =
|
|||
let step s _ = step s zfalse in
|
||||
let state = { zin=zfalse; lx=of_array [|y'0;y0;x'0;x0|]; i=true } in
|
||||
let reset _ _ = state in
|
||||
HNode { state; fder; fzer; fout; step; reset; horizon;
|
||||
jump; cset; cget; zset; csize; zsize }
|
||||
{ state; fder; fzer; fout; step; reset; horizon; jump; cset; cget; zset;
|
||||
csize; zsize }
|
||||
|
||||
let errmsg = "Too many arguments for the model (needed: 0)"
|
||||
let init = function
|
||||
| [] -> bouncing_ball ()
|
||||
| [] -> HNode (bouncing_ball ())
|
||||
| _ -> raise (Invalid_argument errmsg)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue