0
$\begingroup$

Essentially, I am trying to find the following, either algebraically or numerically, where Z is defined by the piecewise function in the Mathematica code (below):

$\displaystyle{\int_0^{\infty } \left(\lambda e^{-\lambda \omega }\right) \left(\int_0^{Z(\Lambda ,u,\rho ,\psi ,\lambda )} u e^{-\rho x} \, dx+\int_{\max(Z(\Lambda ,u,\rho ,\psi ,\lambda ), \omega)}^{\infty } e^{-\rho y} \, dy\right) \, d\omega}$

I have tried (unsuccessfully) to evaluate this with the following Mathematica code:

A[Λ_, u_, ρ_, ψ_, λ_] := Integrate[(λ / E^(λ*ω))*(Integrate[u/E^(ρ*x), 
  {x, 0, Z[Λ, u, ρ, ψ, λ]}] + Integrate[E^((-ρ)*y), {y, Max[Z[Λ, u, ρ, ψ, λ], ω], ∞}]), {ω, 0, ∞}]

where:

Z[Λ_, u_, ρ_, ψ_, λ_] := Integrate[(Λ/E^(Λ*T))*
  Piecewise[{{T > (-λ^(-1))*Log[1 - u], (-λ^(-1))* Log[1 - u]}, 
   {Inequality[Log[(u + ψ)/(ψ + u*ψ)]/λ, LessEqual, T, Less, (-λ^(-1))*Log[1 - u]], 
  Piecewise[{{T >= ω, ψ*T + (1 - ψ)*(Log[-((E^(T*λ)*(1 + 2*u)*ψ)/((1 + u)*(1 + 
    E^(T*λ)*(-1 + ψ) - 2*ψ)))]/λ)}, 
  {T < ω, ψ*(Log[-((E^(T*λ)*(1 + 2*u)*ψ)/((1 + u)*(1 + E^(T*λ)*(-1 + ψ) - 2*ψ)))]/λ) + 
    (1 - ψ)*(Log[-((E^(T*λ)*(1 + 2*u)*(-1 + ψ))/((1 +  u)*(1 + (-2 + 
    E^(T*λ))*ψ)))]/λ)}}]}, 
   {T < Log[(u + ψ)/(ψ + u*ψ)]/λ,
  Piecewise[{{T >= ω, ψ*(Log[-((E^(T*λ)*(1 + 2*u)*(-1 + ψ))/((1 + u)*
    (1 + (-2 + E^(T*λ))*ψ)))]/λ) + (1 - ψ)*(Log[-((E^(T*λ)*(1 + 2*u)*ψ)/
    ((1 + u)*(1 + E^(T*λ)*(-1 + ψ) - 2*ψ)))]/λ)}, 
  {T < ω, ψ*(Log[-((E^(T*λ)*(1 + 2*u)*ψ)/((1 + u)*(1 +  E^(T*λ)*(-1 + ψ) - 2*ψ)))]/λ) +
   (1 - ψ)*(Log[-((E^(T*λ)*(1 + 2*u)*(-1 + ψ))/((1 + u)*
    (1 + (-2 +  E^(T*λ))*ψ)))]/λ)}}]}}], {T, 0, ∞}]

However, when I try to evaluate it either algebraically or numerically, Mathematica is unable to evaluate the expression. I have used the following global assumptions:

$Assumptions =  0 < u < 1 && ρ > 0 && λ > 0 && 
  0.5 < ψ < 1 && -1/λ*Log[1 - u] > Log[(u + ψ)/(ψ + u ψ)]/λ >  0 && Λ > 0

When I have tried to evaluate:

A[1, 0.8, 1, 0.7, 1]

I get the following output, with an unevaluated form of Z:

enter image description here

Also when I try to evaluate algebraically:

A[Λ, u, ρ, ψ, λ]

Mathematica returns my input as output.

I have also tried variations of A which include NIntegrate such as:

B[Λ_, u_, ρ_, ψ_, λ_] := NIntegrate[(λ E^(-λ ω))*(Integrate[(u E^(-ρ x)), 
 {x, 0, Z[Λ, u, ρ, ψ, λ]}] + 
   Integrate[(E^(-ρ y)), {y,  Max[Z[Λ, u, ρ, ψ, λ], ω], ∞}]), {ω, 0, ∞}]

and:

F[Λ_, u_, ρ_, ψ_, λ_] := NIntegrate[(λ E^(-λ ω))*(NIntegrate[(u E^(- ρ x)), 
 {x, 0, Z[Λ, u, ρ, ψ, λ]}] + 
    NIntegrate[(E^(-ρ y)), {y, Max[Z[Λ, u, ρ, ψ, λ], ω], ∞}]), {ω, 0, ∞}]

However, these do not properly evaluate either, as I get the following output:

enter image description here

I have also tried adding ?NumericQ when defining functions - but this has not worked.

Since I have specified all parameter values, I would expect Mathematica to output a single number when I specify the values for each parameter. However, I have been unsuccessful in getting Mathematica to achieve this. Does anyone have any ideas on how to get this to work?

Thanks SE

$\endgroup$

Your Answer

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

Browse other questions tagged or ask your own question.