Re: PDE with two variables by NDSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg94618] Re: PDE with two variables by NDSolve
- From: dh <dh at metrohm.com>
- Date: Wed, 17 Dec 2008 06:37:09 -0500 (EST)
- References: <gi5jdq$phm$1@smc.vnet.net>
Hi Alexei,
I forgot to mention another point about NDSolve. NDSolve is made for
time dependent problems. From the manual:
"all of these functions must depend on a single "independent variable"
t, which is the same for each function."
Daniel
Alexei Boulbitch wrote:
> Dear MathGroup members,
>
> I have a misunderstanding when solving a partial differential equation with M6. It is a rather simple equation for a function z=z(x,y):
>
> pde = \!\(
> \*SubscriptBox[\(\[PartialD]\), \({x, 2}\)]\ \(z[x, y]\)\) + \!\(
> \*SubscriptBox[\(\[PartialD]\), \({y, 2}\)]\ \(z[x,
> y]\)\) - (1 - 3*Exp[-(x^2 + y^2)])*z[x, y] -
> Log[(1 + z[x, y])/(1 - z[x, y])] == 0;
>
> with simple boundary conditions fixed on a square 10x10. The function should be there either zero, or something small, but different from zero like 0.01. Let us take zero:
>
> bc = {z[-10, y] == z[10, y] == 0, z[x, -10] == z[x, 10] == 0};
>
> Now application of the NDSolve operator:
>
> sol = NDSolve[{pde, bc}, z, {x, -10, 10}, {y, -10, 10}]
>
> returns the error message:
>
> NDSolve::ivone: Boundary values may only be specified for one \
> independent variable. Initial values may only be specified at one \
> value of the other independent variable. >>
>
> I understand this response, as if Mathematica does not support boundary conditions fixed for both of the variables.
> However, in Help/NDSolve/ Scope/Partial Differential Equations/Example Nr 3 shows the following code for SineGordon:
>
> L = 4;
> sol = NDSolve[{D[u[t, x, y], t, t] ==
> D[u[t, x, y], x, x] + D[u[t, x, y], y, y] + Sin[u[t, x, y]],
> u[t, -L, y] == u[t, L, y], u[t, x, -L] == u[t, x, L],
> u[0, x, y] == Exp[-(x^2 + y^2)],
> Derivative[1, 0, 0][u][0, x, y] == 0},
> u, {t, 0, L/2}, {x, -L, L}, {y, -L, L}]
>
> in which the line u[t, -L, y] == u[t, L, y], u[t, x, -L] == u[t, x, L] fixes very similar type of boundary conditions.
>
> What´s wrong?
>
> Regards, Alexei