Skip to content

The main goal was to make a Runge-Kutta 4 implementation in C++ in order to solve it's equations of motion without the small angle approximation.

Notifications You must be signed in to change notification settings

Artabovereason/RK4-Double-pendulum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

It is a rigid pendulum at the end of which another rigid pendulum is attached. The two inextensible rods of lengths and have zero mass. The 2 masses at the ends are of masses and , which will be considered as punctual. The double pendulum is therefore fixed in O and articulated freely in . The movement takes place in a plane of horizontal and vertical coordinates. We will consider that the two stems can “cross” without problem. The angle that the pendulum 1 makes with the vertical is denoted and the angle that the pendulum 2 makes with the vertical is denoted . These angles are noted positively counterclockwise.

By setting , we obtain the following system:

In numerical analysis, the Runge–Kutta methods are a family of implicit and explicit iterative methods, which include the well-known routine called the Euler Method, used in temporal discretization for the approximate solutions of ordinary differential equations.

The most widely known member of the Runge–Kutta family is generally referred to as "RK4", the "classic Runge–Kutta method" or simply as "the Runge–Kutta method".

We're using this method here.

Use g++ main.cpp class.cpp -o main && ./main to run.

The output gif is :

About

The main goal was to make a Runge-Kutta 4 implementation in C++ in order to solve it's equations of motion without the small angle approximation.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages