2
$\begingroup$

I tried to use 'finite difference' method to solve an Initial Value Problem (IVP). For the two boundaries I used periodical condition and for the differential operators I used 4th degree center approximations. But as result, I got this thing. Where comes this strange oscillation What do you think could be the problem. Should I use a smaller x step size? Will use a forward approximation help? Thanks. Actually I am using Matlab's odes15s.

The strange thing is that, if I use a bigger x stepsize, say 0.1, I will get a smooth result. With s step size 0.06, I will get the result showed in the picture. I tried ode45, which is based on an explicit Runge-Kutta (4,5) formula, the Dormand-Prince pair and ode23tb, which is an implementation of TR-BDF2. I got the same result.

\begin{aligned} \dot{q} & = -\frac{\partial (6*q^2/5*h)}{\partial x}-\frac{3*q}{h^2}+h*h'''-(1+10*cos(pi*t))*h*h'\\ \end{aligned}

\begin{aligned} \dot{h} & = -\frac{\partial q}{\partial x} \end{aligned}

\begin{aligned} h(t,0) = h(t,10),q(t,0) = q(t,10) \end{aligned}

$h(0,x)$, $q(0,x)$ are known.

$\endgroup$
13
  • $\begingroup$ This question could do with some improving. At present I don't know it fits in with MO's guidelines (but I'm happy to be corrected). $\endgroup$
    – David Roberts
    Commented Jul 26, 2012 at 1:58
  • 1
    $\begingroup$ To clarify: are you asking about the theoretical reason why you get this result, or are you asking for help to use Matlab? The former question is on-topic, the latter is not, and a specialised Matlab forum might be better placed to help you. $\endgroup$
    – David Roberts
    Commented Jul 26, 2012 at 5:55
  • $\begingroup$ I am asking about the theoretical reason. The ODE have up to third degree differential operators in it and it is nonlinear. $\endgroup$
    – gstar2002
    Commented Jul 26, 2012 at 10:57
  • 2
    $\begingroup$ MO isn't a place to diagnose software problems but you could make this into a suitable question but you'll have to supply more details. Could you tell us (1) exactly which differential equation are you studying and what are your boundary conditions? (2) Do you know precisely which method your software is using? `finite difference method' is very vague, to me at least. $\endgroup$ Commented Jul 27, 2012 at 16:20
  • $\begingroup$ @Ryan, I edit my question. I hope that will turn it to a suitable question here. thanks $\endgroup$
    – gstar2002
    Commented Aug 1, 2012 at 0:18

0

You must log in to answer this question.