Graphics Reference
In-Depth Information
x ( t )= x ( 0 )+ t
0
x ( 0 )+ s
0
x ( 0 ) dr ds
(35.33)
= x ( 0 )+ t
0
( x ( 0 )+ x ( 0 ) s ) ds
(35.34)
= x ( 0 )+ x ( 0 ) t + 1
2 x ( 0 ) t 2
(35.35)
= x ( 0 )+ x ( 0 ) t + 1
2
f ( 0, x ( 0 ) , x ( 0 ))
m
t 2
(35.36)
Thus far, we haven't advanced over the original analytic solution, since we
could always evaluate the integral when acceleration is constant. But we can now
generalize this result. Assume that f is only constant for each time interval from
t i to t i + 1 of duration Δ t , but may change between intervals. Acceleration is now
only piecewise constant over time, which is a much better approximation of the
real world.
Under this assumption, we can rework Equation 35.36 to advance a known
state described by x ( t 1 ) and x ( t 1 ) at the beginning of the time interval to the state
at the end of the time interval under constant acceleration:
x ( t 2 )= x ( t 1 )+ x ( t 1 t + 1
2
f ( t 1 , x ( t 1 ) , x ( t 1 ))
m
Δ t 2
(35.37)
x ( t 2 )= x ( t 1 )+ f ( t 1 , x ( t 1 ) , x ( t 1 ))
m
Δ t
(35.38)
(for constant force on the interval). This is Heun-Euler integration, also known
as Heun integration or Improved Euler integration (it is distinct from just
“Euler” integration, described in Section 35.6.7.1).
Nothing in these equations assumes a specific number of spatial dimensions,
so they hold equally well for the common cases of 1D, 2D, or 3D particles. In fact,
we can generalize even further. Rather than limiting x to describing the motion of a
single particle, we can pack the positions of multiple particles into x ( t ) by simply
treating them as separate dimensions. We'll later generalize this even further and
encode orientation for bodies with volume in the same vector.
This integration scheme is by no means perfect, but it is often good enough.
If the animation doesn't look right or is unstable, you can often reduce the time
interval and the quality will improve. This is because in the limit as Δ t
0sthe
Heun-Euler's estimate approaches the true integral of any arbitrary (integrable)
force function. For systems with large or high-frequency forces, you may have
to make Δ t so small to ensure stability that the simulation becomes quite com-
putationally intense. Section 35.6.6 discusses integration schemes that are more
efficient than Heun-Euler for such scenarios.
35.6.4 Models of Common Forces
There are fundamental and derived forces. Fundamental forces such as gravity
and electrical force are the elements of the standard physics model and cannot be
simplified to the interaction of other forces under that model. Derived forces such
as buoyancy are a method for abstracting many microscopic forces into a simple
high-level model for macroscopic behavior.
 
Search WWH ::




Custom Search