$\displaystyle
d2y/dx2 + dy/dx = y + 5x$
In runge kutta method i can only solve differential equations of degree 1 am i correct ? So how can i solve the above equation which is of degree 2 using runge kutta ?
$\displaystyle
d2y/dx2 + dy/dx = y + 5x$
In runge kutta method i can only solve differential equations of degree 1 am i correct ? So how can i solve the above equation which is of degree 2 using runge kutta ?
For higher-order equation, just use the standard reduction of order down to a first-order system routine. That is, let $\displaystyle y_{1}=y$ and $\displaystyle y_{2}=y'.$ You obtain, then, a first-order system in two variables. Then you can apply Runge-Kutta 4. Make sense?
If you're going to solve numerically, you definitely need initial or boundary conditions in order to solve. You need as many conditions as the degree of the equation. In your case, you need two conditions. If you have initial conditions (much easier to work with than boundary conditions!), then you'd have the value of the function y and its derivative at one particular x value. The corresponding initial conditions in vector format would be the value of the vector [y1 y2] at a particular x value.
Make sense?
You will definitely need to give MATLAB an initial condition in order to integrate the DE to find the value of y at some x not equal to the initial x. As far as I know, you simply cannot integrate an ODE numerically without a complete set of initial conditions or boundary conditions.