Is there a way to convert the exact 2nd order ODE solution into the solution for the system of 1st order ODEs?

169 Views Asked by At

How is $\ y'' + 2y' +2y = e^{-x} \cdot \sin(x)$, $y(0)=0$, $y'(0)=0$ converted into a system of 1st order ODEs?

I worked the following: $$\ y{_1}=y,\; y_1'=y'=y_2,\; y_2=y',\; y_2'=y'' $$ such that I have: $$\ y_1'=y_2,\; y_2'=e^{-x} \cdot \sin(x)-2y_2-2y_1$$. Separately, I have the exact solution of the original 2nd order ODE to be: $$\ y(x) = \frac{1}{2}e^{-x}(\sin(x)-x\cos(x)) $$

However, I don't know how to express that in terms of the solutions for $\ y_1 $ and $\ y_2 $ which I need to then test some numerical approximations (e.g.: Euler, RK4, Midpt) for some pre-written MATLAB code. Is there a quick way for me to use the exact solution I already have to get $\ y_1 $ and $\ y_2 $ or do I need to solve the 1st order ODE system on its own? If so, how?

1

There are 1 best solutions below

0
On BEST ANSWER

You wrote that in the first line of definitions of $y_1,y_2$, relative to a solution $y$ of the second order equation, the first order components are $$ y_1=y,\, y_2=y' $$ so that the only thing you have to do is to compute the derivative of the exact solution. See also the comment of Moo.