@@ -62,7 +62,7 @@ ODE might look like this::
6262 dhares = p.alpha * hares - p.beta * lynxes * hares
6363 dlynxes = p.delta * hares * lynxes - p.gamma * lynxes
6464 return {
65- 'log_hares': dhares / hares
65+ 'log_hares': dhares / hares,
6666 'log_lynxes': dlynxes / lynxes,
6767 }
6868
@@ -88,7 +88,8 @@ After defining states, parameters and right-hand-side function we can create a
8888 problem = sunode.SympyProblem(
8989 params=params,
9090 states=states,
91- rhs_sympy=lotka_volterra
91+ rhs_sympy=lotka_volterra,
92+ derivative_params=()
9293 )
9394
9495The problem provides structured numpy dtypes for states and parameters
@@ -106,7 +107,7 @@ This does not introduce runtime overhead.::
106107
107108 y0 = np.zeros((), dtype=problem.state_dtype)
108109 y0['hares'] = 1
109- y0['lynx '] = 0.1
110+ y0['lynxes '] = 0.1
110111
111112 # At which time points do we want to evalue the solution
112113 tvals = np.linspace(0, 10)
@@ -127,4 +128,4 @@ We can convert the solution to an xarray Dataset or access the
127128individual states as numpy record array::
128129
129130 solver.as_xarray(tvals, output).solution_hares.plot()
130- plt.plot(output.view(problem.state_dtype)['hares']
131+ plt.plot(output.view(tvals, problem.state_dtype)['hares'])
0 commit comments