6.4. SOLVING THE NONLINEAR ACTUATIONS 49
the following holds:
hv
n
D x
n
x
n1
hv
nC1
D x
nC1
x
n
:
(6.4)
If we multiply the velocity update in Equation (6.3) with the time step h, we find hv
nC1
D
hv
n
C h
2
M
1
f
nC1
. Plugging in the equalities from Equation (6.4), we find
x
nC1
x
n
D x
n
x
n1
C h
2
M
1
f
nC1
, x
nC1
2x
n
C x
n1
D h
2
M
1
f
nC1
:
(6.5)
e left-hand side is now actually the finite differences expression for the second derivative
of x. It should be very clear by now that if we bring the h
2
and mass term to the left-hand side,
we have nothing else than Newtons second law of motion again. For clarity, lets group the
known terms so it will be easier to see that we are trying to compute the next particle state x
nC1
.
Lets define y D 2x
n
x
n1
. To keep things simple, we will just write x to mean x
nC1
. Putting
this all together, we have
x y D h
2
M
1
f
.
x
/
:
(6.6)
It might seem like the grouping of the terms in y is arbitrary. However, we can see some
physical interpretation for this term. It will become very clear if we write it as follows:
y D 2x
n
x
n1
D x
n
C
.
x
n
x
n1
/
D
x
n
C hv
n
:
(6.7)
is is exactly where the positions of all the particles would move in the absence of forces
using an explicit Euler step. In essence, this is Newtons first law: if there are no forces acting on
the system, then the system will just keep moving with the current velocities. is is visualized
in Figure
6.1 and is called inertia. erefore,
y
is sometimes referred to as the inertia term. Now,
of course, in our system there are forces so we’ll have to take these into account.
6.4 SOLVING THE NONLINEAR ACTUATIONS
From the previous subsection we found the following system of nonlinear actuations where we
have R
3N
vectors on both side of the equation. e nonlinearity comes from the force term.
50 6. SIMULATION AS AN OPTIMIZATION PROBLEM
x
0
x
1
x
2
v
0
v
1
v
2
z
y
x
n
n
n
x
0
n+1
x
2
n+1
x
1
n+1
Figure 6.1: Visualization of the inertia update not taking into account the internal and external
forces acting on the cloth.
Multiplying Equation (6.6) with the mass matrix M, we find
M
.
x y
/
D h
2
f
.
x
/
:
(6.8)
Now here comes an important realization. Solving Equation (6.8) is equivalent to finding
the critical points for which
@g
.
x
/
@x
D 0 of the following function:
g
.
x
/
W R
3N
! R
g
.
x
/
D
1
2
.
x y
/
T
M
.
x y
/
C h
2
E.x/:
(6.9)
is is obvious since setting the gradient of g.x/ to zero will give us Equation (6.8) again—
Remember that
@E.x/
@x
D
f
.
x
/
.
We know that critical points correspond to local minima or maxima of a function. Using
this information we can reformulate the system in Equation (6.8) as
argmin
x
g
.
x
/
:
(6.10)
..................Content has been hidden....................

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