1 | initial version |
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
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()
2 | No.2 Revision |
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
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)
3 | No.3 Revision |
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
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 |
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 =0Additional functions:
$$
y3=y1' $$ $$ y4=y2'System of 1-order ODEs:
$$
y1'=y3 $$ $$ y2'=y4 $$ $$ y3'=-y2-1 $$ $$ y4'=-y1Sage 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 |
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 |
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
Introduce additional
functions:$$ y3=y1' $$
$$ y4=y2' $$
System of 1-order
We obtain a system of first order
ODEs:$$ y1'=y3 $$
$$ y2'=y4 $$
$$ 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:$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()