Any second-order or higher-order differential equation can be converted into a system of first-order (linear) equations. For example,
Let's define two new functions for the equation, and :
With this transformation, instead of one 2 order equation, two 1 order equations are formed:
All we need to do to solve higher-order equations, even a system of higher-order initial-value problems, is to reduce them to a system of first-order equations.
Such as: One M-order equation
a system with M first-order equations.
Let's take the most general system of differential equations with M unknowns:
(5.2)
The next step for solving is to apply the methods (such as; Euler, Runge-Kutta) for the 1t order differential equation to these linear system.
We had a set of equations. Two second degree and two first degree differential equations with two unknowns.
To solve these two 2 degree equations (plus two 1 degree equations) given above, we first convert them to a system of 4 1 degree (linear) equations.
To this end, let's define the four unknowns as follows:
Accordingly, the above 2 degree system is written as:
When in this system of equations, we obtain our usual parabolic curve
.
To calculate the effect of air friction, let's take the initial conditions () and constants ( & ):
Figure 5.3:
Numerical solution of projectile motion with and without air friction. (Example py-file: airfriction.py)
We had a set of equations. Two second degree and two first degree differential equations with two unknowns.
To solve these two 2 degree equations (plus two 1 degree equations) given above, we first convert them to a system of 4 1 degree (linear) equations.
To this end, let's define the four unknowns as follows:
Accordingly, the above 2 degree system is written as:
(5.3)
For the motion of the planets, we use the astronomical unit system. The Earth-Sun average distance would be in units of astronomical length:
. The time taken for the Earth to go around the Sun once is 1 year (y) as the unit of time.
Calculated in these units, the product of ,
To calculate the planetary motion, let's take the initial conditions at time t=0 in terms of four unknowns:
Then, also take
.
Figure 5.4:
Numerical solution of planetary motion. There can be closed orbits (ellipse), or solutions going to infinity (unbounded, hyperbola) for different velocities. (Example py-file: planetarymotion.py)