In the book Breuer, Heinz-Peter, and Francesco Petruccione. The Theory of Open Quantum Systems. Oxford: Clarendon Press, 2009., there is equation(10.17)
$$ \frac{\mathrm{d}}{\mathrm{d}t}c_1(t) = - \int_0^t \mathrm{d}t_1 f(t-t_1) c_1(t_1) $$ where $$ f(t) = \frac{1}{2} \gamma_0\lambda e^{-\lambda |t|} $$ $\gamma_0$ and $\lambda$ are parameters, for example, we can set $\gamma_0=1, \lambda=10$. For this $f(t)$, we can solve it analytically, the solution is $$ c_1(t) = c_1(0) e^{-\lambda t/2} \left[\cosh\left(\frac{dt}{2}\right) + \frac{\lambda}{d} \sinh\left(\frac{dt}{2}\right) \right] $$ where $d = \sqrt{\lambda^2 - 2\gamma_0\lambda}$.
My question is, how to numerically solve (for example, using python function scipy.integrate.solve_ivp, which is a function solving OEDs by Runge-Kutta method or other methods) this equation?
I want to numerically solve it, because for other form of $f(t)$, we may not solve it analytically.
As a first approach you can do something like the following to match the analytical solution
And you can compare to the analytical solution using
Which will show