Spacetime Constraints Andrew Witkin Michael Kass Presenter: Fayun Luo.
Spacetime Constraints
description
Transcript of Spacetime Constraints
Spacetime Constraints
Witkin & Kass
Siggraph 1988
Overview
• Unlike common Newtonian dynamic simulation, the due driving force is unknown
• Specify the high-level spacetime constraint and let the optimization solve for the position and force unknowns by minimizing the “energy consumption”
2
3
Lamp on floor
4
Problem Statement (single particle)
0 mgfxm
dttfRT
0
2|)(|
bTxax )(,)0(
Governing Equation (Motion Equation):
Object Function (Energy Consumption):
Boundary Conditions:
gf(t)
5
Discretize continuous function
1n
i
Discretize unknown function x(t) and f(t) as:
x1, x2, …xi, … xn-1, xn
f1, f2, …fi, … fn-1, fn
Our goal is to solve these discretized 2n values… x1xn satisfies goals while optimizing f1fn
Next step is to discretize our motion equation and object equation.
6
Difference Formula
h
xx
h
xx
h
xxx iiiiiii 2
1111
xi - 1 xi xi + 1
xi - 0.5 xi + 0.5
h h
211
11
5.05.0 2
h
xxx
hhxx
hxx
h
xxx iii
iiii
iii
Backward Forward Central
Central 7
Discretized Function
3,2,0)2(
0
112
imgfxxxh
m
mgfxm
iiii
bxbTx
axax
4
1
)(
)0(t
x
x1, f1
x2, f2
x3, f3x4, f4
Motion equation:
Boundary Conditions:
24
1
0
2
||
|)(|
ii
T
fR
dttfR
Object Function: When does R have minimum value?
0000
0
4321
f
R
f
R
f
R
f
R
f
R
i
8
Generalize Our Notation
0S
R
3,2,0)2( 112 imgfxxx
h
miiii
bxax 41
t
x
x1, f1
x2, f2
x3, f3
x4, f4
Unknown vector:
S = (S1, S2, …Sn)
Constraint Functions:
Ci(S) = 0
Minimize Object Function R(S):
0000
0000
4321
4321
f
R
f
R
f
R
f
R
x
R
x
R
x
R
x
R S = (x1, x2, x3, x4, f1, f2, f3, f4)
j
iij S
CJ
jiij SS
RH
2
9
Sequential Quadratic Programming (SQP) Step One
S
R
0S
R
))(())((!2
1))(()()( 22''' axOaxafaxafafxf
Pick a guess S0, evaluate
Taylor series expansion of function f(x) at point a is:
))(()( 2002
2
00
SSOSSS
R
S
R
S
R
SSSS
'100
00 ))((0
SSSSorSSS
SSSHS
Rij
SS
Most likely
Similarly, we have:
Set equal to 0Omit
S is the change to S0 that makes derivative equal to 0
10
SQP Step Two
))(()()()( 2'1
'1
'1
'1
SSOSSS
CSCSC
SS
SSSSSSorSSS
SSSJSC ij
0'1
'1
'1
'1
'1 ))(()(
Now we got S1’, evaluate our constraints Ci(S1
’), if equal to 0, we are done but most likely it will not evaluate to 0 in the first several steps.
So, let’s say Ci(S1’) ≠ 0, let’s apply Taylor series expansion on
the constraint function Ci(S) at point S1’ :
1001 SSsoSSSS
Then we will continue with step one and step two until we got a solution Sn which minimizes our object function and also satisfies our constraints.
Set equal to 0 Omit
S0 S1’ S1 S2
’ S2 … Sn
S is the change to S0 that makes derivative equal to 0
11
Graphical Explanation of SQP
S0 S1’
S1S2’ S2
C(S)
S
R
S
12
13
Homework
Spacetime Particle (2D version)
15
Discretize unknown function x(t) and f(t) as:
x1, x2, …xi, … xn-1, xn
f1, f2, …fi, … fn-1, fn
Our goal is to solve these discretized 2n values… x1xn satisfies goals while optimizing f1fn
1n
i
Discretize, (xi,fi) as variables, minimize sum of fi.fiFormulate as constrained optimization.