Recursive function with an integral

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.

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

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}]];

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.

What does step parameter mean?

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

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

(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.

In general R is this term. In my case, r + P_0X_0 - \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.

What does step parameter mean?

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