Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

Commit

Permalink
First commit. Added description and constants to pendulum.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
WittleWolfie committed May 12, 2011
0 parents commit 7e35f08
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pendulum.py
@@ -0,0 +1,19 @@
"""
Represents an inverted pendulum, keeping track of angle, angular velocity and angular acceleration.
angular acceleration = (g*sin(x) - a*m*l*(v^2)*sin(2*x)/2 - a*cos(x)*u)/(4*l/3 - a*m*l*cos^2(x))
x = angle
v = angular velocity
g = acceleration due to gravity
m = mass of the pendulum
M = mass of the cart
l = length of the pendulum
a = 1/(m+M)
"""

# Constants
g = 9.8
m = 2.0
M = 8.0
l = 0.5
a = 1.0/(m+M)

0 comments on commit 7e35f08

Please sign in to comment.