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

Definition
The energy which an object possesses due to its motion
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

Kinetic Energy

Definition
The energy which an object possesses due to its motion

It is defined as the work needed to accelerate a body of a


given mass from rest to its stated velocity
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

Kinetic Energy

Definition
The energy which an object possesses due to its motion

It is defined as the work needed to accelerate a body of a


given mass from rest to its stated velocity
In classical mechanics, the kinetic energy Ek of a point object
is defined by its mass m and velocity v :

1
Ek = mv 2
2
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

Potential Energy

Definition
The energy of an object or a system due to the position of the
body or the arrangement of the particles of the system
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

Potential Energy

Definition
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
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

Potential Energy

Definition
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 Ep is defined by its mass m, and the gravitational
constant g :

Ep = 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
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
Lagrange’s equations employ a single scalar function, rather
than vector components
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
Lagrange’s 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

Definition
In classical mechanics, the natural form of the Lagrangian is
defined as L = Ek − Ep
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

Lagrangian

Definition
In classical mechanics, the natural form of the Lagrangian is
defined as L = Ek − Ep

E.O.M. can be directly derived by substitution using


EulerLagrange equation:
 
d ∂L ∂L
=
dt ∂ θ̇ ∂θ
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

Inverted Pendulum Problem

The pendulum is a stiff bar of length L which is supported at


one end by a frictionless pin
The pin is given an oscillating vertical motion s defined by:

s(t) = A sin ωt
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

Inverted Pendulum Problem

The pendulum is a stiff bar of length L which is supported at


one end by a frictionless pin
The pin is given an oscillating vertical motion s defined by:

s(t) = A sin ω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 figure on previous page we know

x = L sin θ ẋ = L cos (θ)θ̇


y = L cos θ ẏ = −L sin (θ)θ̇
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

Setup

From the figure on previous page we know

x = L sin θ ẋ = L cos (θ)θ̇


y = L cos θ ẏ = −L sin (θ)θ̇

Recall the definition of the Lagrangian

L = Ek − Ep
1
L = mv 2 − mgy
2
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

Setup Continued...
Velocity is a vector representing the change in position, hence

v 2 = ẋ 2 + ẏ 2
= L2 θ̇2 cos2 θ + L2 θ̇2 sin2 θ
= L2 θ̇2 (cos2 θ + sin2 θ)
= L2 θ̇2
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

Setup Continued...
Velocity is a vector representing the change in position, hence

v 2 = ẋ 2 + ẏ 2
= L2 θ̇2 cos2 θ + L2 θ̇2 sin2 θ
= L2 θ̇2 (cos2 θ + sin2 θ)
= L2 θ̇2

Substituting into the equation for the Lagrangian we get


Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

Setup Continued...
Velocity is a vector representing the change in position, hence

v 2 = ẋ 2 + ẏ 2
= L2 θ̇2 cos2 θ + L2 θ̇2 sin2 θ
= L2 θ̇2 (cos2 θ + sin2 θ)
= L2 θ̇2

Substituting into the equation for the Lagrangian we get

1
L = mv 2 − mgy
2
1
L = mL2 θ̇2 − mgL cos θ
2
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

Setup Continued...

Recall the Euler-Lagrange equation


 
d ∂L ∂L
=
dt ∂ θ̇ ∂θ
We shall now compute both sides of the equation and solve for θ̈
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

∂L
Computing ∂θ

1
L = mL2 θ̇2 − mgL cos θ
2
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

∂L
Computing ∂θ

1
L = mL2 θ̇2 − mgL cos θ
2

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

 
d ∂L
Computing dt ∂ θ̇

1
L = mL2 θ̇2 − mgL cos θ
2
We compute in two steps:
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

 
d ∂L
Computing dt ∂ θ̇

1
L = mL2 θ̇2 − mgL cos θ
2
We compute in two steps:
∂L
= mL2 θ̇ − 0
∂ θ̇
= mL2 θ̇
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

 
d ∂L
Computing dt ∂ θ̇

1
L = mL2 θ̇2 − mgL cos θ
2
We compute in two steps:
∂L
= mL2 θ̇ − 0
∂ θ̇
= mL2 θ̇

 
d ∂L
= mL2 θ̈
dt ∂ θ̇
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 θ̈
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 ∂L ∂L
=
dt ∂ θ̇ ∂θ
2
mL θ̈ = mgL sin θ
g
θ̈ = sin θ
L
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 θ ẋ = L cos (θ)θ̇


y = L cos θ + A sin ωt ẏ = −L sin (θ)θ̇ + Aω cos ωt
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

Setup

With the oscillator we must modify the equation for y

x = L sin θ ẋ = L cos (θ)θ̇


y = L cos θ + A sin ωt ẏ = −L sin (θ)θ̇ + Aω cos ωt

Again, we use the definition of the Lagrangian

L = Ek − Ep
1
L = mv 2 − mgy
2
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

