8.4. UPDATING CONTROL FORCES 81
After grouping terms together, we find that, in the backward simulation, we will have to
solve a system of the form Ax D b in order to compute the adjoint velocities
O
v
n
. e system is
as follows:
M h
@f
@v
T
h
2
@f
@x
T
!
O
v
n
D
M
O
v
nC1
C
@
@v
n
T
C h
O
x
nC1
C h
@
@x
n
T
!
:
(8.10)
e right-hand side contains all known quantities. is means that it can just be computed
at every time step. One remarkable thing about this adjoint computation is that the left-hand side
of this system is exactly the same one as used in the forward simulation at the corresponding time
step. If you’re not sure about this, go ahead and look back to the chapter on implicit integration.
We can just save this matrix at every time step in the forward simulation and then use it again
for the backward simulation.
Not that much extra work. Just a little bit of extra storage. Well, by now you should know
that these matrices are big and having to save one for every time step will require a significant
amount of computer memory. is too will have a significant impact on performance. is trade-
off between less computation requirements but more storage needs is typical for adjoint methods.
Before starting a backward simulation, we will have to initialize the final adjoint states.
Initialization is done using
Oq
N
D
@
@q
N
T
:
(8.11)
ese states
@
@x
N
and
@
@v
N
equal x
N
x
N
and v
N
v
N
multiplied by their respective
goal function weights.
After solving this system, the adjoint velocities
O
v
n
are known and we can compute the
adjoint positions
O
x
n
using Equation (8.9). Again, we use the same Jacobian matrix
@f
@x
that we
saved in the corresponding step in the forward simulation.
8.4 UPDATING CONTROL FORCES
After solving the system to obtain the adjoint velocities, the adjoint positions can easily be com-
puted using Equation (8.9). Given these adjoint states, the gradient vector is computed using
the Formula (8.4).
82 8. CONTROLLING CLOTH SIMULATIONS
In Wojtan et al. [2006], a force is computed for every single particle for every single time
step. Typically, a simulation has to take multiple time steps in order to advance one frame. In
our experiments, we have found that applying the same control force per particle over all time
steps needed to advance the simulation one frame produces much better results.
In theory, this would make the approach less expressive. But, we have found that the re-
duced dimensionality of the control space significantly outweighs this reduced expressive power
because of faster convergence and smoother results. is is achieved by accumulating the con-
tributions of all the sub-steps to the corresponding frame.
e control forces are applied to the particles and explicitly integrated into the simulation.
Only considering the contribution of the control force, we have
v
n
D v
n
C hM
1
u
n
:
(8.12)
For a single cloth particle,
@F
@u
2 R
6P 3P
maps the R
3P
control vector back to the R
6P
state
space. For a single particle p we have
@F
@u
D
2
6
6
6
6
6
6
6
6
4
0 0 0
0 0 0
0 0 0
h
m
p
0 0
0
h
m
p
0
0 0
h
m
p
3
7
7
7
7
7
7
7
7
5
; (8.13)
with m
p
the mass of particle p on which the force is being applied to. Finally, the formula that
computes the gradient for particle p is thus given by
d
d u
p;n
D
h
m
p
Ov
p;n
C ˛
n
h
m
p
u
p;n
:
(8.14)
e negative gradient can then be used to obtain an updated estimate of the control forces.
e Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm or line search can be used to find
a good step size ı. We refer to Nocedal and Wright [1999] for an in-depth explanation of these
techniques. is step size computation is needed since the gradient just points in the direction
of steepest ascent. We still have to figure out how far along this direction we’d like our update
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset