How to input this type of Nonlinear ODE into Runge-Kutta

839 Views Asked by At

Say I have a differential equation, such as $$y'(t)+y'(t)^3 -t^5+350=0$$ with some initial condition. How can we take this nonlinear ODE and plug it into a system that runge-kutta can deal with? I only really have seen ways to do it when the ODE is of the form $y'(t)=F(y,t)$?

Another example would be something like $$y''(t)(1+y''(t)^3) -y'(t)+\cos(y(t))=0$$ which I would be confused with as well, considering I'm used to breaking down the system into $\textbf{y}'(t)=A\textbf{y(t)}$, where we have the standard breakdown $y=(t,y_1(t), y_2(t))$, where $y_1'(t)=y_2(t)$, $y_2'(t)=f(t,y_1,y_2)$, etc.,

Any suggestions or ideas? I know Mathematica can do it, and we can force mathematica to use Classical RK-4 to solve it, which is the origin of this question.

1

There are 1 best solutions below

2
On BEST ANSWER

One easy way is to take the derivative of the equation (let's stay with the first example), $$ y''(1+3y'^2)-5t^4=0\iff y''=\frac{5t^4}{1+3y'^2} $$ which can be solved by the standard method of transforming into a first-order system and applying a Runge-Kutta method. The only detail open is the initial value for $y'$ which has to be chosen as (one of) the root(s) of the cubic polynomial $v+v^3-t_0^5+350$.

You get the typical problems of applying ODE methods to DAE, that is, the solution of the derived equation will have an increasing error in the original equation, the polynomial or non-linear equation for the initial value can have multiple solutions or no solution at all. Naive projection to the manifold defined by the original equation to remove the first problem can reduce the order of the numerical method.