Help with using the Runge-Kutta 4th order method on a system of three first order ODE's.

805 Views Asked by At

The original ODE I had was $4f‴ + ff″ + 2(f′)² = 0$ with $f(0)=0, f′(0)=0$ & $f′(∞)=0$

I wish to use the 4th order Runge-Kutta method, so I have the system of three 1st order equation as below:

$$u′=v $$ $$v′=w $$ $$w′= - ¼uw -½v² $$

where $u=f, v=f′=df/dη, w=f″ $

and now the initial values are $u=0$ & $v=0$.

My problem is I am struggling to apply this method to my system of ODE's so that I can program a method that can solve any system of three first order ODE's. I would like for someone to please run through the step of the method, so I can understand it better. Optional: It would be very nice if anyone write down the MATLAB code for me.

1

There are 1 best solutions below

0
On

Matlab has good differential equations solvers for initial-value problems, such as ode45. No need for implementing Runge-Kutta yourself, although it's simple enough to do. The trouble is going to be with your "boundary value" $f'(\infty) = 0$. In general a condition such as that is going to be very hard to check numerically (you aren't really going to integrate out to $t=\infty$), and might be true for all solutions starting in a certain region or for no solutions at all.

In this case, it's rather blatantly obvious that $f = 0$ is a solution; I haven't checked if there are others.

EDIT: From some numerical experiments (I used Maple rather than Matlab), it appears that the solution with $f(0)=0$, $f'(0)=0$, $f''(0) = c$ will satisfy your condition $f'(\infty) = 0$ (in fact will rather rapidly approach a constant) if $c \ge 0$, but if $c < 0$ the solution will go to $-\infty$ in finite time. For example, here's the plot for $c = 0.01$

enter image description here

and here is $c = -0.01$

enter image description here