Message Boards Message Boards

0
|
3387 Views
|
9 Replies
|
3 Total Likes
View groups...
Share
Share this post:

How to compute these integrals symbolically?

Posted 1 year ago

Hi everybody.

\[Kappa] = 4/10000
mu = -286/100
\[Gamma]0 = 7/1000
\[Sigma]0 = 19/100
\[Theta] = \[Kappa]*mu
\[Rho] = -(67/100)
H = 72/100
K = 100
Subscript[S, 0] = 4514
r = 3/100
T = 7/252

F0[t_] := Subscript[S, 0]*E^(r*t)

Ktilde[t_] := 1 - K/F0[t]

E1[t_] := E^(\[Kappa]*t)

Ebar[t_] := E^(-\[Kappa]*t)

L0[t_] := \[Sigma]0*Ebar[t] + ((1 - Ebar[t])*\[Theta])/\[Kappa]

f0[t_] := E^(L0[t])

Subscript[\[Lambda], 1][t_, s_] := (t - s)^(H - 1/2)/Gamma[H + 1/2]

Subscript[\[Lambda], 2][t_, 
  s_] = \[Gamma]0*(Subscript[\[Lambda], 1][t, 
     s] - \[Kappa]^(1/2 - H) *E1[s]*Ebar[t]*
     Integrate [x^(H - 1/2) E^x, {x, 0, (t - s) \[Kappa]}, 
      Assumptions -> (t - s) \[Kappa] > 0])

z[s_] = Integrate[f0[u] *Subscript[\[Lambda], 2][s, u], {u, 0, s}, 
  Assumptions -> s > 0]

w[s_] = Integrate[(Subscript[\[Lambda], 2][s, u])^2, {u, 0, s}, 
  Assumptions -> s > 0]

Vbar[s_] = 
 f0[s] + \[Rho]*E^(L0[s])*
   Integrate[f0[u] *Subscript[\[Lambda], 2][s, u], {u, 0, s}, 
    Assumptions -> s > 0] + 
  1/2*E^(L0[s])*
   Integrate[(Subscript[\[Lambda], 2][s, u])^2, {u, 0, s}, 
    Assumptions -> s > 0]

in the above code, I want to compute Vbar(s), but there are two integrals that aren't computed symbolically. I wrote these integrals separately before Vbar(s), and none of them isn't computed.

How can I compute Vbar(s)?

Thank you for your help in advance.

Attachments:
POSTED BY: M M
9 Replies
Posted 1 year ago

In fact, first of all, I thought like you. But integral limitations aren't a number. how can I use NIntegrate for computing them? When I use NIntegrate, I am faced with this error "u = s is not a valid limit of integration."

Actually, after computing Vbar(s), I should compute the below integrals:

Subscript[q, 1] = 
 NIntegrate[
   f0[s] Vbar[s]*f0[u] Vbar[u], {s, 0, T}, {u, 0, s}] + \[Rho]*
   NIntegrate[
    E^(L0[s])*Vbar[s]*Subscript[\[Lambda], 2][s, u] Vbar[u], {s, 0, 
     T}, {u, 0, s}]

or

Subscript[q, 41] = 
 2*NIntegrate[
    f0[s] Vbar[s]*f0[u] Vbar[u]*(f0[l])^2, {s, 0, T}, {u, 0, s}, {l, 
     0, u}] + 
  2*NIntegrate[
    f0[s] Vbar[s]*(f0[u])^2*f0[l] Vbar[l], {s, 0, T}, {u, 0, s}, {l, 
     0, u}] + 
  NIntegrate[(f0[s])^2*f0[u] Vbar[u]*f0[v] Vbar[v], {s, 0, T}, {u, 0, 
    s}, {v, 0, s}]

but when I use NIntegrate for those integrals in Vbar(s), none of these integrals can't be computed.

what should I do?

POSTED BY: M M
Posted 1 year ago

In fact, first of all, I thought like you. But integral limitations aren't a number. how can I use NIntegrate for computing them? When I use NIntegrate, I am faced with this error "u = s is not a valid limit of integration."

Actually, after computing Vbar(s), I should compute the below integrals:

Subscript[q, 1] = 
 NIntegrate[
   f0[s] Vbar[s]*f0[u] Vbar[u], {s, 0, T}, {u, 0, s}] + \[Rho]*
   NIntegrate[
    E^(L0[s])*Vbar[s]*Subscript[\[Lambda], 2][s, u] Vbar[u], {s, 0, 
     T}, {u, 0, s}]

or

Subscript[q, 41] = 
 2*NIntegrate[
    f0[s] Vbar[s]*f0[u] Vbar[u]*(f0[l])^2, {s, 0, T}, {u, 0, s}, {l, 
     0, u}] + 
  2*NIntegrate[
    f0[s] Vbar[s]*(f0[u])^2*f0[l] Vbar[l], {s, 0, T}, {u, 0, s}, {l, 
     0, u}] + 
  NIntegrate[(f0[s])^2*f0[u] Vbar[u]*f0[v] Vbar[v], {s, 0, T}, {u, 0, 
    s}, {v, 0, s}]

but when I use NIntegrate for those integrals in Vbar(s), none of these integrals can't be computed.

what should I do?

POSTED BY: M M

See attached file.

Regards M.I.

Attachments:
POSTED BY: Mariusz Iwaniuk
Posted 1 year ago

Thanks a lot.

It works for me correctly.

POSTED BY: M M
Posted 1 year ago

Hello.

Mariusz Iwaniuk, you put a solution for me in Solution.nb. It works for me correctly but this integral can't be computed.

Subscript[q, 2] = 
 NIntegrate[
   f0[s] Vbar[s]*f0[u] Vbar[u]*f0[l] Vbar[l], {s, 0, T}, {u, 0, 
    s}, {l, 0, u}] + \[Rho]*
   NIntegrate[
    f0[s] Vbar[s]*Vbar[u]*Subscript[\[Lambda], 2][u, l] Vbar[l], {s, 
     0, T}, {u, 0, s}, {l, 0, u}] + \[Rho]*
   NIntegrate[
    Vbar[s]*f0[u] Vbar[u]*Subscript[\[Lambda], 2][s, l] Vbar[l], {s, 
     0, T}, {u, 0, s}, {l, 0, u}] + \[Rho]*
   NIntegrate[
    Vbar[s]*Subscript[\[Lambda], 2][s, u] Vbar[u]*f0[l] Vbar[l], {s, 
     0, T}, {u, 0, s}, {l, 0, u}]

could you please help me to solve this integral and get an answer? When I want to compute this integral, it remains in running mode.

Thank you in advance.

POSTED BY: M M

Do you want to speed up computations for integrals?

I have a solution, but you may not like it.

I fit the function for Vbar[s], and then I have a Vbar2[s] fitted function.

With fitted function computing integrals, it takes only a few seconds. The disadvantage of this solution may be the precision of the calculations.

Regards M.I.

Attachments:
POSTED BY: Mariusz Iwaniuk
Posted 1 year ago

Thanks Mariusz Iwaniuk.

Actually, I thought at first that this program can't compute q41 at all. But you could get an answer after 32.5 minutes. Definitely, it's a long time for me because I have 4 other integrals like q41 and it seems to take a long time for running the whole program and it's bothering me. I need to run the whole program may be more than 2000 times to get results. So, speed is very important to me.

your solution is very great for my long and complicated integrals, and they can be computed fast. About precision, the answer of q_41 is great through your solution when I compare it with the real answer, and this precision is acceptable.

The precision of your way is always like q_41 or it may be too worse in some situations.

And rather than this way, is there another way for my problem? According to what I mentioned above.

POSTED BY: Updating Name

Try post yours question here maybe you will get a better answer.

POSTED BY: Mariusz Iwaniuk

Why do you expect that there is a closed form solution?

Not all integrals can be expressed in closed form.

Try numerically by NIntegrate.

POSTED BY: Mariusz Iwaniuk
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