1
$\begingroup$

Suppose I know a function $f(t)$ and all its derivatives in $t$ in closed form. Given $a(0)$ and some $t_0>0$, I'm looking for an explicit integrator that can estimate $a(t_0)$, where $a(\cdot)$ satisfies the ODE: $$\frac{da(t)}{dt}=e^{-a(t)}f(t).$$ I'm willing to compute (in closed-form) any derivatives $f^{(k)}(t)$ if that helps.

Of course I can apply the usual explicit methods (forward Euler, RK3), but I'm hoping to find an integrator that's reversible in time. And, ideally, one that exploits special structure in the ODE above, e.g. by somehow integrating the exponential, to achieve higher accuracy on some model problems.

Any suggestions?

$\endgroup$
2
  • 1
    $\begingroup$ Start by integrating it analytically. $\endgroup$ Apr 14 at 19:45
  • 2
    $\begingroup$ For this (scalar) ODE, any standard method you choose will give you an answer accurate to several digits with extremely little computational cost. Can you explain why that's not good enough? $\endgroup$ Apr 15 at 5:15
5
$\begingroup$

You want a numerical solution, but this might help you check your computed results.

If $a$ satisfies the ODE, you know $e^{a(t)}a'(t) = f(t)$. Integrating you get \begin{align} \int_0^t\, f(\tau)\, d\tau &= \int_0^t e^{a(\tau)}a'(\tau)\, d\tau \\ &= \int_{a(0)}^{a(t)} e^a da \\ &= e^{a(t)} - e^{a(0)}. \end{align}

$\endgroup$
2
  • 1
    $\begingroup$ Yes, this is more or less where my ODE comes from :-) --- my fear was that if you integrate the left hand side the wrong way you might end up making this unsatisfiable (e.g. log of a negative number). $\endgroup$ Apr 14 at 19:56
  • 1
    $\begingroup$ @JustinSolomon If $f(t)>0$ Just use Gauss quadrature, which has positive weights. If $f(t)$ changes sign, then you may be right to worry about this approach, but unless $\int f(t) =0$ for some intervals then a sufficiently accurate quadrature will guarantee positivity. $\endgroup$ Apr 15 at 5:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.