Setup Continued...
Velocity is a vector representing the change in position, hence
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

Setup Continued...
Velocity is a vector representing the change in position, hence

v 2 = ẋ 2 + ẏ 2
= L2 θ̇2 cos2 θ + L2 θ̇2 sin2 θ − 2ALω sin θ cos (ωt)θ̇ + A2 ω 2 cos2 (ωt)
= L2 θ̇2 (cos2 θ + sin2 θ) − 2ALω sin θ cos (ωt)θ̇ + A2 ω 2 cos2 (ωt)
= L2 θ̇2 − 2ALω sin θ cos (ωt)θ̇ + A2 ω 2 cos2 (ω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 = ẋ 2 + ẏ 2
= L2 θ̇2 cos2 θ + L2 θ̇2 sin2 θ − 2ALω sin θ cos (ωt)θ̇ + A2 ω 2 cos2 (ωt)
= L2 θ̇2 (cos2 θ + sin2 θ) − 2ALω sin θ cos (ωt)θ̇ + A2 ω 2 cos2 (ωt)
= L2 θ̇2 − 2ALω sin θ cos (ωt)θ̇ + A2 ω 2 cos2 (ωt)

Substituting into the equation for the Lagrangian we get

1
L = mv 2 − mgy
2
1
L = mL2 θ̇2 − mALω sin θ cos (ωt)θ̇
2
1
+ mA2 ω 2 cos2 (ωt) − mgL cos θ − mgA sin (ωt)
2
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

Setup Continued...
Velocity is a vector representing the change in position, hence

v 2 = ẋ 2 + ẏ 2
= L2 θ̇2 cos2 θ + L2 θ̇2 sin2 θ − 2ALω sin θ cos (ωt)θ̇ + A2 ω 2 cos2 (ωt)
= L2 θ̇2 (cos2 θ + sin2 θ) − 2ALω sin θ cos (ωt)θ̇ + A2 ω 2 cos2 (ωt)
= L2 θ̇2 − 2ALω sin θ cos (ωt)θ̇ + A2 ω 2 cos2 (ωt)

Substituting into the equation for the Lagrangian we get

1
L = mv 2 − mgy
2
1 2 2
L = mL θ̇ − mALω sin θ cos (ωt)θ̇
2
1
+ mA2 ω 2 cos2 (ωt) − mgL cos θ − mgA sin (ωt)
2
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

∂L
Computing ∂θ

1
L = mL2 θ̇2 − mALω sin θ cos (ωt)θ̇
2
1
+ mA2 ω 2 cos2 (ωt) − mgL cos θ − mgA sin (ωt)
2
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

∂L
Computing ∂θ

1
L = mL2 θ̇2 − mALω sin θ cos (ωt)θ̇
2
1
+ mA2 ω 2 cos2 (ωt) − mgL cos θ − mgA sin (ωt)
2

∂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

 
d ∂L
Computing dt ∂ θ̇

1
L = mL2 θ̇2 − mALω sin θ cos (ωt)θ̇
2
1
+ mA2 ω 2 cos2 (ωt) − mgL cos θ − mgA sin (ωt)
2
We compute in two steps:
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

 
d ∂L
Computing dt ∂ θ̇

1
L = mL2 θ̇2 − mALω sin θ cos (ωt)θ̇
2
1
+ mA2 ω 2 cos2 (ωt) − mgL cos θ − mgA sin (ωt)
2
We compute in two steps:
∂L
= mL2 θ̇ − mALω sin θ cos (ωt) + 0 − 0 − 0
∂ θ̇
= mL2 θ̇ − mALω sin θ cos (ωt)
Background Inverted Pendulum Visualization Derivation Without Oscillator Derivation With Oscillator

 
d ∂L
Computing dt ∂ θ̇

1
L = mL2 θ̇2 − mALω sin θ cos (ωt)θ̇
2
1
+ mA2 ω 2 cos2 (ωt) − mgL cos θ − mgA sin (ωt)
2
We compute in two steps:
∂L
= mL2 θ̇ − mALω sin θ cos (ωt) + 0 − 0 − 0
∂ θ̇
= mL2 θ̇ − mALω sin θ cos (ωt)

 
d ∂L
= mL2 θ̈ − mALω cos θ cos (ωt)θ̇ + mALω 2 sin θ sin (ωt)
dt ∂ θ̇
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 θ̈
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 ∂L ∂L
=
dt ∂ θ̇ ∂θ

mL2 θ̈ − mALω cos θ cos (ωt)θ̇ + mALω 2 sin θ sin (ωt)


=
−mALω cos θ cos (ωt)θ̇ + mgL 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 ∂L ∂L
=
dt ∂ θ̇ ∂θ

mL2 θ̈ − 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
θ̈ = (g − Aω 2 sin (ωt)) sin θ
L
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/Newton’s laws of motion

You might also like