4

我正在尝试数值求解偏微分方程,其中不齐项是另一个函数的积分。像这样的东西:

NDSolve[{D[f[x, y], x] == NIntegrate[h[x,y+y2],{y2, x, y}],f[0,y] == 0}, f, { x, 0, 1}, {y,0,1}]

其中 h[x,y] 是先前定义的众所周知的函数。但似乎 Mathematica 不知道如何评估积分。

我不经常使用 Mathematica,所以我确信有一个简单的解决方案。有人可以告诉我我做错了什么吗?

谢谢。

4

1 回答 1

0

It is not really clear from the question, but I had a similar problem and the solution in my case was to follow the advice from the wolfram forums to put the integral in an extra function and force real input.

So in your case this would be

integral[x_Real,y_Real] := NIntegrate[h[x,y+y2],{y2, x, y}];
NDSolve[{D[f[x, y], x] == integral[x,y], f[0,y] == 0}, f, {x, 0, 1}, {y,0,1}]
于 2017-05-24T13:10:07.197 回答