Question: Write a C code which solves the system of the ordinary differential equations describing the motion of the double pendulum. The motion of the double
Write a C code which solves the system of the ordinary differential equations describing the motion of the double pendulum.
The motion of the double pendulum is defined by the following ODE's:
- x = horizontal position of pendulum mass
- y = vertical position of pendulum mass
- = angle of pendulum (0 = vertical downwards, counter-clockwise is positive)
- L = length of rod (constant)
The expressions for the positions x1, y1, x2, y2 in terms of the angles 1, 2 .
x1 = L1 sin 1
y1 = L1 cos 1
x2 = x1 + L2 sin 2
y2 = y1 L2 cos 2
The velocity is the derivative with respect to time of the position.
x1' = 1' L1 cos 1
y1' = 1' L1 sin 1
x2' = x1' + 2' L2 cos 2
y2' = y1' + 2' L2 sin 2
The acceleration is the second derivative.
| x1'' = 1'2 L1 sin 1 + 1'' L1 cos 1 |
| y1'' = 1'2 L1 cos 1 + 1'' L1 sin 1 |
| x2'' = x1'' 2'2 L2 sin 2 + 2'' L2 cos 2 |
| y2'' = y1'' + 2'2 L2 cos 2 + 2'' L2 sin 2 |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
