You are on page 1of 46

Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

Derivation of Equations of Motion for


Inverted Pendulum Problem
Filip Jeremic
McMaster University
November 28, 2012
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Kinetic Energy
Denition
The energy which an object possesses due to its motion
It is dened as the work needed to accelerate a body of a
given mass from rest to its stated velocity
In classical mechanics, the kinetic energy E
k
of a point object
is dened by its mass m and velocity v:
E
k
=
1
2
mv
2
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Kinetic Energy
Denition
The energy which an object possesses due to its motion
It is dened as the work needed to accelerate a body of a
given mass from rest to its stated velocity
In classical mechanics, the kinetic energy E
k
of a point object
is dened by its mass m and velocity v:
E
k
=
1
2
mv
2
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Kinetic Energy
Denition
The energy which an object possesses due to its motion
It is dened as the work needed to accelerate a body of a
given mass from rest to its stated velocity
In classical mechanics, the kinetic energy E
k
of a point object
is dened by its mass m and velocity v:
E
k
=
1
2
mv
2
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Potential Energy
Denition
The energy of an object or a system due to the position of the
body or the arrangement of the particles of the system
The amount of gravitational potential energy possessed by an
elevated object is equal to the work done against gravity in
lifting it
Thus, for an object at height h, the gravitational potential
energy E
p
is dened by its mass m, and the gravitational
constant g:
E
p
= mgh
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Potential Energy
Denition
The energy of an object or a system due to the position of the
body or the arrangement of the particles of the system
The amount of gravitational potential energy possessed by an
elevated object is equal to the work done against gravity in
lifting it
Thus, for an object at height h, the gravitational potential
energy E
p
is dened by its mass m, and the gravitational
constant g:
E
p
= mgh
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Potential Energy
Denition
The energy of an object or a system due to the position of the
body or the arrangement of the particles of the system
The amount of gravitational potential energy possessed by an
elevated object is equal to the work done against gravity in
lifting it
Thus, for an object at height h, the gravitational potential
energy E
p
is dened by its mass m, and the gravitational
constant g:
E
p
= mgh
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Lagrangian Mechanics
An analytical approach to the derivation of E.O.M. of a
mechanical system
Lagranges equations employ a single scalar function, rather
than vector components
To derive the equations modeling an inverted pendulum all we
need to know is how to take partial derivatives
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Lagrangian Mechanics
An analytical approach to the derivation of E.O.M. of a
mechanical system
Lagranges equations employ a single scalar function, rather
than vector components
To derive the equations modeling an inverted pendulum all we
need to know is how to take partial derivatives
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Lagrangian Mechanics
An analytical approach to the derivation of E.O.M. of a
mechanical system
Lagranges equations employ a single scalar function, rather
than vector components
To derive the equations modeling an inverted pendulum all we
need to know is how to take partial derivatives
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Lagrangian
Denition
In classical mechanics, the natural form of the Lagrangian is
dened as L = E
k
E
p
E.O.M. can be directly derived by substitution using
EulerLagrange equation:
d
dt

=
L

Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Lagrangian
Denition
In classical mechanics, the natural form of the Lagrangian is
dened as L = E
k
E
p
E.O.M. can be directly derived by substitution using
EulerLagrange equation:
d
dt

=
L

Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Inverted Pendulum Problem
The pendulum is a sti bar of length L which is supported at
one end by a frictionless pin
The pin is given an oscillating vertical motion s dened by:
s(t) = Asin t
Problem
Our problem is to derive the E.O.M. which relates time with the
acceleration of the angle from the vertical position
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Inverted Pendulum Problem
The pendulum is a sti bar of length L which is supported at
one end by a frictionless pin
The pin is given an oscillating vertical motion s dened by:
s(t) = Asin t
Problem
Our problem is to derive the E.O.M. which relates time with the
acceleration of the angle from the vertical position
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Visualization
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Visualization
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Visualization
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Visualization
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Setup
From the gure on previous page we know
x = L sin x = L cos ()

y = L cos y = L sin ()

Recall the denition of the Lagrangian


L = E
k
E
p
L =
1
2
mv
2
mgy
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Setup
From the gure on previous page we know
x = L sin x = L cos ()

y = L cos y = L sin ()

Recall the denition of the Lagrangian


L = E
k
E
p
L =
1
2
mv
2
mgy
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Setup Continued...
Velocity is a vector representing the change in position, hence
v
2
= x
2
+ y
2
= L
2

2
cos
2
+ L
2

