Modeling and Analysis of Dynamic Systems
Dr. Guillaume Ducard
Fall 2017
Institute for Dynamic Systems and Control
ETH Zurich, Switzerland
c 1 / 21
G. Ducard
Outline
1 Lecture 4: Modeling Tools for Mechanical Systems
Lagrange Formalism
Lagrange Method with Kinematic Constraints
Pendulum on a Cart
2 Lecture 4: Hydraulic Systems
Water Duct
Compressible Duct Element
c 2 / 21
G. Ducard
Lagrange Formalism
Lecture 4: Modeling Tools for Mechanical Systems
Lagrange Method with Kinematic Constraints
Lecture 4: Hydraulic Systems
Pendulum on a Cart
Outline
1 Lecture 4: Modeling Tools for Mechanical Systems
Lagrange Formalism
Lagrange Method with Kinematic Constraints
Pendulum on a Cart
2 Lecture 4: Hydraulic Systems
Water Duct
Compressible Duct Element
c 3 / 21
G. Ducard
Lagrange Formalism
Lecture 4: Modeling Tools for Mechanical Systems
Lagrange Method with Kinematic Constraints
Lecture 4: Hydraulic Systems
Pendulum on a Cart
Lagrange: 1736 -1813
c 4 / 21
G. Ducard
Lagrange Formalism
Lecture 4: Modeling Tools for Mechanical Systems
Lagrange Method with Kinematic Constraints
Lecture 4: Hydraulic Systems
Pendulum on a Cart
Lagrange Formalism: Recipe
1 Define inputs and outputs
2 Define the generalized coordinates:
q(t) = [q1 (t), q2 (t), . . . , qn (t)] and
q̇(t) = [q̇1 (t), q̇2 (t), . . . , q̇n (t)]
3 Build the Lagrange function:
L(q, q̇) = T (q, q̇) − U (q)
4 System dynamics equations:
d ∂L ∂L
− = Qk , k = 1, . . . , n
dt ∂ q̇k ∂qk
Notes:
Qk represents the k-th “generalized force or torque” acting on
the k−th generalized coordinate variable qk
n: number of degrees of freedom in the system
always n generalized variables c 5 / 21
G. Ducard
Lagrange Formalism
Lecture 4: Modeling Tools for Mechanical Systems
Lagrange Method with Kinematic Constraints
Lecture 4: Hydraulic Systems
Pendulum on a Cart
Outline
1 Lecture 4: Modeling Tools for Mechanical Systems
Lagrange Formalism
Lagrange Method with Kinematic Constraints
Pendulum on a Cart
2 Lecture 4: Hydraulic Systems
Water Duct
Compressible Duct Element
c 6 / 21
G. Ducard
Lagrange Formalism
Lecture 4: Modeling Tools for Mechanical Systems
Lagrange Method with Kinematic Constraints
Lecture 4: Hydraulic Systems
Pendulum on a Cart
Lagrange Equations for Constrained Systems
ν
d ∂L ∂L X
− − µj αj,k = Qk , k = 1, . . . , n, (1)
dt ∂ q̇k ∂qk
j=1
Remarks:
the constraints are included using “Lagrange multipliers”: µj
j = 1...ν
Number of constraints: ν with (ν < n)
n may be seen as the number of DOF
In the end, we obtain: n + ν coupled equations to be solved
for q̈k and µj (usually requires computing the time derivative
of the constraints, i.e., µ̇).
c 7 / 21
G. Ducard
Lagrange Formalism
Lecture 4: Modeling Tools for Mechanical Systems
Lagrange Method with Kinematic Constraints
Lecture 4: Hydraulic Systems
Pendulum on a Cart
Outline
1 Lecture 4: Modeling Tools for Mechanical Systems
Lagrange Formalism
Lagrange Method with Kinematic Constraints
Pendulum on a Cart
2 Lecture 4: Hydraulic Systems
Water Duct
Compressible Duct Element
c 8 / 21
G. Ducard
Lagrange Formalism
Lecture 4: Modeling Tools for Mechanical Systems
Lagrange Method with Kinematic Constraints
Lecture 4: Hydraulic Systems
Pendulum on a Cart
Nonlinear Pendulum on a Cart
m = 1kg
ϕ(t) mg
y(t)
l = 1m
u(t)
M = 1kg
Figure: Pendulum on a cart, u(t) is the force acting on the cart
(“input”), y(t) the distance of the cart to an arbitrary but constant
origin, and ϕ(t) the angle of the pendulum.
c 9 / 21
G. Ducard
Lagrange Formalism
Lecture 4: Modeling Tools for Mechanical Systems
Lagrange Method with Kinematic Constraints
Lecture 4: Hydraulic Systems
Pendulum on a Cart
Step 1: Inputs & Outputs
Input: force acting on the cart: u(t)
Output: angle of the pendulum: ϕ(t)
Step 2: System’s coordinate variables
q1 = y, q̇1 = ẏ
q2 = ϕ, q̇2 = ϕ̇
Step 3: Lagrange functions
L1 (t) = T1 (t) − U1 (t)
L2 (t) = T2 (t) − U2 (t)
L(t) = L1 (t) + L2 (t)
c 10 / 21
G. Ducard
Lagrange Formalism
Lecture 4: Modeling Tools for Mechanical Systems
Lagrange Method with Kinematic Constraints
Lecture 4: Hydraulic Systems
Pendulum on a Cart
Step 4: System’s dynamics equations
d ∂L ∂L
− = Q1
dt ∂ q̇1 ∂q1
d ∂L ∂L
− = Q2
dt ∂ q̇2 ∂q2
We are looking for dynamic equations of the form:
ÿ(t) = f (ϕ(t), ϕ̇(t), u(t))
ϕ̈(t) = g(ϕ(t), ϕ̇(t), u(t))
c 11 / 21
G. Ducard
Lecture 4: Modeling Tools for Mechanical Systems Water Duct
Lecture 4: Hydraulic Systems Compressible Duct Element
Outline
1 Lecture 4: Modeling Tools for Mechanical Systems
Lagrange Formalism
Lagrange Method with Kinematic Constraints
Pendulum on a Cart
2 Lecture 4: Hydraulic Systems
Water Duct
Compressible Duct Element
c 12 / 21
G. Ducard
Lecture 4: Modeling Tools for Mechanical Systems Water Duct
Lecture 4: Hydraulic Systems Compressible Duct Element
Introduction
In general
they are described by Navier-Stokes equations.
For control purposes
simpler formulations are necessary, to build networks with building
blocks:
ducts,
compressible nodes,
valves, etc.
c 13 / 21
G. Ducard
Lecture 4: Modeling Tools for Mechanical Systems Water Duct
Lecture 4: Hydraulic Systems Compressible Duct Element
Water duct in gravitational field
v(t)
p1
l
A
h
v(t)
p2
Objective
d
v(t) = f (p1 (t), p2 (t), v(t), h, ρ, A, l)
dt
c 14 / 21
G. Ducard
Lecture 4: Modeling Tools for Mechanical Systems Water Duct
Lecture 4: Hydraulic Systems Compressible Duct Element
Change in momentum: Newton’s law
d~
p d~v
=m = F~pressure + F~gravity + F~f riction
dt dt Z
= [P1 A − P2 A] ~x + ~g · dm + F~f riction
tube
The mass m of the fluid in the element of tube of length l is given
by
m = ρ · A · l → dm = ρ · A · dl
c 15 / 21
G. Ducard
Lecture 4: Modeling Tools for Mechanical Systems Water Duct
Lecture 4: Hydraulic Systems Compressible Duct Element
Angle of the duct
dh
sin α =
dl
Gravity force
R R
tube
~g dm = g tube
(− cos α y + sin α ~x) ρ · A · dl
~
hR i
h cos α
Rh sin α
= ρ·g·A 0 − sin α dh ~y + 0 sin α dh ~x
= −ρ · g · A (tan α)−1 h ~y + ρ g A h ~x
c 16 / 21
G. Ducard
Lecture 4: Modeling Tools for Mechanical Systems Water Duct
Lecture 4: Hydraulic Systems Compressible Duct Element
Water duct in gravitational field
Dynamics along the ~x axis (because ~v = v~x)
dv(t)
ρAl = A (P1 − P2 ) + ρ g A h − Ffriction,x (t)
dt
with
1 2 Al
Ffriction,x (t) = ρ v (t) sign [v(t)] · λ (v(t)) ·
2 d
l
Remark: shape factor: d
c 17 / 21
G. Ducard
Lecture 4: Modeling Tools for Mechanical Systems Water Duct
Lecture 4: Hydraulic Systems Compressible Duct Element
Outline
1 Lecture 4: Modeling Tools for Mechanical Systems
Lagrange Formalism
Lagrange Method with Kinematic Constraints
Pendulum on a Cart
2 Lecture 4: Hydraulic Systems
Water Duct
Compressible Duct Element
c 18 / 21
G. Ducard
Lecture 4: Modeling Tools for Mechanical Systems Water Duct
Lecture 4: Hydraulic Systems Compressible Duct Element
k = 1/(σ0 V0 )
∆V (t)
∆V = 0
∗ ∗
V in (t) V out (t)
p(t)
Definitions of compressability
Property of a body (solid, liquid, gas, etc.) to deform (to change
its volume) under the effect of applied pressure.
Defined as:
1 dV
σ0 =
V0 dP
V0 : nominal volume [m3 ], P : pressure [Pa]
σ0 : compressibility [Pa−1 ]
k0 = σ10 is called elasticity constant P a · m−3 .
c 19 / 21
G. Ducard
Lecture 4: Modeling Tools for Mechanical Systems Water Duct
Lecture 4: Hydraulic Systems Compressible Duct Element
Compressibility effects
k = 1/(σ0 V0 )
∆V (t)
∆V = 0
∗ ∗
V in (t) V out (t)
p(t)
Modeling
∗ ∗
d
dt V (t) = V in (t) − V out (t) = Ain vin (t) − Aout vout (t)
1
∆P (t) = k ∆V (t) = σ0 V0 ∆V (t)
∆V (t) = V (t) − V0
c 20 / 21
G. Ducard
Lecture 4: Modeling Tools for Mechanical Systems Water Duct
Lecture 4: Hydraulic Systems Compressible Duct Element
Next lecture + Upcoming Exercise
Next lecture
Pelton Turbine
Electromagnetic systems
Next exercise: Online next Friday
Hydro-electric Power plant, Part I
c 21 / 21
G. Ducard