Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Dynamics
Andrew Witkin
Carnegie Mellon University
SF1
SF2
A bead on a wire
Desired Behavior:
The bead can slide freely
along the circle.
It can never come off,
however hard we pull.
Question:
How does the bead move
under applied forces?
SF3
Penalty Constraints
Why not use a spring to hold the
bead on the wire?
Problem:
Weak springs goopy
constraints
Strong springs neptune
express!
SF4
fc
f'
f N
fc = N
NN
f = f + f c
SF5
f = ma
N
v
f'
fc
SF6
SF7
Representing Constraints
I. Implicit:
C(x) = x - r = 0
II. Parametric:
x = r cos ,sin
Point-on-circle
SF8
C=0
C=0
C = 0 legal position
C = 0 legal velocity
C = 0 legal curvature
SF9
C
N=
x
Constraint Gradient
Implicit:
C(x) = x - r = 0
Differentiating C gives
a normal vector.
This is the direction
our constraint force
will point in.
Point-on-circle
SF10
Constraint Forces
fc = N
Point-on-circle
SF11
C=
Nx
t
=Nx+Nx
fc = N
x =
f + fc
m
= 0, solve for :
Set C
Nx Nf
= -m
NN NN
C
2C
Notation: N = , N =
x
xt
Constraint force is N.
SF12
Example: Point-on-circle
Write down the constraint
equation.
C= x -r
C x
N=
=
x x
2C 1
xx
=
N=
xx
xx
xt x
Nx Nf
(xx)2
= m
= -m
- m(xx) - xf 1
xx
NN NN
x
SF13
C = - C - C, instead of
C=0
SF14
Tinkertoys
Now we know how to simulate a bead on a
wire.
Next: a constrained particle system.
E.g. constrain particle/particle distance to
make rigid links.
SF15
SF16
q = x 1,x 2, ,x n
Q = f 1,f 2, ,f n
m1
SF17
m1
m1
M=
mn
mn
mn
W = M-1
JWJT
= -Jq - JW Q
Constrained Acceleration
q = W Q + JT
More Notation
C = C1,C2, ,Cm
= 1,2, , m
C
J=
q
2C
J=
qt
SF18
SF19
Each constraint
contributes one or more
blocks to the matrix.
Matrix Block
Structure
C
C
x i
xi
C
x j
xj
SF20
fc
x
v
f
m
C
Global Stuff
x
v
f
SF21
Constraint
Constraint Structure
Each constraint
must know how
to compute these C
x
v
f
m
p1
x
v
f
C C
,
x 1 x 2
2C 2C
,
x 1t x 2t
Distance Constraint
C = x1 - x2 - r
p2
SF22
x x
v v
f f
m m
x
v
f
F F F
F
C C C
Added Stuff
SF23
x x
v v
f f
m m
x
1
v
f
Clear Force
Accumulators
x x
v v
f f
m m
x
v
f
m
Apply forces
Added Step
C C C
Return to solver
F F F
SF24
SF25
SF26
I. Implicit:
C(x) = x - r = 0
II. Parametric:
x = r cos ,sin
Point-on-circle
SF27
Parametric Constraints
Parametric:
x = r cos ,sin
Constraint is always
met exactly.
One DOF: .
Solve for .
Point-on-circle
SF28
x is not an independent
variable.
f
fc
x
T=
f = mv (constrained)
x = T
chain rule
f
+
f
T = m c
combine
SF29
For our
next trick
f
fc
x
T=
SF30
rearrange.
Big advantages:
Fewer DOFs.
Constraints are always met.
Big disadvantages:
Hard to formulate constraints.
No easy way to combine constraints.
SF31
SF32