我正在尝试使用NDsolve来解决与ginzburg landau相关的以下非线性耦合PDE方程。我是Mathematica的新手。我收到以下错误。我正在做的错误是什么?
pde = {D[u[t, x, y], t] ==
D[u[t, x, y], {x, x}] +
D[u[t, x, y], {y,
y}] - (1/u[t, x, y])^3*(D[v[t, x, y], y]^2 +
D[v[t, x, y], x]^2) - u[t, x, y] + u[t, x, y]^3,
D[v[t, x, y], t] ==
D[v[t, x, y], {x, x}] + D[v[t, x, y], {y, y}] -
v[t, x, y]*u[t, x, y] +
(2/u[t, x, y])*(D[u[t, x, y], x]*D[v[t, x, y], x] -
D[u[t, x, y], y]*D[v[t, x, y], y])};bc = {u[0, x, y] == 0, v[0, x, y]== 0, u[t, 5, y] == 1, u[t, x, 5] == 1, D[v[t, 0, y], x] == 0, D[v[t, x, 0], y] == 0};
NDSolve[{pde, bc}, {u, v}, {x, 0, 5}, {y, 0, 5}, {t, 0, 2}]
'Error: NDSolve::deqn: Equation or list of equations expected instead of True in the first argument {{(u^(1,0,0))[t,x,y]==-u[t,x,y]+u[t,x,y]^3+(u^(0,0,y))[t,x,y]-((<<1>>^(<<3>>))[<<3>>]^2+(<<1>>^(<<3>>))[<<3>>]^2)/u[t,x,y]^3+(u^(0,x,0))[t,x,y],(v^(1,0,0))[t,x,y]==-u[t,x,y] v[t,x,y]+(v^(0,0,y))[t,x,y]+(2 (-(<<1>>^(<<3>>))[<<3>>] (<<1>>^(<<3>>))[<<3>>]+(<<1>>^(<<3>>))[<<3>>] (<<1>>^(<<3>>))[<<3>>]))/u[t,x,y]+(v^(0,x,0))[t,x,y]},{u[0,x,y]==0,v[0,x,y]==0,u[t,5,y]==1,u[t,x,5]==1,True,True}}.
NDSolve[{{Derivative[1, 0, 0][u][t, x, y] == -u[t, x, y] +
u[t, x, y]^3 + Derivative[0, 0, y][u][t, x, y] -
(Derivative[0, 0, 1][v][t, x, y]^2 +
Derivative[0, 1, 0][v][t, x, y]^2)/u[t, x, y]^3 +
Derivative[0, x, 0][u][t, x, y],
Derivative[1, 0, 0][v][t, x, y] == (-u[t, x, y])*v[t, x, y] +
Derivative[0, 0, y][v][t, x, y] +
(2*((-Derivative[0, 0, 1][u][t, x, y])*
Derivative[0, 0, 1][v][t, x, y] +
Derivative[0, 1, 0][u][t, x, y]*
Derivative[0, 1, 0][v][t, x, y]))/u[t, x, y] +
Derivative[0, x, 0][v][t, x, y]}, {u[0, x, y] == 0,
v[0, x, y] == 0, u[t, 5, y] == 1, u[t, x, 5] == 1, True,
True}}, {u, v}, {x, 0, 5}, {y, 0, 5}, {t, 0, 2}]
答案 0 :(得分:1)
如果查看bc
的值,您会看到
bc = {u[0, x, y] == 0, v[0, x, y] == 0, u[t, 5, y] == 1,
u[t, x, 5] == 1, D[v[t, 0, y], x] == 0, D[v[t, x, 0], y] == 0}
给你
{u[0, x, y] == 0, v[0, x, y] == 0, u[t, 5, y] == 1, u[t, x, 5] == 1, True, True}
这是关于True
的错误消息的来源。
你正在做的是区分表达式相对于x,但表达式中没有x,因此结果为零。并且0 == 0始终为True。与y同样。因此,让我们改变你试图告诉它边界条件的方式。
bc = {u[0, x, y] == 0, v[0, x, y] == 0, u[t, 5, y] == 1, u[t, x, 5] == 1,
Derivative[0, 1, 0][v][t, 0, y] == 0, Derivative[0, 0, 1][v][t, x, 0] == 0}
或
bc = {u[0, x, y] == 0, v[0, x, y] == 0, u[t, 5, y] == 1, u[t, x, 5] == 1,
D[v[t, x, y], x] == 0/.x->0, D[v[t, x, y], y] == 0/.y->0}
我认为其中任何一个都应该能满足您的需求。
一旦你修复了那些,那么你会得到一个关于导数阶和非负整数的不同错误。
我相信您可以通过将pde
从{x,x}
和{y,y}
更改为{x,2}
和{y,2}
来解决此问题
pde = {D[u[t, x, y], t] == D[u[t, x, y], {x, 2}] + D[u[t, x, y], {y, 2}] -
(1/u[t, x, y])^3*(D[v[t, x, y], y]^2 + D[v[t, x, y], x]^2) - u[t, x, y] +
u[t, x, y]^3,
D[v[t, x, y], t] == D[v[t, x, y], {x, 2}] + D[v[t, x, y], {y, 2}] - v[t, x, y]*
u[t, x, y] + (2/u[t, x, y])*(D[u[t, x, y], x]*D[v[t, x, y], x] - D[u[t, x, y], y]*
D[v[t, x, y], y])};
这使得该错误消失了。
一旦你修复了它并尝试了NDSolve
,那么你的分母中的零就会开始咬你。
修复这些看起来不仅仅是了解MMA语法。这可能需要了解您的问题,看看您是否可以消除这些零分母。