2
sin
2

= L
2

2
(cos
2
+ sin
2
)
= L
2

2
Substituting into the equation for the Lagrangian we get
L =
1
2
mv
2
mgy
L =
1
2
mL
2

2
mgL cos
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Setup Continued...
Velocity is a vector representing the change in position, hence
v
2
= x
2
+ y
2
= L
2

2
cos
2
+ L
2

2
sin
2

= L
2

2
(cos
2
+ sin
2
)
= L
2

2
Substituting into the equation for the Lagrangian we get
L =
1
2
mv
2
mgy
L =
1
2
mL
2

2
mgL cos
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Setup Continued...
Velocity is a vector representing the change in position, hence
v
2
= x
2
+ y
2
= L
2

2
cos
2
+ L
2

2
sin
2

= L
2

2
(cos
2
+ sin
2
)
= L
2

2
Substituting into the equation for the Lagrangian we get
L =
1
2
mv
2
mgy
L =
1
2
mL
2

2
mgL cos
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Setup Continued...
Recall the Euler-Lagrange equation
d
dt

=
L

We shall now compute both sides of the equation and solve for

Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Computing
L

L =
1
2
mL
2

2
mgL cos
L

= 0 + mgL sin
= mgL sin
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Computing
L

L =
1
2
mL
2

2
mgL cos
L

= 0 + mgL sin
= mgL sin
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Computing
d
dt

L =
1
2
mL
2

2
mgL cos
We compute in two steps:
L

= mL
2

0
= mL
2

d
dt

= mL
2

Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Computing
d
dt

L =
1
2
mL
2

2
mgL cos
We compute in two steps:
L

= mL
2

0
= mL
2

d
dt

= mL
2

Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Computing
d
dt

L =
1
2
mL
2

2
mgL cos
We compute in two steps:
L

= mL
2

0
= mL
2

d
dt

= mL
2

Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Applying Euler-Lagrange Equation
Now that we have both sides of the Euler-Lagrange Equation we
can solve for

d
dt

=
L

mL
2

= mgL sin

=
g
L
sin
Which is the equation presented in the assignment.
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Applying Euler-Lagrange Equation
Now that we have both sides of the Euler-Lagrange Equation we
can solve for

d
dt

=
L

mL
2

= mgL sin

=
g
L
sin
Which is the equation presented in the assignment.
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Setup
With the oscillator we must modify the equation for y
x = L sin x = L cos ()

y = L cos + Asin t y = L sin ()

+ A cos t
Again, we use the denition of the Lagrangian
L = E
k
E
p
L =
1
2
mv
2
mgy
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Setup
With the oscillator we must modify the equation for y
x = L sin x = L cos ()

y = L cos + Asin t y = L sin ()

+ A cos t
Again, we use the denition of the Lagrangian
L = E
k
E
p
L =
1
2
mv
2
mgy
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Setup Continued...
Velocity is a vector representing the change in position, hence
v
2
= x
2
+ y
2
= L
2

2
cos
2
+ L
2

2
sin
2
2AL sin cos (t)

+ A
2

2
cos
2
(t)
= L
2

2
(cos
2
+ sin
2
) 2AL sin cos (t)

+ A
2

2
cos
2
(t)
= L
2

2
2AL sin cos (t)

+ A
2

2
cos
2
(t)
Substituting into the equation for the Lagrangian we get
L =
1
2
mv
2
mgy
L =
1
2
mL
2

2
mAL sin cos (t)

+
1
2
mA
2

2
cos
2
(t) mgL cos mgAsin (t)
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Setup Continued...
Velocity is a vector representing the change in position, hence
v
2
= x
2
+ y
2
= L
2

2
cos
2
+ L
2

2
sin
2
2AL sin cos (t)

+ A
2

2
cos
2
(t)
= L
2

2
(cos
2
+ sin
2
) 2AL sin cos (t)

+ A
2

2
cos
2
(t)
= L
2

2
2AL sin cos (t)

+ A
2

2
cos
2
(t)
Substituting into the equation for the Lagrangian we get
L =
1
2
mv
2
mgy
L =
1
2
mL
2

2
mAL sin cos (t)

+
1
2
mA
2

2
cos
2
(t) mgL cos mgAsin (t)
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Setup Continued...
Velocity is a vector representing the change in position, hence
v
2
= x
2
+ y
2
= L
2

2
cos
2
+ L
2

2
sin
2
2AL sin cos (t)

+ A
2

