# Revision history [back]

Systems of 2-order ODEs can be reduced to systems of 1-order ODEs.

System of 2-order ODEs:

y1''+y2+1=0
y2''+y1 =0


y3=y1'
y4=y2'


System of 1-order ODEs:

y1'=y3
y2'=y4
y3'=-y2-1
y4'=-y1


Sage numerical solution:

T=ode_solver()
f = lambda t,y:[y[2],y[3],-y[1]-1,-y[0]]
T.function=f
T.ode_solve(y_0=[1,1,0,0],t_span=[0,20],num_points=1000)


Plot y1:

f = T.interpolate_solution()
plot(f,0,5).show()


Plot y2:

f = T.interpolate_solution(i=1)
plot(f,0,5).show()


Systems of 2-order ODEs can be reduced to systems of 1-order ODEs.

System of 2-order ODEs:

y1''+y2+1=0
y2''+y1 =0


y3=y1'
y4=y2'


System of 1-order ODEs:

y1'=y3
y2'=y4
y3'=-y2-1
y4'=-y1


Sage numerical solution:

T=ode_solver()
f = lambda t,y:[y[2],y[3],-y[1]-1,-y[0]]
T.function=f
T.ode_solve(y_0=[1,1,0,0],t_span=[0,20],num_points=1000)


Plot y1:

f = T.interpolate_solution()
plot(f,0,5).show()


Plot y2:

f = T.interpolate_solution(i=1)
plot(f,0,5).show()
plot(f,0,5).show(i=1)


Systems of 2-order ODEs can be reduced to systems of 1-order ODEs.

System of 2-order ODEs:

y1''+y2+1=0
y2''+y1 =0


y3=y1'
y4=y2'


System of 1-order ODEs:

y1'=y3
y2'=y4
y3'=-y2-1
y4'=-y1


Sage numerical solution:

T=ode_solver()
f = lambda t,y:[y[2],y[3],-y[1]-1,-y[0]]
T.function=f
T.ode_solve(y_0=[1,1,0,0],t_span=[0,20],num_points=1000)


Plot y1:

f = T.interpolate_solution()
plot(f,0,5).show()


Plot y2:

f = T.interpolate_solution(i=1)
plot(f,0,5).show(i=1)
plot(f,0,5).show()

 4 No.4 Revision slelievre 17654 ●22 ●160 ●348 http://carva.org/samue...

Systems of 2-order ODEs can be reduced to systems of 1-order ODEs.

System of 2-order ODEs:

$$y1''+y2+1=0$$
$$y2''+y1 =0 $$

$$y3=y1'$$
$$y4=y2' $$

System of 1-order ODEs:

$$y1'=y3$$
$$y2'=y4$$
$$y3'=-y2-1$$
$$y4'=-y1 $$

Sage numerical solution:

T=ode_solver()
sage: T = ode_solver()
sage: f = lambda t,y:[y[2],y[3],-y[1]-1,-y[0]]
T.function=f
T.ode_solve(y_0=[1,1,0,0],t_span=[0,20],num_points=1000)
t, y: [y[2], y[3], -y[1] - 1, -y[0]]
sage: T.function = f
sage: T.ode_solve(y_0=[1, 1, 0, 0], t_span=[0, 20], num_points=1000)


Plot y1:

sage: f = T.interpolate_solution()
plot(f,0,5).show()
sage: plot(f, 0, 5).show()


Plot y2:

sage: f = T.interpolate_solution(i=1)
plot(f,0,5).show()
sage: plot(f, 0, 5).show()

 5 No.5 Revision slelievre 17654 ●22 ●160 ●348 http://carva.org/samue...

Systems of 2-order ODEs can be reduced to systems of 1-order ODEs.

System of 2-order ODEs:

$$y1''+y2+1=0$$

 y2''+y1 =0 $$Additional functions:$$ y3=y1'  $$y4=y2'$$

System of 1-order ODEs:

$$y1'=y3$$

$$y2'=y4$$

$$y2'=y4 y3'=-y2-1$$

 y3'=-y2-1  y4'=-y1 $$Sage numerical solution: sage: T = ode_solver() sage: f = lambda t, y: [y[2], y[3], -y[1] - 1, -y[0]] sage: T.function = f sage: T.ode_solve(y_0=[1, 1, 0, 0], t_span=[0, 20], num_points=1000)  Plot y1: sage: f = T.interpolate_solution() sage: plot(f, 0, 5).show()  Plot y2: sage: f = T.interpolate_solution(i=1) sage: plot(f, 0, 5).show()   6 No.6 Revision slelievre 17654 ●22 ●160 ●348 http://carva.org/samue... Systems of 2-order second order ODEs can be reduced to systems of 1-order first order ODEs. System of 2-order For example let us start with this system of second order ODEs:$$ y1''+y2+1=0  y2''+y1 =0 $$Additional • y_1'' + y_2 + 1 = 0 • y_2'' + y_1 = 0 Introduce additional functions:$$ y3=y1'  y4=y2' $$System of 1-order • y_3 = y_1' • y_4 = y_2' We obtain a system of first order ODEs:$$ y1'=y3  y2'=y4  y3'=-y2-1  y4'=-y1 

• $y_1' = y_3$
• $y_2' = y_4$
• $y_3' = -y_2 - 1$
• $y_4' = -y_1$

Sage numerical solution:

sage: T = ode_solver()
sage: f = lambda t, y: [y[2], y[3], -y[1] - 1, -y[0]]
sage: T.function = f
sage: T.ode_solve(y_0=[1, 1, 0, 0], t_span=[0, 20], num_points=1000)


Plot y1:$y_1$:

sage: f = T.interpolate_solution()
sage: plot(f, 0, 5).show()


Plot y2:$y_2$:

sage: f = T.interpolate_solution(i=1)
sage: plot(f, 0, 5).show()