- #1
brokenlynx
- 4
- 0
I'm just trying to understand how exactly derivatives are to be specified in C++ for use in the 4th order Runge-Kutta method.
I am implementing the method in C++ (though this part of my program isn't complete yet) however what I am looking to do is first specify the derivatives of the variables in the two first-order differential equations I am working with:
θ' = ω
ω' = − g⁄R sin θ
(for modelling the motion of a single pendulum)
double theta - initial angular displacement (Radians)
double R - length of Pendulum Rod (Metres)
double g - gravitational constant (Distance/Time^2)
I just need a little help understanding how to specify the derivatives and basically what I'm doing when I am. (I'm familiar with calculus just not numerical solving algorithms).
Thanx.
I am implementing the method in C++ (though this part of my program isn't complete yet) however what I am looking to do is first specify the derivatives of the variables in the two first-order differential equations I am working with:
θ' = ω
ω' = − g⁄R sin θ
(for modelling the motion of a single pendulum)
double theta - initial angular displacement (Radians)
double R - length of Pendulum Rod (Metres)
double g - gravitational constant (Distance/Time^2)
I just need a little help understanding how to specify the derivatives and basically what I'm doing when I am. (I'm familiar with calculus just not numerical solving algorithms).
Thanx.