3
$\begingroup$

I am new to Mathematica, and I need help with integration of the following Reliability expression (from a well-known Reliability Model).

$$R(t)=e^{-Ne^{-bt_i}(1-e^{-bt})}, t \geq 0$$

I have simplified this by saying $m = b*t_i$.

Integrate[Exp[-N*Exp[-m]*(1 - Exp[-b*t])], {t, 0, ∞},  Assumptions -> t >= 0]

But in return, I get the same expression back.

I tried numerical integration using NIntegrate and substituting values for N, m, b, but the result is too high and unrealistic.

Any suggestions would be great?


Since I care about the result after integration, i substituted numbers for n, b, $t_i$. However,

NIntegrate[Exp[-16.136 (1 - Exp[-0.012*t])], {t, 0, Infinity}]

Gives a warning NIntegrate::slwcon: Numerical integration converging too slowly; suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small. Also the output result is too large (8.430340033003202*10^27942) which doesn't make sense.

So I did this instead,

NIntegrate[Exp[-16.136 (1 - Exp[-0.012*t])], {t, 0, 1000}]

and the result is 5.53443, which makes sense for a Exp. decreasing function. I repeated this in R, with the following code

integrand <- function(t) {exp(-16.136*(1 - exp(-0.012*t)))}
integrate(integrand, 0, Inf)

And get the result with no warnings / errors.

5.534328 with absolute error < 0.00055 

Since this is a part of my data analysis exercise, I will do this in R along with my other code. Thanks :)

$\endgroup$
4
  • 2
    $\begingroup$ N is a symbol with build in meaning. You could replace it with e.g. n. You should also add additional information about all parameters as Assumptions. $\endgroup$
    – Karsten7
    Commented Jul 31, 2015 at 23:13
  • $\begingroup$ Using for instance Assumptions -> t >= 0 && n < 0 && b < 0 && m < 0 will give you an analytical solution for that integral. $\endgroup$
    – Karsten7
    Commented Jul 31, 2015 at 23:14
  • $\begingroup$ Consider also that the assumption $t\ge 0$ is implicit in the limit of integration; it is assumptions about the other parameters that will help you out. Coming at this from a different perspective, do you need a symbolic result, or could you give values to the parameters and calculate a numerical integral with NIntegrate? The latter is typically a much easier proposition than the former. $\endgroup$
    – MarcoB
    Commented Jul 31, 2015 at 23:35
  • $\begingroup$ @MarcoB Thanks. I agree, I just care about the value actually. So I have NIntegrate[Exp[-16.136 (1 - Exp[-0.012*t])], {t, 0, Infinity}] But this is unfortunately not converging. I donno why. $\endgroup$
    – tallharish
    Commented Jul 31, 2015 at 23:37

2 Answers 2

6
$\begingroup$

Since your integrand does not approach zero but a finite positive number,

Limit[Exp[-16.136 (1 - Exp[-0.012*t])], t -> Infinity]
(*  9.82255*10^-8  *)

the integral over {t, 0, Infinity} does not converge.


By the way, the error in the NIntegrate[integrand, {t, 0, 1000}] should be about 10^-7, which seems better than R. In fact, the precision seems to come out twice as good:

integrand = Exp[-16.136 (1 - Exp[-0.012*t])] // Rationalize
NIntegrate[integrand, {t, 0, 1000}] - 
 NIntegrate[integrand, {t, 0, 1000}, WorkingPrecision -> 50]
(*
  1.24345*10^-14
*)
$\endgroup$
4
$\begingroup$

When you try to NIntegrate your expression, the error messages include: "suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small". Your expression does not have a singularity, its integral is manifestly not zero, it is not oscillatory, so it must be a numerical precision problem.

Indeed, your integrand is reasonably well behaved:

LogLogPlot[Exp[-16.136 (1 - Exp[-0.012*t])], {t, 0.01, 10^8}, PlotRange -> All]

Mathematica graphics

A first attempt was to Rationalize your integrand and to integrate the exact expression ran into the same trouble as the numerical expression:

NIntegrate[Rationalize[Exp[-16.136 (1 - Exp[-0.012*t])], 0], {t, 0, Infinity}]

I suspect that the values of the function become vanishingly small for very large $t$, and this requires very high working precision to obtain an accurate result. The contribution of those vanishingly small values is, however, vanishingly small as well, so maybe we can estimate your integral by calculating it for very large t values instead. I will use the rationalized version of your expression in order to be able to use a high setting for WorkingPrecision than $MachinePrecision. Here I define a function that calculates the integral numerically between $0$ and $t_{max}$, and plots the calculated value as a function of this upper limit $t_{max}$.

Clear[int]

int[tmax_?NumericQ] :=
 NIntegrate[E^(-2017/125*(1 - E^(-3 t/250))), {t, 0, tmax}, WorkingPrecision -> 45]

LogLinearPlot[
 int[tmax], {tmax, 1, 10^8},
 MaxRecursion -> 1, PlotPoints -> 20, PlotRange -> All
]

Mathematica graphics

As you can see, the calculated value of your integral converges approximately to $5.53$ for $t_{max}\le 10^6$. After that, numerical errors seem to take over.

You are in a better position to decide how accurately you need to know the value of this integral. You will probably have to fiddle with the PrecisionGoal and WorkingPrecision settings of NIntegrate to get a better result. It may also be a good idea to try out different integration methods from the one that NIntegrate chooses by default. Those are described in detail in these documentation pages: NIntegrate Integration Strategies and NIntegrate Integration Rules.

$\endgroup$
2
  • $\begingroup$ Thanks. This helps me understand the problem. I will keep an eye on these strategies henceforth. $\endgroup$
    – tallharish
    Commented Aug 1, 2015 at 1:08
  • 4
    $\begingroup$ @tallharish The integral is not convergent, as can be seen from MarcoB's first plot. The integrand is approximately equal to 9.82255*10^-8 for t>1000, and any non-zero constant integrated from 1000 to infinity is infinite. $\endgroup$
    – bbgodfrey
    Commented Aug 1, 2015 at 1:15

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.