Home
Code-Blog
Projects
Twitter
Blog
Links / Books
About
|
Websites |
Kinect Animations
Nowadays is very common to find inertia animations
This article will show the equations to simulate ->
v0, x0 |
.--.
.----' m '--. /\/\/\--| spring
'-()-----()-' ----]===| damper
----------------------------------------------
|
xborder
Equations
A body sliding on a floor will be by effect of a
We are not considering the effect of air, because we
Because the force of the kinetic friction is
(The acceleration will have the opposite sign of
For this simulation we can specify the acceleration
The equations of this movement are: 2
a t
#1 x(t) = x0 + v0 t + ----
2
#2 v(t) = v0 + a t
Where: v(t) : velocity x(t) : position x0 : initial position v0 : initial velocity a : acceleration t : time Some other results are useful: When does it stop? (tstop)v(t) = v0 + a t
0 = v0 + a t
v0
tstop = - ---
a
Where does it stop? (xstop)Replace t by tstop in #1
2
v0
xstop = x0 - ----
2a
If xstop is before the xborder it means the page When collision occurs? (tborder)
if xstop > xborder it means we will have collision To find out when the collision occurs we solve for t in equation #1 2
a t
xborder = x0 + v0 t + -----
2
solving for t give us: ----------------------------
+ | 2
v0 - \| V0 - 2 a (x0 + xborder)
tborder = -------------------------------------
a
We have two solutions. The correct solution is when
This solution must exist when xstop > xborder so be
What is the speed on collision ? (vborder)Replace tborder in #2 vborder = v0 + a tborder What will happen after collision?
We use a spring and damper to stop the page. Force = m x'' spring force = -k x damper force = -b x' Then the equation is: x'' + b x' + k x = 0 Dividing by m b k
x'' + --- x'+ --- x = 0
m m
Where: k : spring constant b : viscous damping coefficient m : mass x : x(t) position x' : v(t) velocity x'' : a(t) acceleration The following parameters are then defined: -------
| k
w0 = | ---
\| m
w0 is called the natural frequency of the system b
Z = --------
------
2 \| m k
The second parameter, Z, is called the damping The differential equation now becomes 2 x'' + 2 Z w0 x' + w0 x = 0
The value of Z determines the behavior of the
When Z = 1, the system is said to be critically
When Z > 1, the system is over-damped. An over-damped
Finally, when 0 <= Z < 1, the system is under-
damped.
The system we will choose is critically damped. It The solution for this system (z = 1) is: -w0 t x(t) = e (C1 + C2 t) C1 = x(0) C2 = x'(0) + w0 x(0) x'(0) = v(0) = vborder Putting all together
Given the initial velocty v0, initial position x0, (a, m, k will be constants) In case of no collision:From t = 0 to t < tstop. 2
a t
#1 x(t) = x0 + v0 t + ----
2
Before and After collision
The page started before the border ant hit the From t = 0 to t < tborder. 2
a t
#1 x(t) = x0 + v0 t + ----
2
After tborder -w0 t
x(t) = e (C1 + C2 t)
C1 = x(0)
C2 = vborder + w0 x(0)
------
| k
w0 = | ---
\| m
The system of coordinates is in the border in this Some criteria to stop is missing here. After the border x0 > xborder
The page started after the border.
-w0 t
x(t) = e (C1 + C2 t)
C1 = x(0)
C2 = v0 + w0 C1
-------
| k
w0 = | ----
\| m
The system of coordinates is at xborder. Details
Some details are missing to create a complete
Please note the system of coordinates moved in the Referenceshttp://en.wikipedia.org/wiki/Damping History
Appendix
Using the same equations we can solve the following The view is fixed and the page moves.
In this case the aceleration will have two
_________________
| ________ |
| | | |
|/\/\/ | | | | /\/\/\| spring
|===[-- | |View | | --]===| damper
| |________| |
|_________________|
Page
_________________
|________ |
| | |
|/\/\/ | | |/\/\/\| spring
|===[-- |View | |--]===| damper
|________| |
|_________________|
Page
_________________
| ________|
| | |
|/\/\/\| | | /\/\/\| spring
|===[--| | View | --]===| damper
| |________|
|_________________|
Page
|