@@ -85,6 +85,8 @@ ODE might look like this::
8585After defining states, parameters and right-hand-side function we can create a
8686`SympyProblem ` instance::
8787
88+ import sunode
89+
8890 problem = sunode.SympyProblem(
8991 params=params,
9092 states=states,
@@ -99,12 +101,13 @@ create a solver for no derivatives or with forward derivatives
99101(``sunode.Solver ``), or a solver that can compute gradients using
100102the adjoint ODE (``sunode.AdjointSolver ``).::
101103
102- solver = sunode.solver.Solver(problem, compute_sens=False, solver='BDF')
104+ solver = sunode.solver.Solver(problem, solver='BDF')
103105
104106We can use numpy structured arrays as input, so that we don't need to
105107think about how the different variables are stored in the array.
106108This does not introduce runtime overhead.::
107109
110+ import numpy as np
108111 y0 = np.zeros((), dtype=problem.state_dtype)
109112 y0['hares'] = 1
110113 y0['lynxes'] = 0.1
@@ -128,4 +131,4 @@ We can convert the solution to an xarray Dataset or access the
128131individual states as numpy record array::
129132
130133 solver.as_xarray(tvals, output).solution_hares.plot()
131- plt.plot(output.view(tvals, problem.state_dtype)['hares'])
134+ plt.plot(tvals, output.view(problem.state_dtype)['hares'])
0 commit comments