Earlier we saw how to perform [b]systemification,[/b] the process of converting a single second order differential equation into a system of first order differential equations. [br][br]In this lesson we will revisit this process, and see how to bring [b]Euler's Method[/b] for estimating solutions of differential equations into the fold. [br][br]By the end of this lesson you should understand how to systemify a second order equation, how to apply Euler's Method to the system, and then how to translate that back to an estimate of a solution of your second order differential equation.
The goal of [b]systemification[/b] is to convert a second order differential equation such as[br][br][math]y''-3y'-4y=2\sin\left(t\right)[/math][br][br]into a system of first order differential equations about two different functions.[br][br]Let's take a step back, and review some basics of the concept of systemification. The above second order equation is asking us to find a function [math]y(t)[/math] which satisfies the second order differential equation. The goal of systemification is to translate this task into the related task of finding two equations, [math]x_1(t)[/math] and [math]x_2(t)[/math], which are related to each other by only first derivatives. The reason for doing this is because first derivatives are easier to manage, visualize and numerically engage with than second derivatives. Furthermore, although you may not feel this way now, it's not considerably harder to study two functions at once than one. [br][br]Process-wise, the process of systemification is actually quite prosaic, and always goes the same way. [br][br][list=1][*]Introduce two new variables [math]x_1(t)=y(t)[/math] and [math]x_2(t)=y'(t)[/math][br][/*][*]Differentiate these variables to obtain [math]x_1'(t)=y'(t)[/math] and [math]x_2'(t)=y''(t)[/math][/*][*]Substitute [math]x_2(t)[/math] for [math]y'(t)[/math] in the first equation from step 2 to obtain [math]x_1'(t)=x_2(t)[/math][/*][*]Use Algebra 1 level manipulations to solve the original second order differential equation for [math]y''(t)[/math] [/*][*]Substitute the right side of the equation from step 4 for [math]y''(t)[/math] in the second equation from step 2.[/*][*]In the new second equation (from step 5) substitute [math]x_1(t)[/math] for [math]y(t)[/math] and [math]x_2(t)[/math] for [math]y'(t)[/math].[/*][*](optional) Drop the "[math](t)[/math]"s on [math]x_1[/math] and [math]x_2[/math] and their derivatives (you also can do this from the outset in step 1 if you prefer)[/*][*]Write down your second order system as[/*][/list][br][math]x_1'=x_2[/math][br][math]x_2'=some-function-of-x_1-and-x_2-and-t[/math][br][br]Note that the first equation is always [math]x_1'=x_2[/math]. It's only the second equation of the system where there's any variability. Also note, that in the equation for [math]x_2'[/math], it's customary to list the terms on the right hand side in the following order: first [math]x_1[/math] stuff, then [math]x_2[/math] stuff, and finally [math]t[/math] stuff.[br]
[br]After systemification of a second order differential equation is complete, it is now ready for visualization as a slope field in GeoGebra. Note that these steps are specific to GeoGebra and the [code]slopefield( ) [/code]command.[br][br][list=1][*]On the right hand side of both equations of the system: replace [code]x_1[/code] with [code]x[/code], and replace [code]x_2[/code] with [code]y[/code], and replace [code]t[/code] with [code]T[/code][/*][*]Plot [code]slopefield((x_2')/(x_1'))[/code] but instead of actually typing [code]x_2'[/code] and [code]x_1'[/code] instead put the right hand side of these equations with the substitutions for [code]x[/code], [code]y[/code] and [code]T[/code] as described in the previous step. Say yes to create a slider for [code]T[/code].[/*][/list]
Let's practice systemification on the second order non-homogeneous constant coefficient differential equation[br][br][math]y''-3y'-4y=2\sin\left(t\right)[/math][br][list=1][*][math]x_1(t)=y(t)[/math] and [math]x_2(t)=y'(t)[/math][/*][*][math]x_1'(t)=y'(t)[/math] and [math]x_2'(t)=y''(t)[/math][/*][*][math]x_1'(t)=x_2(t)[/math][/*][*][math]y''=3y'+4y+2\sin(t)[/math][/*][*][math]x_2'(t)=3y'+4y+2\sin(t)[/math][/*][*][math]x_2'(t)=3x_2(t)+4x_1(t)+2\sin(t)[/math][/*][*][math]x_1'=x_2[/math] and [math]x_2'=3x_2+4x_1[/math][/*][*]The final system is:[/*][/list][math]x_1'=x_2[/math][br][math]x_2'=4x_1+3x_2+2\sin(t)[/math][br][br]Now to prepare this for a slope field in GeoGebra[br][br][code]x_1'=y[br][br][/code][br][code]x_2'=4*x+3*y+2*sin(T)[br][/code][br][br]These are then passed to [code]slopefield( )[/code] as[br][br][code]slopefield((4*x+3*y+2*sin(T))/(y))[/code][br][br]which results in
In [url=https://www.geogebra.org/m/cxgtwkqa#material/wdud24g8]an earlier lesson[/url] we learned about Euler's Method, a technique to estimate solutions of [i]single[/i] first order differential equations. Only a small adjustment to Euler's Method is needed to estimate solutions of [i]systems[/i] of first order differential equations such as the systems that obtained from systemification.[br][br]Here's how to implement Euler's Method on a system of first order differential equations[br][br][math]x_1'=f_1(x_1,x_2,t)[/math][br][math]x_2'=f_2(x_1,x_2,t)[/math][br][br]with initial conditions [math]x_1\left(t_0\right)=x_{1_0}[/math] and [math]x_2\left(t_0\right)=x_{2_0}[/math].[br][br][list=1][*]Put the system of first order equations in [b]slope field form [/b](also sometimes called [b]normal form[/b])[b] [/b]and identify [math]f_1[/math] and [math]f_2[/math]. What this means in practice is that the equations are as written above with [math]x_i'[/math] on the left, and everything else involving [math]x_1[/math], [math]x_2[/math] and [math]t[/math] on the right. [/*][*]Select a [b]step count[/b], [math]n[/math]. This is how many steps of an estimated solution you need.[/*][*]Select a [b]step size[/b] [math]h[/math] (sometimes also called [math]dt[/math] or [math]\Delta t[/math])[/*][*]The [b]first estimate point[/b] is the [math](x_1_{_0},x_{2_0})[/math], the initial conditions on [math]x_1[/math] and [math]x_2.[/math] The [b]first time point [/b]is [math]t_0[/math], the initial time (it's often the case that [math]t_0=0[/math]).[/*][*]Apply the [b]Euler Method formulas[/b] to calculate [b]the next estimate point [/b]and[b] the next time point [/b](see below for the formulas)[/*][*][b]Continue [/b]for [math]n[/math] steps.[/*][/list][br]The Euler Method formulas for step 5 are[br][br][math]t_{n+1}=t_n+h[/math][br][math]x_{1_{n+1}}=x_{1_n}+f_1\left(x_{1_n},x_{2_n},t_n\right)\cdot h[/math][br][math]x_{2_{n+1}}=x_{2_n}+f_2\left(x_{1_n},x_{2_n},t_n\right)\cdot h[/math][br]
Let's apply Euler's Method to estimate solutions of to the systemification [br][br][math]x_1'=x_2[/math][br][math]x_2'=4x_1+3x_2+2\sin(t)[/math][br][br]of the second order differential equation[br][br][math]y''-3y'-4y=2\sin\left(t\right);y\left(0\right)=2;y'\left(0\right)=3[/math][br][br]We'll use [math]h=0.1[/math] for [math]n=2[/math] steps.[br][br][list=1][*]The system is already in slope field form; [math]f_1(x_1,x_2,t)=x_2[/math] and [math]f_2(x_1,x_2,t)=4x_1+3x_2+2\sin(t)[/math][br][/*][*][math]n=2[/math][br][/*][*][math]h=0.1[/math][br][/*][*]First estimate point: [math]\left(x_{1_0},x_{2_0}\right)=\left(y\left(0\right),y'\left(0\right)\right)=(2,3)[/math]. First time point: [math]t_0=0[/math][/*][*]Next time point: [math]t_1=t_0+h=0.1[/math]. Next [math]x_1[/math] point: [math]x_{1_1}=x_{1_0}+f_1\left(x_{1_0},x_{2_0},t_0\right)\cdot h=2+\left(3\right)\cdot0.1=2.3[/math]. Next [math]x_2[/math] point: [math]x_{2_1}=x_{2_0}+f_2\left(x_{1_0},x_{2_0},t_0\right)\cdot h=3+\left(4\cdot2+3\cdot3+2\cdot\sin\left(0\right)\right)\cdot0.1=4.7[/math]. Therefore next estimate point is [i][math]\left(x_{1_1},x_{2_1}\right)=(2.3,4.7)[/math][/i].[/*][*]We only need to do one more step. Next time point: [math]t_2=t_1+h=0.2[/math]. Next [math]x_1[/math] point: [math]x_{1_2}=x_{1_1}+f_1\left(x_{1_1},x_{2_1},t_1\right)\cdot h=2.3+\left(4.7\right)\cdot0.1=2.77[/math]. Next [math]x_2[/math] point: [math]x_{2_2}=x_{2_1}+f_2\left(x_{1_1},x_{2_1},t_1\right)\cdot h=4.7+\left(4\cdot2.3+3\cdot4.7+2\cdot\sin\left(0.1\right)\right)\cdot0.1\approx7.049967[/math]. Therefore the next estimate point is [math]\left(x_{1_1},x_{2_2}\right)\approx\left(2.77,7.049967\right)[/math].[/*][/list]Note that we can extract from this information an estimate of the solution function [math]y(t)[/math] of the original second order differential equation at [math]t=0.1[/math] and [math]t=0.2[/math]. In particular:[math]y(0.1)\approx x_{1_1}=2.3[/math] and [math]y(0.2)\approx x_{1_2}=2.77[/math][br][br]Compare this to algebraic solution of the second order differential equation with initial conditions (tip: check this is a solution of the second order differential equation in GeoGebra on your own!)[br][br][math]y(t)=\frac{4}{5}e^{\left(-1t\right)}+\frac{87}{85}e^{\left(4t\right)}-\frac{5}{17}\sin\left(t\right)+\frac{3}{17}\cos\left(t\right)[/math][br][br]which is actually about 2.397 at [math]t=0.1[/math] and 3.047 at [math]t=0.2[/math].[br][br]Let's close the loop here by looking at this all in GeoGebra. In the below applet, we've plotted the slope field of the systemification using the same code as before:[br][br][code]slopefield((4*x+3*y+2*sin(T))/(y))[/code][br][br]We've also entered the algebraic solution by entering, and hiding [br][br][code]f(t)=4/5*e^(-1*t)+87/85*e^(4*t)-5/17*sin(t)+3/17*cos(t)[/code][br][br]Note that we are calling the function [code]f[/code] instead of [code]y[/code] because GeoGebra won't let us name functions [code]y[/code].[br][br]We've also plotted the algebraic solution in the slope field using[br][br][code]a=curve(f(t),f'(t),t,0,10)[/code][br][br]As well as this curve evaluated at [i]t[/i]=0, [i]t[/i]=0.5 and [i]t[/i]=1 with [br][br][code]a(0)[br]a(0.1)[br]a(0.2)[br][/code][br]Lastly, we've also plotted the initial condition, and second and third estimate points from Euler's method[br][br][code]InitialCondition=(2,3)[br][br]FirstEstimatePoint=(2.3,4.7)[/code][br][br][code]SecondEstimatePoint=(2.77,7.049967)[/code]
As we can see, the numerical method is close, but seems to be systematically in error, and coming up short of the algebraic solution. This is normal case of solutions where one or both of [math]y[/math] or [math]y'[/math] becomes large fast. Soon we'll see the Runge-Kutta method which is an improvement on Euler's Method that performs considerably better in the setting of second order and higher order systemifications. [br][br]On the next page a calculator for using Euler's Method to estimate solutions of systems of first order equations is presented. Be sure to utilize it.
Consider the second order homogeneous constant coefficient differential equation with initial conditions[br][br][math]y''+4y'+3y=0;y\left(0\right)=1.5;y'\left(0\right)=-2.5[/math][br][br]Use the method of systemification to convert this to a system of first order differential equations. Apply Euler's Method to the system with [math]h=0.1[/math] to estimate [math]y(0.1)[/math], [math]y(0.2)[/math], [math]y(0.3)[/math], [math]y(0.4)[/math] and [math]y(0.5)[/math].