ps9_sol-2
ps9_sol-2
Exercise 5.2
(a)
T
∂f 1 2 1 2
= xT + xT
+ 3 5
∂x 4 7 4 7
2 6
= xT
+ 3 5
6 14
∂f
= 11 25
∂x x=(1,1)
(b)
∂f
≡ 0
∂x
x∗ = (1.5, −1)
Exercise 5.3
FONC :
2x2 2x3
2x1 2x2 2x3 +λ 2x1 4 9 =0
x1 (1 + λ) = 0
λ
x2 (1 + ) = 0
4
λ
x3 (1 + ) = 0
9
Constraint :
x22 x23
x21 + + −1=0
4 9
From the 4 equation above, solutions are
1
Exercise 5.4
Let p = (px , py , pz ). Then, the problem is
minimize f (x)
subject to g(x) = 0
FONC :
2(x − px ) + λa = 0
2(y − py ) + λb = 0
2(z − pz ) + λc = 0
ax + by + cz + d = 0
Exercise 5.5
Derivative of cost J can be expanded by integration by parts as:
Z tf
∂L ∂L ∂L
δJ = δx + δ ẋ + δ ẍ dt
0 ∂x ∂ ẋ ∂ ẍ
tf Z tf
d2 ∂L
∂L ∂L d ∂L ∂L d ∂L
= δx + δ ẋ + δx + − + 2 δx dt
∂ ẋ ∂ ẍ dt ∂ ẍ 0 0 ∂x dt ∂ ẋ dt ∂ ẍ
from the boundary conditions, δx(0), δx(tf ), δ ẋ(0), δ ẋ(tf ) = 0, and Euler-Lagrange equations be-
comes
d2 ∂L
∂L d ∂L
− + 2 = 0.
∂x dt ∂ ẋ dt ∂ ẍ
2
Exercise 5.6
From position of the bob of mass m, p = (l sin θ cos ϕ, l sin θ sin ϕ, −l cos θ), kinetic energy and
potential energy can be obtained as,
1
T = ml2 (θ̇2 + sin2 θϕ̇2 ), V = −mgl cos θ
2
1
∴ L(θ, ϕ, θ̇, ϕ̇) = T − V = ml2 (θ̇2 + sin2 θϕ̇2 ) + mgl cos θ
2
and from Euler-Lagrange equations with respect to ϕ and θ,
d ∂L ∂L d 2 2
− = ml sin θϕ̇ = 0
dt ∂ ϕ̇ ∂ϕ dt
d ∂L ∂L
− = ml2 θ̈ − ml2 sin θ cos θϕ̇2 − mgl sin θ = 0
dt ∂ θ̇ ∂θ
following equation of motion can be obtained.
2
2 2 g K
ml sin θ · ϕ̇ = constant = K, θ̈ = − sin θ + cot θ csc2 θ.
l ml2
Exercise 5.7
(a) In lecture note,
α (θ¨2 + θ˙12 sin θ2 cos θ2 )
′
0
′
α (θ̈1 cos θ2 − 2θ˙1 θ˙2 sin θ2 )
T
Ja V˙a − [Va ] Ja Va =
0
−mg sin θ2
−mg cos θ2
Let a frame {r} be attached on a fixed bar. At a frame {a},
α (θ¨2 + θ˙12 sin θ2 cos θ2 )
′
−mg( L2 − a) cos θ2
τ2
M2ja + 0 = 0
′
M2ka 0 ˙ ˙
α (θ̈1 cos θ2 − 2θ1 θ2 sin θ2 )
Also,
M1ir τ2
M1jr cos θ2 + τ1 sin θ2 = M2ja
−M1jr sin θ2 + τ1 cos θ2 M2ka
Therefore,
′
τ1 = α (θ̈1 cos2 θ2 − 2θ̇1 θ̇2 sin θ2 cos θ2 )
′
¨ ˙2 L
τ2 = α (θ2 + θ1 sin θ2 cos θ2 ) + mg − a cos θ2
2
(b) Kinematics:
⃗ = θ˙1 kr + θ˙2 ia = θ̇1 (sin θ2 ja + cos θ2 ka ) + θ̇2 ia
ω
′
α 0 0
′ 1
Ia = 0 0 0 , α = mL2 − ma(L − a)
′ 3
0 0 α
3
Energy:
1 T 1 ′
T = ωa Ia ωa = (θ̇22 + θ̇12 cos2 θ2 )α
2 2
L
V = mg − a sin θ2
2
Lagrangian:
L = T −V
1 T 1 2 2 2 ′ L
= ω Ia ωa = (θ̇2 + θ̇1 cos θ2 )α − mg − a sin θ2
2 a 2 2
Equations of Motion:
For θ1 ,
d ∂L ∂L ′
− = τ1 ⇒ τ1 = α (θ̈1 cos2 θ2 − 2θ̇1 θ̇2 sin θ2 cos θ2 )
dt ∂ θ˙1 ∂θ1
For θ2 ,
d ∂L ∂L ′ L
− = τ2 ⇒ τ2 = α (θ¨2 + θ˙12 sin θ2 cos θ2 ) + mg − a cos θ2
dt ∂ θ˙2 ∂θ2 2
(c) Same.
Exercise 5.9
Kinematics:
Energy:
1 1
T = m|⃗v |2 = m ż 2 (1 + cos2 θ0 ) + z 2 ϕ̇2 cos2 θ0
2 2
V = mgz
Lagrangian:
L = T −V
1 2
= m ż (1 + cos2 θ0 ) + z 2 ϕ̇2 cos2 θ0 − mgz
2
Equations of Motion:
For ϕ,
d ∂L ∂L
− = 0 ⇒ z 2 ϕ̇ = constant
dt ∂ ϕ̇ ∂ϕ
For z,
d ∂L ∂L
− = 0 ⇒ mz̈(1 + cos2 θ0 ) − mz ϕ̇2 cos2 θ0 + mg = 0
dt ∂ ż ∂z
4
Exercise 5.11
(a) f (x) is a second-order polynomial and a smooth function of x1 and x2 . To minimize f (x) with
respect to x ∈ R2 , first-order necessary condition (FONC) should be satisfied as follows:
" #
∂f (x)
∂x 2x1 + x2 − 1
∇x f (x) = ∂f (x) =
1 = 0,
x1 + x2 − 1
∂x2
for which the only solution is x1 = 0, x2 = 1; there are no other candidates for a minimum (or
maximum, or saddle point). Note that as both x1 and x2 become infinite, f (x) approaches infinity,
thus implying that x1 = 0, x2 = 1 is a global minimum.
(b) Any solution x(t) must satisfy the Euler-Lagrange equation ∂L d ∂L 2 2
∂x − dt ∂ ẋ , where L = ẋ − x . The
Euler-Lagrange equations become
−2x − 2ẍ = 0.
Solving ẍ + x = 0 for x(t) with the given boundary conditions x(0) = 0 and x(π/2) = 1 leads to
the optimal solution x(t) = sin(t).
(c) Unlike the previous problem (b), the boundary conditions is not completely given here (i.e.,
x(tf )). Thus, let x(2) = c and solve the Euler-Lagrange equations to get the optimal value
R tf
ti L(x, ẋ)dt as a function of c (i.e., J(c)). The optimal x(2) can then be obtained by mini-
mizing the optimal value J(c) with respect to c. Following this strategy, Any solution x(t) must
satisfy the Euler-Lagrange equations as follows:
∂L d ∂L
− = 0, x(0) = 1, x(2) = c,
∂x dt ∂ ẋ
where L = tẋ + ẋ2 . The Euler-Lagrange equations become
∂L d ∂L
− = −1 − 2ẍ = 0,
∂x dt ∂ ẋ
which leads to x(t) = − 41 t2 +C1 t+C2 . Since the solution x(t) should satisfy the boundary conditions
x(0) = 1 and x(2) = c, the constants C1 and C2 can be computed as C1 = c/2, C2 = 1. Substituting
x(t) into the optimal value J(c),
Z 2
1 2
J(c) = L(x, ẋ)dt = c2 − ,
0 2 3
which is uniquely minimized when c = 0. Thus the optimal boundary condition is x(2) = 0.
Exercise 5.14
(a) Observing that the system has two degrees of freedom and choosing (x1 , x2 ) as the generalized
coordinates, the kinetic and potential energies of the system are given by
1 1
K = m1 ẋ21 + m2 (−ẋ1 + ẋ2 )2
2 2
1
P = −m1 gx1 − m2 g(l1 − x1 + x2 ) + k(x2 − l0 )2 .
2
Substituting m1 = m2 = m, the Lagrangian L = K − P becomes
1 1 1
L = mẋ21 + m(−ẋ1 + ẋ2 )2 + mg(l1 + x2 ) − k(x2 − l0 )2 .
2 2 2
5
The corresponding Euler-Lagrange equations are
d ∂L ∂L
− = mẍ1 − m(−ẍ1 + ẍ2 ) − 0 = m(2ẍ1 − ẍ2 ) = 0
dt ∂ ẋ1 ∂x1
d ∂L ∂L
− = m(−ẍ1 + ẍ2 ) − (mg − k(x2 − l0 )) = 0,
dt ∂ ẋ2 ∂x2
which simplify to
1
ẍ1 = ẍ2
2
2k
ẍ2 = − (x2 − l0 ) + 2g.
m
From the above it can be seen that the solution for x2 (t) can be found independently of x1 .
(b) Observing that the system has two degrees of freedom and choosing (x1 , x3 ) to be the gen-
eralized coordinates, the kinetic and potential energies for the system are
1 1 1
K = m1 (ẋ1 − ẋ3 )2 + m2 (−ẋ1 − ẋ3 )2 + m3 ẋ23
2 2 2
P = −m1 g(x1 + l2 − x3 ) − m2 g(l1 − x1 + l2 − x3 ) − m3 gx3 .
5ẍ1 + ẍ3 = g
ẍ1 + 9ẍ3 = g.