Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 1 year ago

achrzesz gravatar image

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()
click to hide/show revision 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)
click to hide/show revision 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()
click to hide/show revision 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 =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()
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()
click to hide/show revision 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=y21 $$ 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()
click to hide/show revision 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

  • y1+y2+1=0
  • y2+y1=0

Introduce additional functions:

y3=y1

y4=y2

System of 1-order

  • y3=y1
  • y4=y2

We obtain a system of first order ODEs:

y1=y3

y2=y4

y3=y21

y4=y1

  • y1=y3
  • y2=y4
  • y3=y21
  • 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:y1:

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

Plot y2:y2:

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