Message Boards Message Boards

0
|
8117 Views
|
6 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Integral evaluation fails

Posted 11 years ago

Hi All, I was trying to derive a formula by evaluating an integral. I defined all the restrictions for that setting and I wanted to have the solution in terms of a simplified formula. But Mathematica did not give the solution like last time (with some modification). I was wondering if there is anyone who can help me solve this problem.

Thank you in advance for your kind attention and support.

Here is the code for the equation A with Cp and infectable functions defined in it.

Cp[te_, Di_, Dv_, D0_] :=
 Which[
  Di + D0 <= Dv + te || Dv + te <= 0, 0,
  D0 < Dv + te && D0 + te < 0 && Di > Dv + te, Inf/(Inf + Ip),
  D0 < Dv + te && D0 + te >= 0 && Di > Dv + te, (D0 Inf)/(
  D0 Inf - Ip te),
  Di <= Dv + 
     te && ((te == 0 && D0 >= Dv) || (D0 >= Dv + te && te >= 0)), Di/
  Dv,
  D0 >= Dv + te && D0 + te < 0 && Di <= Dv + te, (Di Inf)/(
  D0 Ip + Inf (Dv + te)),
  D0 >= Dv + te && te < 0 && D0 + te >= 0 && Di <= Dv + te, (Di Inf)/(
  Dv Inf + Inf te - Ip te),
  D0 < Dv + te && D0 + Di >= Dv + te && D0 + te < 0 && 
   Di <= Dv + te, (Inf (D0 + Di - Dv - te))/(D0 (Inf + Ip)),
  D0 < Dv + te && D0 + Di >= Dv + te && te < 0 && D0 + te >= 0 && 
   Di <= Dv + te, (Inf (D0 + Di - Dv - te))/(D0 Inf - Ip te),
  te == 0 && D0 < Dv && D0 + Di >= Dv, (D0 + Di - Dv)/D0,
  D0 < Dv + te && D0 + Di >= Dv + te && te >= 0, 
  1 + (Di - Dv)/(D0 - te),
  D0 >= Dv + te && D0 + te < 0 && Di > Dv + te && Dv + te > 0, (
  Inf (Dv + te))/(D0 Ip + Inf (Dv + te)),
  D0 >= Dv + te && D0 + te >= 0 && Di > Dv + te && Dv + te > 0, (
  Inf (Dv + te))/(Dv Inf + (Inf - Ip) te),
  True, 0]
infectable[t_] := UnitStep[t]*UnitStep[D0 - t]
{$Assumptions = 
   Di < Dv && Dv < D0 && Di > 0 && Di \[Element] Reals && 
    D0 \[Element] Reals && Inf > 0 && Inf \[Element] Reals && 
    Ip > 0  && Ip \[Element] Reals  };
A = FullSimplify[(Inf/N/D0)*phi*tau*
   Integrate[
    Integrate[
     Integrate[
      infectable[ti] Cp[te, Di, Dv, D0], {tx, te + Dv, ti + Di}], {ti,
       te + Dv - Di, te + Dv}], {te, -Dv, D0 - Dv + Di}]]

It used to work when the Cp was defined as (Cor) for the integral (A).

Cor[te_, Di_, Dv_, D0_] :=
 Which[Di > Dv + te && Dv + te > 0, 1,
  te >= 0 && Dv + te <= D0, Di/Dv,
  te < 0 && Di <= Dv + te && Dv + te <= D0, Di/(Dv + te),
  te < 0 && Dv + te > D0, (Di - Dv - te + D0)/D0,
  Di + D0 < Dv + te || Dv + te <= 0, 0,
  True, 1 + (-Di + Dv)/(te - D0)]

infectable[t_] := UnitStep[t]*UnitStep[D0 - t]

{$Assumptions = 
   Di < Dv && Dv < D0 && Di > 0 && Di \[Element] Reals && 
    D0 \[Element] Reals && Inf > 0 && Inf \[Element] Reals && 
    Ip > 0  && Ip \[Element] Reals  };
A = FullSimplify[(Inf/N/D0)*phi*tau*
   Integrate[
    Integrate[
     Integrate[
      infectable[ti] Cor[te, Di, Dv, D0], {tx, te + Dv, 
       ti + Di}], {ti, te + Dv - Di, te + Dv}], {te, -Dv, 
     D0 - Dv + Di}]]

Here is the result from that equation

1/(4 D0 Dv N)
  Inf phi tau (Di (2 D0 Di^2 + (3 Di - 2 Dv) (Di - Dv) Dv) + 
    2 Dv ((-Di + Dv)^3 Log[1 - Di/Dv] + Di^3 Log[Dv/Di]))
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract

Be respectful. Review our Community Guidelines to understand your role and responsibilities. Community Terms of Use