2
cos
2
(t)
= L
2

2
(cos
2
+ sin
2
) 2AL sin cos (t)

+ A
2

2
cos
2
(t)
= L
2

2
2AL sin cos (t)

+ A
2

2
cos
2
(t)
Substituting into the equation for the Lagrangian we get
L =
1
2
mv
2
mgy
L =
1
2
mL
2

2
mAL sin cos (t)

+
1
2
mA
2

2
cos
2
(t) mgL cos mgAsin (t)
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Setup Continued...
Velocity is a vector representing the change in position, hence
v
2
= x
2
+ y
2
= L
2

2
cos
2
+ L
2

2
sin
2
2AL sin cos (t)

+ A
2

2
cos
2
(t)
= L
2

2
(cos
2
+ sin
2
) 2AL sin cos (t)

+ A
2

2
cos
2
(t)
= L
2

2
2AL sin cos (t)

+ A
2

2
cos
2
(t)
Substituting into the equation for the Lagrangian we get
L =
1
2
mv
2
mgy
L =
1
2
mL
2

2
mAL sin cos (t)

+
1
2
mA
2

2
cos
2
(t) mgL cos mgAsin (t)
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Computing
L

L =
1
2
mL
2

2
mAL sin cos (t)

+
1
2
mA
2

2
cos
2
(t) mgL cos mgAsin (t)
L

= 0 mAL cos cos (t)

+ 0 + mgL sin 0
= mAL cos cos (t)

+ mgL sin
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Computing
L

L =
1
2
mL
2

2
mAL sin cos (t)

+
1
2
mA
2

2
cos
2
(t) mgL cos mgAsin (t)
L

= 0 mAL cos cos (t)

+ 0 + mgL sin 0
= mAL cos cos (t)

+ mgL sin
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Computing
d
dt

L =
1
2
mL
2

2
mAL sin cos (t)

+
1
2
mA
2

2
cos
2
(t) mgL cos mgAsin (t)
We compute in two steps:
L

= mL
2

mAL sin cos (t) + 0 0 0
= mL
2

mAL sin cos (t)
d
dt

= mL
2

mAL cos cos (t)

+ mAL
2
sin sin (t)
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Computing
d
dt

L =
1
2
mL
2

2
mAL sin cos (t)

+
1
2
mA
2

2
cos
2
(t) mgL cos mgAsin (t)
We compute in two steps:
L

= mL
2

mAL sin cos (t) + 0 0 0
= mL
2

mAL sin cos (t)
d
dt

= mL
2

mAL cos cos (t)

+ mAL
2
sin sin (t)
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Computing
d
dt

L =
1
2
mL
2

2
mAL sin cos (t)

+
1
2
mA
2

2
cos
2
(t) mgL cos mgAsin (t)
We compute in two steps:
L

= mL
2

mAL sin cos (t) + 0 0 0
= mL
2

mAL sin cos (t)
d
dt

= mL
2

mAL cos cos (t)

+ mAL
2
sin sin (t)
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Applying Euler-Lagrange Equation
Now that we have both sides of the Euler-Lagrange Equation we
can solve for

d
dt

=
L

mL
2

mAL cos cos (t)

+ mAL
2
sin sin (t)
=
mAL cos cos (t)

+ mgL sin
L

+ A
2
sin sin (t) = g sin
L

= g sin A
2
sin sin (t)

=
1
L
(g A
2
sin (t)) sin
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Applying Euler-Lagrange Equation
Now that we have both sides of the Euler-Lagrange Equation we
can solve for

d
dt

=
L

mL
2

mAL cos cos (t)

+ mAL
2
sin sin (t)
=
mAL cos cos (t)

+ mgL sin
L

+ A
2
sin sin (t) = g sin
L

= g sin A
2
sin sin (t)

=
1
L
(g A
2
sin (t)) sin
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
Applying Euler-Lagrange Equation
Now that we have both sides of the Euler-Lagrange Equation we
can solve for

d
dt

=
L

mL
2

mAL cos cos (t)

+ mAL
2
sin sin (t)
=
mAL cos cos (t)

+ mgL sin
L

+ A
2
sin sin (t) = g sin
L

= g sin A
2
sin sin (t)

=
1
L
(g A
2
sin (t)) sin
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator
References
http://en.wikipedia.org/wiki/Euler-Lagrange equation
http://en.wikipedia.org/wiki/Lagrangian mechanics
http://en.wikipedia.org/wiki/Newtons laws of motion

You might also like