Professional Documents
Culture Documents
Lagrange Equations: Use Kinetic and Potential Energy To Solve For Motion!
Lagrange Equations: Use Kinetic and Potential Energy To Solve For Motion!
References
http://widget.ecn.purdue.edu/~me563/Lectures/EOMs/Lagrange/In_Focus/page.html
System Modeling: The Lagrange Equations (Robert A. Paz: Klipsch School of Electrical and
Computer Engineering)
Electromechanical Systems, Electric Machines, and Applied Mechatronics by Sergy E. Lyshevski,
CRC, 1999.
Lagrange’s Equations, Massachusetts Institute of Technology @How, Deyst 2003 (Based on
notes by Blair 2002)
1
We use Newton's laws to describe the motions of objects. It works well
if the objects are undergoing constant acceleration but they can
become extremely difficult with varying accelerations.
For such problems, we will find it easier to express the solutions with
2
Modeling of Dynamic Systems
3
• Joseph-Louise Lagrange: 1736-1813.
• Born in Italy and lived in Berlin and Paris.
• Studied to be a lawyer.
• Contemporary of Euler, Bernoulli, D’Alembert, Laplace, and Newton.
• He was interested in math.
• Contribution:
– Calculus of variations.
– Calculus of probabilities.
– Integration of differential equations
– Number theory.
4
Equations of Motion: Lagrange Equations
• There are different methods to derive the dynamic equations of a
dynamic system. As final result, all of them provide sets of equivalent
equations, but their mathematical description differs with respect to
their eligibility for computation and their ability to give insights into the
underlying mechanical problem.
• Why Lagrange:
– Scalar not vector.
– Eliminate solving for constraint forces (what holds the system together)
– Avoid finding acceleration.
– Uses extensively in robotics and many other fields.
– Newton’s Law is good for simple systems but what about real systems?
5
Mathematical Modeling and System Dynamics
Newtonian Mechanics: Translational Motion
6
Force : Fcoulomb
7
Newtonian Mechanics: Translational Motion
8
Newton’s Second Law
The movement of a classical material point is described by the second law of Newton:
d 2 r (t )
m 2
= F (r , t ) (r is a vector indicating a position of the material point in space)
dt
x
r = y
z
Vector F(r, t) represents a force field, which may be calculated by taking
into account interactions with other particles, or interactions with electromagnetic
waves, or gravitational fields.
The second law of Newton is an idealisation, of course, even if one was to neglect
quantum and relativistic effects. There is no justification why only a second time derivative
of r should appear in that equation. Indeed if energy is dissipated in the system usually
first time derivatives will appear in the equation too. If a material point loses energy due to EM
radiation, third time derivatives will come up.
9
Energy in Mechanical and Electrical Systems
• In the Lagrangian approach, energy is the key issue. Accordingly,
we look at various forms of energy for electrical and mechanical
systems.
10
Electrical and Mechanical Counterparts
“Energy”
Energy Mechanical Electrical
12
Generalized Coordinates
• In order to introduce the Lagrange equation, it is important to first
consider the degrees of freedom (DOF = number of coordinates-
number of constraints) of a system. Assume a particle in a space:
number of coordinates = 3 (x, y, z or r, θ, φ); number of constrants
= 0; DOF = 3 - 0 = 3.
13
Cont..
∂L ∂L ∂P
∂q& ∂q ∂q& f
1 1 1 1
d . . . .
- + =
dt . . . .
∂L ∂L ∂P f n
∂q& n ∂q n ∂q& n
15
Example of Linear Spring Mass System and Frictionless
Table: The Steps
k
m
1 2 1 2 x
Lagrangian : L = K e − V = mx& − kx
2 2
d ∂L ∂L
Lagrang' s Equation : −
=0
dt ∂q& i ∂qi
∂L d ∂L ∂L
Do the derivatives : = mx&; = m&x&; = − kx
∂q& i
dt ∂q& i ∂qi
d ∂L ∂L
Combine all together : −
= m&x& + kx = 0
dt ∂q& i ∂qi
16
Mechanical Example: Mass-Spring Damper
1 2
Ke = mx&
2
1
V = Kx 2 + mg (h + x )
2
1 1
L = K e − V = mx& 2 − Kx 2 − mg (h + x )
2 2
1
P = Bx& 2
2
We have the generalized coordinate q = x, and thus with the applied force Q = f , we write
the Lagrange equation :
d ∂L ∂L ∂P
f = − +
dt ∂x& ∂x ∂x&
d ∂ 1 1
= ( ( mx& 2 − Kx 2 − mg (h + x)))
dt ∂x& 2 2
∂ 1 1 ∂ 1
− ( mx& 2 − Kx 2 − mg (h + x)) + ( Bx& 2 )
∂x 2 2 ∂x& 2
d
= (mx& 2 ) − (− Kx − mg ) + ( Bx& )
dt
= m&x& + Kx + mg + Bx& 17
Electrical Example: RLC Circuit
1 2
Ke = Lq&
2
1 2
V= q
2C
1 2 1 2
L = Ke −V = Lq& − q
2 2C
1 2
P= Rq&
2
We have the generalized coordinate q (charge), and with the applied force Q = u , we have
d ∂L ∂L ∂P
u= − +
dt ∂q ∂q ∂q&
&
d ∂ 1 2 1 2 ∂ 1 1 2 ∂ 1
= ( ( Lq& − q )) − ( Lq& 2 − q ) + ( Rq& 2 )
dt ∂q& 2 2C ∂q 2 2C ∂q& 2
d Q Q di
= ( Lq& ) + + Rq& = Lq&& + + Rq& = L + vc + Ri
dt C C dt
i = q& and q = Cvc for a capacitor. This is just KVL equation
18
Electromechanical System: Capacitor Microphone
About them see: http://www.soundonsound.com/sos/feb98/articles/capacitor.html
1 2 1 2 1 2 1 2
Ke = Lq& + mx& ; V = q + Kx
2 2 2C 2
εA ε is the dielectric constant of the air (F/m),
C=
xo − x A is the area of the plate, xo - x is the plate separation
1 1 2 1 2 1 2
V= (xo − x ) q + Kx ; P = Rq& + Bx&
2
2ε A 2 2 2
1 1 1
L = Lq& 2 + mx& 2 − (xo − x )q 2 − 1 Kx 2
2 2 2εA 2
19
2
∂L ∂L q ∂P
= mx&; = − Kx; = Bx&
∂x& ∂x 2εA ∂x&
∂L ∂L (xo − x )q ∂P
= Lq&; = ; = Rq&
∂q& ∂q εA ∂q&
Then we obtain the two Lagrange equations
q2
m&x& + Bx& + Kx − = f
2ε A
1
Lq&& + Rq& + ( xo − x ) q = v
εA 20
Robotic Example
θ
q = Generalized coordinates (θ angular position; r radial length; both vary)
r
τ
Q = Applicable forces to each component; τ is the torque; f is the force
f
1 1
J = mr 2 ; K e = Jθ& 2 + mr& 2 ; V = mgr sin (θ )
2 2
1 1
The power dissipation : P = B1θ& 2 + B2 r& 2
2 2
1 1
L = K e − V = Jθ& 2 + mr& 2 − mgr sin (θ )
2 2
∂L ∂L ∂P
∂L ∂θ Jθ& mr 2θ& ∂L ∂θ − mgr cos(θ ) ∂P ∂θ& B1θ&
= = = ; = = ; = =
∂q& ∂L mr& mr& ∂q ∂L mrθ& 2 − mg sin(θ ) ∂q& ∂P B2 r&
∂r& ∂r ∂r&
21
The Lagrange equation becomes
d ∂L ∂L ∂P
Q = − +
dt ∂q& ∂q ∂q&
mr 2θ&& + 2mrr&θ& − mgr cos(θ ) B1θ&
Q= − &2 +
m&r& mrθ − mg sin(θ ) B2 r&
mr 2 0 θ&& B1 2mrθ& θ& mgr cos(θ ) τ
+ + =
0 m &r& − mrθ& B2 r& mg sin(θ ) f
M (q )q&& + V (q, q& ) + G (q ) = Q
M (q ) is the inertia matrix; V (q, q& ) is the Coriolis/centripetal vector
G (q ) is the gravity vector; Q is the input vector
22
Example: Two Mesh Electric Circuit
R1 L1 L2
C2
Ua(t) q1 L12 q2
C1
R2
d ∂K e ∂K e ∂P ∂V d ∂K e ∂K e ∂P ∂V
( )− + + = Q1 ; ( )− + + =0
dt ∂q1
& ∂q1 ∂q1 ∂q1
& dt ∂q 2
& ∂q 2 ∂q 2 ∂q 2
&
q1 q2
( L1 + L12 )q&&1 − L12 q&&2 + R1q&1 + = U a ; - L12 q1 + ( L2 + L12 )q 2 + R2 q 2 +
&& && & =0
C1 C2
1 q1 1 q2
q&&1 = − − R1q&1 + L12 q&&2 + U a ; q&&2 = L12 q&&1 − − R2 q& 2
( L1 + L12 ) C1 ( L2 + L12 ) C2
24
Another Example
ia(t) iL(t)
R L
q1 C q2
Ua(t) uc uL
RL
θr
Load
TL
ir
ωr, Te
Rotor Te : electromagnetic torque
TL : Load torque
ur
Stator
is ir
q1 = ; q 2 = ; q3 = θ r ;
s s
Rr Lr
Ls q&1 = is ; q& 2 = ir ; q& 3 = ω r ;
us is Q1 = u s ; Q2 = u r ; Q3 = −TL
Rs
27
The Lagrange equations are expressed in terms of each independent
coordinate
d ∂K e ∂K e ∂P ∂V
( )− + + = Q1
dt ∂q&1 ∂q1 ∂q&1 ∂q1
d ∂K e ∂K e ∂P ∂V
( )− + + = Q2
dt ∂q& 2 ∂q 2 ∂q& 2 ∂q 2
d ∂K e ∂K e ∂P ∂V
( )− + + = Q3
dt ∂q& 3 ∂q3 ∂q& 3 ∂q3
28
The total kinetic energy is the sum of the total electrical (magnetic) and
mechanical (moment of inertia) energies
1 1 1
K ee = Ls q&12 + Lsr q&1q& 2 + Lr q& 22 (Electrical); K em = Jq& 32 (Mechanical)
2 2 2
1 2 1 2 1 2
K e = K ee + K em = Ls q1 + Lsr q1q 2 + Lr q 2 + Jq& 3
& & & &
2 2 2
Ns Nr Ns Nr
Mutual inductance : Lsr (θ r ) = ; LM = Lsr max =
ℜ m (θ r ) ℜ m (90 0 )
Lsr (θ r ) = LM cos θ r = LM cos q3 ( LM is magnetizing reluctance)
1 1 1
Ke = Ls q&12 + LM q&1q& 2 cos q3 + Lr q& 22 + Jq& 32
2 2 2
∂K ∂K
The following partial derivatives result : e = 0; e = Ls q&1 + LM q& 2 cos q3
∂q1 ∂q&1
∂K e ∂K e ∂K e ∂K e
= 0; = LM q1 cos q3 + Lr q 2 ;
& & = − LM q1q2 sin q3 ;
& & = Jq& 3
∂q 2 ∂q& 2 ∂q3 ∂q& 3
29
We have only a mechanical potential energy: Spring with a constant ks
1
The potential energy of the spring with constant k s : V = k s q32
2
∂V ∂V ∂V
= 0; = 0; = k s q3
∂q1 ∂q 2 ∂q3
The total heat energy dissipated is expressed as : P = PE + PM
1 1 1
PE = Rs q&12 + Rr q& 22 ; PM = Bm q& 32
2 2 2
1 1 1
P = Rs q&12 + Rr q& 22 + Bm q& 32
2 2 2
∂P ∂P ∂P
= Rs q&1 ; = Rr q& 2 ; and = Bm q& 3
∂q1
& ∂q 2
& ∂q3
&
Substituting the original values, we have three differential equations for servo - system
dis di dθ r
Ls + LM cos θ r r − LM i r sin θ r + Rs i s = u s
dt dt dt
di di dθ r
Lr r + LM cos θ r s − LM i s sin θ r + Rr i r = u r
dt dt dt
d 2θ r dθ r
J + LM is ir sin θ r + Bm + k sθ r = −TL
dt 2 dt 30
dθ r
The last equation should be written in terms of rotor angular velocity ( = ω).
dt
Also, using stator current and rotor current, angular velocity, and position as state variables
dis 1 1 2
= − Rs Lr is − LM isω r sin 2θ r + Rr LM ir cos θ r + Lr LM ω r sin θ r + Lr u s − LM cos θ r u r
dt Ls Lr − L2M cos 2 θ r 2
dir 1 1 1 2
= − R L
s M si − L L i ω
s M s r sin θ r − R L i
r s r − L i ω
M r r sin 2θ − L M cos θ u
r s + L s r
u
dt Ls Lr − L2M cos 2 θ r 2 2
dω r 1
= (− LM is ir sin θ r − Bmω r − k sθ r − TL )
dt J
dθ r
= ωr
dt
dω 1
Considering the third equation : r = (− LM is ir sin θ r − Bmω r − k sθ r − TL )
dt J
We can obtain the expression for the electromagnetic torque Te developed :
Te = − LM is ir sin θ r
31
More Application
Application of Lagrange equations of motion in the modeling of two-
phase induction motor and generator.
Transducers
32