Skip to content

Commit d02ec7d

Browse files
Anna Störikoaseyboldt
authored andcommitted
Fix example without pymc
1 parent 79236f0 commit d02ec7d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/source/without_pymc.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

9495
The 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
127128
individual 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

Comments
 (0)