Skip to content

Commit

Permalink
further documentation tweaks
Browse files Browse the repository at this point in the history
Signed-off-by: Marcello Seri <marcello.seri@gmail.com>
  • Loading branch information
mseri committed Aug 23, 2019
1 parent 11473c6 commit 9882086
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ode/tutorial.mld
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ We begin by defining a function \(f(y, t)\) that corresponds to
the RHS of the differential equation
{[
let f y t =
let a = [|[|1.; -1.|];
let a = [|[|1.; -1.|];
[|2.; -3.|]|]
|> Owl.Mat.of_arrays
in
Owl.Mat.(a *@ y)
]}
and the initial condition $y0$
and the initial condition \(y0\)
{[
let y0 = Mat.of_array [|-1.; 1.|] 2 1
]}
Expand All @@ -45,7 +45,9 @@ numerical solution, and a step size dt.

Finally we can call
{[
let ts, ys = Owl_ode.odeint (module Owl_ode.Native.D.RK4) f y0 tspec ()
let ts, ys = Owl_ode.(
odeint Native.D.rk4 f y0 tspec ()
)
]}
to get an array with the approximate value of the vector y
at the times ts. As you can see from the snippet above, you
Expand Down

0 comments on commit 9882086

Please sign in to comment.