feat: somewhat compatible with zelus output
This commit is contained in:
parent
589f89c768
commit
6d92261afd
19 changed files with 107 additions and 515 deletions
|
|
@ -2,18 +2,21 @@ let g = 9.81
|
|||
let y0 = 50.0
|
||||
let y'0 = 0.0
|
||||
|
||||
let hybrid ball (y0, y'0) = y where
|
||||
let hybrid ball (y0, y'0) = (y, y', z) where
|
||||
rec der y = y' init y0
|
||||
and der y' = -. g init y'0 reset z -> -0.8 *. (last y')
|
||||
and z = up(-. y)
|
||||
|
||||
let hybrid main () =
|
||||
let der t = 1.0 init 0.0 in
|
||||
let y = ball (y0, y'0) in
|
||||
let z = period(0.01) in
|
||||
present z -> (
|
||||
let rec der p = 1.0 init -0.01 reset s -> -0.01
|
||||
and s = up(p) in
|
||||
let (y, y', z) = ball (y0, y'0) in
|
||||
present z | s -> (
|
||||
print_float t;
|
||||
print_string "\t";
|
||||
print_float y;
|
||||
print_string "\t";
|
||||
print_float y';
|
||||
print_newline ()
|
||||
); ()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue