4
$\begingroup$

I have an increasing function $H:[0,\infty)\to[0,\infty)$, and a function G defined as $$G(t)=\int_0^t H(s)ds.$$

The function $H$ has the proprty that $H(0)=0$.

I need a numerical method to find t, given that I know $G(t)=x$ for some $x\in[0,\infty)$.

I have seen a similar question asked here: Numerical Solution to Inverse Integral (Pseudo Random Number Generation) but there was no reference and I'm not sure I understand why it works.

$\endgroup$
4
  • 3
    $\begingroup$ Is there something wrong with Newton's method? The relevant iteration reads $t_{n+1}=t_n-\frac{G(t_n)-x}{H(t_n)}$. It shouldn't take long to converge for an increasing convex function. $\endgroup$
    – Ian
    Aug 10, 2017 at 11:14
  • 1
    $\begingroup$ Is a formula for $G$ available as well, or does the integral have to be computed numerically from $H$? $\endgroup$ Aug 10, 2017 at 12:04
  • $\begingroup$ The formula for $G$ is unknown, so yes would have to be computed numerically from $H$. $\endgroup$
    – Alice
    Aug 10, 2017 at 12:20
  • $\begingroup$ I think Newton's method should be fine for most functions $H$ I would use. But suppose there is some $H$ that means computing $G(t_n)$ takes a long time, is there any other method that would give a reasonable approximation for $t$? $\endgroup$
    – Alice
    Aug 10, 2017 at 13:18

1 Answer 1

6
$\begingroup$

If $H$ is continuous, $T(x)$ defined by $\int_0^{T(x)} H(s)\; ds = x$ satisfies the differential equation $$ \dfrac{dT}{dx} = \dfrac{1}{H(T)}$$ and standard numerical methods for differential equations can be used.

$\endgroup$
4
  • $\begingroup$ Nice idea! @Alice, could you comment on how that worked for your problem? $\endgroup$
    – Dirk
    Aug 11, 2017 at 7:01
  • $\begingroup$ For this differential equation, you would have $T(0)=0$ as the initial condition. The problem I then have is that I am actually looking at functions $H$ such that $H(0)=0$. Would this be a problem when trying to solve this ODE since $\frac{dT}{dx}$ is not defined at the IC? (I realise this info should really have been in the initial question, I'll edit it now.) $\endgroup$
    – Alice
    Aug 11, 2017 at 10:51
  • $\begingroup$ @Alice Proceeding directly, that creates a problem for you indeed. But you can estimate $T(x)$ for small $x$ using some other method (for example, Newton's method, starting from a nonzero initial condition) and then use Robert Israel's suggestion for larger $x$, using that other estimate as your initial condition. $\endgroup$
    – Ian
    Aug 11, 2017 at 15:18
  • $\begingroup$ Or just compute $\int_0^{t_0} H(s)\; ds = x_0$ for some given $t_0$ and use initial condition $T(x_0) = t_0$. $\endgroup$ Aug 11, 2017 at 17:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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