Page 1
1
Lecture 12: The Constraint Null Space
The matrix C has M rows and N columns, M < N
If we have set this up correctly, the rows of C are independent€
C ˙ q = 0 ⇔ C ji ˙ q j = 0
Nonholonomic (including the pseudo ones) constraints
(If not, do a row reduction and rewrite the constraints)
Page 2
2
Each row is an N row vector
The rate of change of q must be perpendicular to all the row vectors
There can be K = N – M independent vectors perpendicular to the row vectors of C
These vectors form the null space of C
Let’s try to say this another way
Page 3
3
The rows of C live in the same space
lives in an N dimensional vector space
€
˙ q
The M rows of C form a partial basis in that space
€
˙ q must be perpendicular to those basis vectors
The vectors that are perpendicular to the rows of C make up the null spacethere will be K of them, call them s1, s2, etc.
€
˙ q = u1s1 + u2s2 +L ⇔ ˙ q j = Skjuk
Page 4
4
u is a new vector; it is not the u vector we used in the Euler-Lagrange method
S is an N x K matrix. Its columns are the basis of the null space.
Let’s do a simple example of this before seeing how to use it.
Page 5
5
Let’s look at the erect wheel
€
z = rW , θ = − π2
Simple holonomic constraints
Rolling constraints
€
˙ x = rW˙ ψ cosφ, ˙ y = rW
˙ ψ sinφ
Generalized coordinates
€
q =
xyφψ
⎧
⎨ ⎪ ⎪
⎩ ⎪ ⎪
⎫
⎬ ⎪ ⎪
⎭ ⎪ ⎪
€
˙ q 1 − rW ˙ q 4 cosq3 = 0 = ˙ q 2 − rW ˙ q 4 sinq3
Page 6
6
The constraint matrix
€
C =1 0 0 −rW cosφ0 1 0 −rW sinφ ⎧ ⎨ ⎩
⎫ ⎬ ⎭
It’s obviously of full rank (rank = 2)
There are two vectors in the null spacewe can work them out on the blackboard
and combine them in the S matrix
€
S =
rW cosφ 0rW sinφ 0
0 11 0
⎧
⎨ ⎪ ⎪
⎩ ⎪ ⎪
⎫
⎬ ⎪ ⎪
⎭ ⎪ ⎪
Page 7
7
The rate of change of q becomes
€
˙ q = Su =
rW cosφ 0rW sinφ 0
0 11 0
⎧
⎨ ⎪ ⎪
⎩ ⎪ ⎪
⎫
⎬ ⎪ ⎪
⎭ ⎪ ⎪
u1
u2
⎧ ⎨ ⎩
⎫ ⎬ ⎭
If you expand this you will see that u1 and u2 denote the two rotation rates
The dimension of u is the true number of degrees of freedom taking the nonholonomic constraints into account.
Page 8
8
Let’s move on and see where this can take us.
€
M ijSkj is a function only of the qs
€
˙ p i = M ijSkj ˙ u k +
d M ijSkj( )
dtuk = M ijSk
j ˙ u k +∂ M ijSk
j( )∂qm ˙ q muk
€
˙ p i = M ijSkj ˙ u k +
∂ M ijSkj( )
∂qm Snmunuk
€
˙ p i = ∂L∂qi + λ jCi
j + Qithe momentum equations
€
pi = M ij ˙ q j = M ijSkjukthe momentum
combine in two steps
Page 9
9
€
˙ p i = ∂L∂qi + λ jCi
j + Qi
€
M ijSkj ˙ u kSp
i = −∂ M ijSk
j( )∂qm Sn
munukSpi + ∂L
∂qi Spi + λ jCi
jSpi + QiSp
i
And finally we can get rid of the Lagrange multipliers
0!
combine the momentum equation
€
˙ p i = M ijSkj ˙ u k +
∂ M ijSkj( )
∂qm Snmunuk
with what we just did
€
M ijSkj ˙ u k = −
∂ M ijSkj( )
∂qm Snmunuk + ∂L
∂qi + λ jCij + Qi
momentum equationin terms of u
Page 10
10
Before multiplying by S the free index was i, which runs from 1 to N
After multiplying by S, the free index becomes p which runs from 1 to K
We have reduced the number of momentum equations to the number of degrees of freedom and gotten rid of the Lagrange multipliers.
As usual, it is not as ghastly in practice as it looks in its full generality€
M ijSkj ˙ u kSp
i = −∂ M ijSk
j( )∂qm Sn
munukSpi + ∂L
∂qi Spi + QiSp
i
Page 11
11
We can go back to the erect coin to see how some of this plays out
€
L = 12
m ˙ x 2 + ˙ y 2( ) + 12
A ˙ φ 2 + 12
C ˙ ψ 2 = 12
m ˙ q 12
+ ˙ q 22
( ) + 12
A ˙ q 32
+ 12
C ˙ q 42
€
˙ p 1 = m ˙ q 1, p2 = m ˙ q 2, p3 = A ˙ q 3, p4 = C ˙ q 4
€
˙ q =
rW cosφ 0rW sinφ 0
0 11 0
⎧
⎨ ⎪ ⎪
⎩ ⎪ ⎪
⎫
⎬ ⎪ ⎪
⎭ ⎪ ⎪
u1
u2
⎧ ⎨ ⎩
⎫ ⎬ ⎭⇒ ˙ q 1 = rW cosφu1, ˙ q 2 = rW sinφu1, ˙ q 3 = u2, ˙ q 4 = u1
The momentum
The velocity equations
Page 12
12
€
p1 = mrW cosφu1, p2 = mrW sinφu1, p3 = Au2, p4 = Cu1
differentiate
€
˙ p 1 = mrW cosq3 ˙ u 1 − mrW sinq3u1u2
˙ p 2 = mrW sinq3 ˙ u 1 + mrW cosq3u1u2
˙ p 3 = A˙ u 2, ˙ p 4 = C ˙ u 1
None of the coordinates appears in the Lagrangian, so the dL/dq term is zeroand there are no generalized forces
and multiplication by S removes the Lagrange multipliers
My equations are simply
€
˙ p iS ji = 0
The momentum becomes
Page 13
13
€
˙ p iS ji = 0
€
S =
rW cosq3 0rW sinq3 0
0 11 0
⎧
⎨ ⎪ ⎪
⎩ ⎪ ⎪
⎫
⎬ ⎪ ⎪
⎭ ⎪ ⎪
€
˙ p iS ji = ˙ p 1 ˙ p 2 ˙ p 3 ˙ p 4{ }
rW cosq3 0rW sinq3 0
0 11 0
⎧
⎨ ⎪ ⎪
⎩ ⎪ ⎪
⎫
⎬ ⎪ ⎪
⎭ ⎪ ⎪
€
rW cosq3 ˙ p 1 + rW sinq3 ˙ p 2 + ˙ p 4 = 0˙ p 3 = 0
Let’s build it
expand
(continued on the next page)
Page 14
14
€
rW cosq3 ˙ p 1 + rW sinq3 ˙ p 2 + ˙ p 4 = 0˙ p 3 = 0
€
C + mrW2( ) ˙ u 1 = 0
A ˙ u 2 = 0
A lot of trigonometric cancellation leads to the final equations
€
˙ p 1 = mrW cosq3 ˙ u 1 − mrW sinq3u1u2
˙ p 2 = mrW sinq3 ˙ u 1 + mrW cosq3u1u2
˙ p 3 = A˙ u 2, ˙ p 4 = C ˙ u 1
substitute
Page 16
16
So, what is the drill?
Lagrangian
Holonomic constraints
Generalized coordinates
Nonholonomic constraints
Constraint matrix — null space matrix
€
˙ q j = Skjuk
The velocity equations
Page 17
17
Hamilton’s momentum equations
Eliminate p in favor of u
Multiply by S to reduce the number of momentum equations
Convert to explicit time dependence for the simulation
Page 18
18
What’s new and what’s hard?
The idea of the null space is new and finding it can be hard
Mathematica can give you a null space, but it may not be what you wantI generally work out my own
The goal is to devise a null space such that the components of u have a useful interpretation
Page 19
19
Multiply C and an arbitrary vector of length N
This will give you K conditions from which you can choose K basis vectors
Had I done this with the case just reviewed
€
Cs =1 0 0 −rW cosφ0 1 0 −rW sinφ ⎧ ⎨ ⎩
⎫ ⎬ ⎭
s1
s2
s3
s4
⎧
⎨ ⎪ ⎪
⎩ ⎪ ⎪
⎫
⎬ ⎪ ⎪
⎭ ⎪ ⎪
=s1 − rW cosφs4
s2 − rW sinφs4
⎧ ⎨ ⎩
⎫ ⎬ ⎭= 0
s1 is associated with x, s2 with y, s3 with f and s4 with y
I’d like to have one vector for which s3 is unityand one for which s4 is unity
Page 20
20
And that’s what I did
€
S =
rW cosq3 0rW sinq3 0
0 11 0
⎧
⎨ ⎪ ⎪
⎩ ⎪ ⎪
⎫
⎬ ⎪ ⎪
⎭ ⎪ ⎪
and that’s why the equations came out so nicely
(As it happens, this is the null space that Mathematica gives.)
Page 21
21
Let’s look at the 3 x 6 matrix from the two wheel system
€
C =
1 0 0 0 − 12
rW cosq3 − 12
rW cosq3
0 1 0 0 − 12
rW sinq3 − 12
rW sinq3
0 0 1 0 rW
lR
− rW
lR
⎧
⎨
⎪ ⎪ ⎪
⎩
⎪ ⎪ ⎪
⎫
⎬
⎪ ⎪ ⎪
⎭
⎪ ⎪ ⎪
We can multiply this one out
Page 22
22
€
Cs =
1 0 0 0 − 12
rW cosq3 − 12
rW cosq3
0 1 0 0 − 12
rW sinq3 − 12
rW sinq3
0 0 1 0 rW
lR
− rW
lR
⎧
⎨
⎪ ⎪ ⎪
⎩
⎪ ⎪ ⎪
⎫
⎬
⎪ ⎪ ⎪
⎭
⎪ ⎪ ⎪
s1
s2
s3
s4
s5
s6
⎧
⎨
⎪ ⎪ ⎪
⎩
⎪ ⎪ ⎪
⎫
⎬
⎪ ⎪ ⎪
⎭
⎪ ⎪ ⎪
€
s1 − 12
rW cosq3s5 − 12
rW cosq3s6 = 0
s2 − 12
rW sinq3s5 − 12
rW sinq3s6 = 0
s3 + rW
lR
s5 − rW
lR
s6 = 0
Do the multiplication and look at the three components of the product
We can pick any three and find the others
Page 23
23
recall
€
q =
x1
y1
φ1
ψ1
ψ 2
ψ 3
⎧
⎨
⎪ ⎪ ⎪
⎩
⎪ ⎪ ⎪
⎫
⎬
⎪ ⎪ ⎪
⎭
⎪ ⎪ ⎪
⇒
s1
s2
s3
s4
s5
s6
⎧
⎨
⎪ ⎪ ⎪
⎩
⎪ ⎪ ⎪
⎫
⎬
⎪ ⎪ ⎪
⎭
⎪ ⎪ ⎪
⇔
x1
y1
φ1
ψ1
ψ 2
ψ 3
⎧
⎨
⎪ ⎪ ⎪
⎩
⎪ ⎪ ⎪
⎫
⎬
⎪ ⎪ ⎪
⎭
⎪ ⎪ ⎪
We can take the three spins as fundamental and select bases such thats4 = 1, s5 =0, s6 = 0; s4 = 0, s5 =1, s6 = 0; s4 = 0, s5 =0, s6 = 1
Page 24
24
€
s1 − 12
rW cosq3s5 − 12
rW cosq3s6 = 0
s2 − 12
rW sinq3s5 − 12
rW sinq3s6 = 0
s3 + rW
lR
s5 − rW
lR
s6 = 0
s4 = 1, s5 =0, s6 = 0
€
s1 = 0
s2 = 0
s3 = 0
€
s1
s2
s3
s4
s5
s6
⎧
⎨
⎪ ⎪ ⎪
⎩
⎪ ⎪ ⎪
⎫
⎬
⎪ ⎪ ⎪
⎭
⎪ ⎪ ⎪
=
000100
⎧
⎨
⎪ ⎪ ⎪
⎩
⎪ ⎪ ⎪
⎫
⎬
⎪ ⎪ ⎪
⎭
⎪ ⎪ ⎪
and the base vector is
Page 25
25
€
s1 − 12
rW cosq3s5 − 12
rW cosq3s6 = 0
s2 − 12
rW sinq3s5 − 12
rW sinq3s6 = 0
s3 + rW
lR
s5 − rW
lR
s6 = 0
s4 = 0, s5 =1, s6 = 0
€
s1 = 12
rW cosq3s5
s2 = 12
rW sinq3s5
s3 = − rW
lR
s5
€
s1
s2
s3
s4
s5
s6
⎧
⎨
⎪ ⎪ ⎪
⎩
⎪ ⎪ ⎪
⎫
⎬
⎪ ⎪ ⎪
⎭
⎪ ⎪ ⎪
=
12
rW cosq3
12
rW sinq3
− rW
lR010
⎧
⎨
⎪ ⎪ ⎪ ⎪ ⎪
⎩
⎪ ⎪ ⎪ ⎪ ⎪
⎫
⎬
⎪ ⎪ ⎪ ⎪ ⎪
⎭
⎪ ⎪ ⎪ ⎪ ⎪
and the base vector is
Page 26
26
€
s1 − 12
rW cosq3s5 − 12
rW cosq3s6 = 0
s2 − 12
rW sinq3s5 − 12
rW sinq3s6 = 0
s3 + rW
lR
s5 − rW
lR
s6 = 0
s4 = 0, s5 =0, s6 = 1
€
s1
s2
s3
s4
s5
s6
⎧
⎨
⎪ ⎪ ⎪
⎩
⎪ ⎪ ⎪
⎫
⎬
⎪ ⎪ ⎪
⎭
⎪ ⎪ ⎪
=
12
rW cosq3
12
rW sinq3
rW
lR001
⎧
⎨
⎪ ⎪ ⎪ ⎪ ⎪
⎩
⎪ ⎪ ⎪ ⎪ ⎪
⎫
⎬
⎪ ⎪ ⎪ ⎪ ⎪
⎭
⎪ ⎪ ⎪ ⎪ ⎪
and the base vector is€
s1 = 12
rW cosq3s6
s2 = 12
rW sinq3s6
s3 = rW
lR
s6
Page 27
27
put it all together
€
S =
0 12
rW cosq3 12
rW cosq3
0 12
rW sinq3 12
rW sinq3
0 − rW
lR
rW
lR1 0 00 1 00 0 1
⎧
⎨
⎪ ⎪ ⎪ ⎪ ⎪
⎩
⎪ ⎪ ⎪ ⎪ ⎪
⎫
⎬
⎪ ⎪ ⎪ ⎪ ⎪
⎭
⎪ ⎪ ⎪ ⎪ ⎪
And the rank of this matrix is obviously three
Page 28
28
The advantage of this is that there are fewer equations to deal with
The disadvantage is that you do not get the constraint forces(through the Lagrange multipliers)
The main consideration is then whether you need the constraint forces
If you believe that, whatever they are, the ground will be able to provide themthen you may as well adopt the constraint null space method.
Let’s look at the two wheel cart using this method