NDSolve and singularity (partial differential equation)
- To: mathgroup at smc.vnet.net
- Subject: [mg45010] NDSolve and singularity (partial differential equation)
- From: Yama Masu <yamagomas at yahoo.co.jp>
- Date: Sat, 13 Dec 2003 06:05:52 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi.
I am trying to solve partial differential equation to obtain string
vibration with impulse;
D[u[x, t], {t, 2}] == D[u[x, t], {x, 2}] + f[x, t], where
f[x_, t_] = If[(t>0 && t< 0.011) && (x > -0.01 && x < 0.01), Sin[100 Pi t], 0]
with boundary condition
u[x, 0] == 0, Derivative[0, 1][u][x, 0] == 0, u[-2, t] == 0, u[1, t] == 0
for {x, -2, 1}, {t, 0, 1}.
But NDSolve misses this singularity and gives u[x,t]=0 at any x and t.
How can I have NDSolve recognize this singularity.
If I take {x,-1,1} for the range of x and boundary condition u[-1, t] == 0,
reasonable solution is obtained. This is because the singularity is in the
middle of the range and is accidentally found by NDsolve. But I want to
solve the case with impulse not exactly in the middle of the range.
If I set MaxStepSize -> {0.005, 0.005}, NDSolve finds the singularity, but
now there is big accumulated error because the step is always small even
if there is no singularity. Therefore unreasonably flat solution is obtained.
How can I set steps small for the region (t>0 && t<0.011) &&
(x>-0.01 && x<0.01) and not so big for other region as is automatically
done by NDSolve in the case -1<x<1?
I also tried MaxSteps->{5000,5000}, StartingStepSize->{0.005,0.005}
but this did not work either, just because this option sets small
steps only at the starting point i.e. t=0 x=-2 and gives large steps
around x=0 and t=0.
Any help or clue is welcome.
Thanks in advance
Masu
---------------The source I used------------------
f[x_, t_] = If[(t > 0 && t < 0.011) && (x>-0.01 && x<0.01) , Sin[100 Pi t], 0]
sol=NDSolve[
{
D[u[x, t], {t, 2}] == D[u[x, t], {x, 2}]+f[x,t],
u[x, 0] == 0,
Derivative[0, 1][u][x, 0] == 0,
u[-2, t] == 0,
u[1, t] == 0
},
u,
{x, -2, 1}, {t, 0, 1}]
{usol}={u}/.sol[[1]]
Plot[usol[x, 0.2],{x,-1,1},PlotRange->{-0.0005, 0.0009}];