Re: NDSolve with Boundary Condition
- To: mathgroup at smc.vnet.net
- Subject: [mg107722] Re: NDSolve with Boundary Condition
- From: dh <dh at metrohm.com>
- Date: Thu, 25 Feb 2010 01:49:08 -0500 (EST)
- References: <hm0jmr$fnp$1@smc.vnet.net>
Hi Marjan,
to make life easier, try to scale your variables that you get reasonable
numerical coefficients.
Then besides border condition, you also need initial values.
Note also, that a and b must have numerical values.
Partial derivatives at a certain place cane be specified in two ways,
either:
Derivative[1,0][Y][0,t]
or:
(D[Y[z,t],z]/.z->0)
here is an example:
eq = {D[Y[z, t], z, z] + Sin[Y[z, t]] Cos[Y[z, t]] == D[Y[z, t], t],
Derivative[1, 0][Y][0, t] == 1,
Derivative[1, 0][Y][1, t] == 1,
Y[z, 0] == Sin[2 Pi z]/(2 Pi)};
sol = Y[z, t] /. NDSolve[eq, Y[z, t], {z, 0, 1}, {t, 0, .1}][[1]]
ContourPlot[sol, {z, 0, 1}, {t, 0, .1}]
Daniel
On 23.02.2010 14:03, marjan wrote:
> Dear MathGroup members,
>
> Please help me with this:
> I am trying to solve an numerical equation: sol = NDSolve[{D[Y[z, t],
> z, z] +
> 10^12 Sin[Y[z, t]] Cos[Y[z, t]] == D[Y[z, t], t]
> with boundary conditions: d(Y[a, t])/dz = 2*10^6 and d(Y[b, t])/dz
> = 2*10^6 , but i don't know how to write the boundary condition in
> this equation. when I write it like D[Y[a, t], z] == 20*10^5, D[Y [b,
> t], z] == 20*10^5 Mathematica gives this error
>
> NDSolve::deqn: equation or list of equations expected instead of
> "false" in the first argument {D[Y[z, t], z, z] +
> 10^12 Sin[Y[z, t]] Cos[Y[z, t]] == D[Y[z, t], t] , False,False}
>
> Thanks for your attention
> Marjan
>
>
>
--
Daniel Huber
Metrohm Ltd.
Oberdorfstr. 68
CH-9100 Herisau
Tel. +41 71 353 8585, Fax +41 71 353 8907
E-Mail:<mailto:dh at metrohm.com>
Internet:<http://www.metrohm.com>