1

I'm evaluating an integral and the function in the integral is another function as following.

$$\int_0^{\infty} e^{(-0.028559\cdot t)} \frac{l(x+t)}{l(x)} dt$$

Now I have created the values of $l(x)$ in Excel for ages $x=74$ to $x=106$, because Excel is (very) limited I want to do the integral in Matlab. I have found solution on how to calculate integrals in Matlab, but not with a function inside the integral like this. I will in next stage calculate the function $l(x)$ in Matlab too. I hope there is a kind soul out there that could help me.

m

  • Does $l(t)$ approach a constant as $t\to\infty$? Is it essentially constant for $t>106$? – John Wayland Bales Mar 11 '17 at 18:17
  • Good question. I assume $l(\inf)=l(106)$. –  Mar 11 '17 at 18:24
  • So you are looking for a function $F(x)=\frac{1}{l(x)}\left[\int_{74-x}^{106-x}e^{-at}l(x+t),dt+\int_{106-x}^\infty e^{-at}l(106),dt\right]$ then, for $x\ge74$. – John Wayland Bales Mar 11 '17 at 18:39
  • Yes but how fo you get Matlab to use l(x)? –  Mar 11 '17 at 20:44
  • Since your function is defined only at 33 discrete points you will have to use a curve fit of some sort. If the data are fairly smooth, Excel should be able to find an acceptable fit (just check the box to "put equation on graph."). My Matlab experience is practically non-existent, so I cannot help with that part. If your data are only approximate to begin with you could just replace the integral with a sum of integrals over unit intervals and assume $l(t)$ is linear over those intervals. – John Wayland Bales Mar 11 '17 at 20:56
  • Use interp1 to interpolate between your discrete values of $l(x)$. See my answer to this question. – horchler Mar 11 '17 at 22:03

0 Answers0