The "simple example" doesn't re-start the integration at [1,0] for each of the integration methods; each is chained after the one preceding it. This was very confusing when I was trying to compare against results from odeint:
import timeit
from scipy.integrate import solve_ivp
import matplotlib.pyplot as plt
import numpy as np
def fprime(t, x):
gam = 0.15
return x[1], -x[0]-gam*x[1]
tic = timeit.default_timer()
sol = solve_ivp(fprime, [0.0, 10], y0=[1,0], method='RK45', dense_output=True, rtol=1e-8, atol=1e-10)
toc = timeit.default_timer()
t = np.linspace(np.min(sol.t), np.max(sol.t), 10000)
soly = sol.sol(t)
plt.plot(t, soly.T)
plt.show()
The "simple example" doesn't re-start the integration at [1,0] for each of the integration methods; each is chained after the one preceding it. This was very confusing when I was trying to compare against results from odeint: