Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.4K Views
|
9 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Recursive function with an integral

Posted 6 years ago

Hello,

Does anybody has an idea how to compute the function R?

Here is the code:

pde = (-3/2) * 1* y[x, t] * D[y[x, t], t] + 
   1/(4*y[x, t]) * D[D[y[x, t], t], t] - D[y[x, t], x] == 0`

data = RandomFunction[WienerProcess[], {0, 10, 0.01}]

w[t_] = data["PathFunction"] [t]

f[x_, t_] = y[x, t] /. sol2[[1]]

h[x_, t_] = f[x^2, t] * x

R[t_?NumericQ, x_?NumericQ] = 
   NIntegrate[h[x, R[s]] * w[s], {s, 0, t}] + x * w[t] - 
    NIntegrate[h[x, R[s]] ^2, {s, 0, t}}]

The error message is NIntegrate: s=t is not a valid limit of integration.

Thanks.

POSTED BY: Fabi An
9 Replies
Posted 6 years ago

What does step parameter mean?

Does it mean to hold the function f constant for a time step s and integrate this function ?

POSTED BY: Fabi An
Posted 6 years ago

enter image description here

POSTED BY: Fabi An
Posted 6 years ago

In general R is this term. In my case, r + P0X0 - \gamm/2 X_0^2 = 0. So you only have a stochastic integral and a riemann integral. In the code, has f the role of xi and the stochastic integral was calculated with itos formula.

POSTED BY: Fabi An
Anonymous User
Anonymous User
Posted 6 years ago

(I did not read correctly before. Your equation is a non-linear pde.)

We have NIntegrate[ f, min, max ] so R[s]] * w[s] and R[s]^2 must each evaluate to being a list {?,min,max} as the return of the function (so to be input as the same in recursion): but i can say they will not evaluate to that (they should return as a single value if the integral evaluates). And NItegrate must evaluate (it is not symbolic it intends to return values).

Without knowing what your expecting to get I'm unsure how to comment on helping to set up a recursion other than the issues stated. A little comment on the problem type and method would be helpful, as others already said.

POSTED BY: Anonymous User

Can you give me some explanation of the R function? I don't understand what you are trying to do.

POSTED BY: Wang JhONG
Posted 6 years ago

What does step parameter mean?

To calculate v, you need R and to compute R v is necessary.

POSTED BY: Fabi An

I don't understand what you are trying to do. The function R is defined in terms of itself. I think you should provide a starting value for the recursion and an explicit step parameter n and do one step at a time.

POSTED BY: Gianluca Gorni
Posted 6 years ago

Thank you. I have worked on my code. But it stil doesn't work. Here is the code

    pde = (-3/2) * 1* y[x, t] * D[y[x, t], t] + 
       1/(4*y[x, t]) * D[D[y[x, t], t], t] - D[y[x, t], x] == 0

sol2 = NDSolve[{pde, y[0, t] == Sqrt[(1.5 + Tanh[t - 100])^2]}, 
  y[x, t], {x, 0, 1}, {t, 0, 40}]

data = RandomFunction[WienerProcess[], {0, 10, 0.01}]

w[t_] = data["PathFunction"] [t]

f[x_, t_] = y[x, t] /. sol2[[1]]

h[x_, t_] = f[x^2, t] * x

Block[{$RecursionLimit = 1000}, 
 R[t_?NumberQ] := 
  NIntegrate[h[v[s], R[s]] * w[s], {s, 0, t}] + v[t] * w[t] - 
   NIntegrate[h[v[s], R[s]] ^2, {s, 0, t}]]; 

Block[{$RecursionLimit = 
   1000}, v[t_?NumberQ] := 
  NIntegrate[Exp[-f[v[s]^2, R[s]]], {s, 0, t}]];
POSTED BY: Fabi An

You are using immediate evaluation (=) and NIntegrate cannot calculate with a symbolic limit. Use delayed evaluation (:=) for the definition of R.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard