📄 http:^^www.tc.cornell.edu^visualization^education^cs417^sections^dynamics.html
字号:
toward body one from body two. <p>Converting to a Cartesian form the acceleration of body one is:<p><!WA11><!WA11><!WA11><!WA11><img src="http://www.tc.cornell.edu/Visualization/Education/cs417/SECTIONS/dynamics.eqn.gravvector.gif"> <p>where the vectors<p><!WA12><!WA12><!WA12><!WA12><img src="http://www.tc.cornell.edu/Visualization/Education/cs417/SECTIONS/dynamics.eqn.gravra.gif"> <p>The calculation procedure for each time step is to compute:<ol><li> the acceleration, a, based on the positions at time n-1<li> a new set of positions using the Verlet method<li> the acceleration at time n based on the newly computed positions <li> a new velocity from the Verlet methodusing the acclerations at times n-1 and n.</ol>For the gravitational animation given at the beginning of this page,three masses were simulated. The accleration of each mass was determinedas the vector sum of the accelerations caused by each of the other twobodies.<hr><b> Water Waves </b> <p>The water wave solver presented here is based on the derivation in Kass and Miller [2] for the case of shallow water, low amplitude, non-breakingwaves. The form of the resulting equation of motion for the waves lookslike the classical linear wave equation with a propagation velocityproportional to the depth of the water.<p><!WA13><!WA13><!WA13><!WA13><img src="http://www.tc.cornell.edu/Visualization/Education/cs417/SECTIONS/dynamics.eqn.water.gif"><p>where h is the height of the water surface and d is the depth, that is,d(x,y) = h(x,y)-b(x,y)where b is the vertical position of the containing vessel (or oceanbottom) at (x,y). The costant g is poroportional to the force ofgravity. This partial differential equation can be discretizedin many ways. We will use a method which is stable enough to beacceptable for computer graphics. <p>First note that the partial with respect to time is the accelerationof a small surface element of water, sothat if the right side of the equation can be put in a discrete form wecan apply the Verlet method to a 2D grid of "bodies", each representinga small chunk of water.<p>To solve this equation numerically we need to discretize it both inspace, on a two dimensional grid, and in time. The discrete spatialapproximation is that the second derivitives (at time n) are <p><!WA14><!WA14><!WA14><!WA14><img src="http://www.tc.cornell.edu/Visualization/Education/cs417/SECTIONS/dynamics.eqn.waterpartials.gif"><p>were i and j are the grid indices in the x and y directions and n is thetime index. Note that at the edges of the array the discrete partialderivitives depend on values outside the array. These boundaryconditions need to be specified for a solution. One easy boundary condition,corresponding to no transport across the coundary, is to copy the valueat the edge of the array whenever a value outside the array is needed.<p>It seems that the solution is more stable if the minimum depth of thewater is limited to about .001 of the average value, rather than lettingit go to zero. Sothe depth at time n is given by <p><!WA15><!WA15><!WA15><!WA15><img src="http://www.tc.cornell.edu/Visualization/Education/cs417/SECTIONS/dynamics.eqn.watergetd.gif"><p>To get the surface motion, first assign an initial height and verticalvelocity to each grid point (i,j) then at each time step compute :<ol><li> the acceleration, a, based on the water heights at time n-1 <p><!WA16><!WA16><!WA16><!WA16><img src="http://www.tc.cornell.edu/Visualization/Education/cs417/SECTIONS/dynamics.eqn.watertm1.gif"> <p><li> a new set of positions using the Verlet method for each (i,j)<li> the acceleration at time n based on the newly computed heights <p><!WA17><!WA17><!WA17><!WA17><img src="http://www.tc.cornell.edu/Visualization/Education/cs417/SECTIONS/dynamics.eqn.watert.gif"><p><li> a new velocity from the Verlet method for each (i,j)<li> Ensure conservation of volume of the total volume by adjusting theaverage water height to a constant. That is, sum all the heights over thewhole grid, then correct the sum to equal the initial sumby adding a small increment to each grid location (i,j).</ol>These steps are repeated to generate moving waves. <p>Disclaimer: While thisintegration method seems to give visually reasonable results, it should notbe used for analytical simulations without careful validation. The waveequation is notoriously hard to integrate using explicit techniques, likethe one described here.<p><hr><b> Billards </b> <p>A billards, hard ball, system is different than the other two systemsjust described because the forces between balls are zero until theytouch and become very large if the balls try to pass through each other.This means that there is a large, impulsive force just when the ballsmeet and at no other times. The Verlet integration scheme will failbadly on this system because the accelerations are large for a shorttime and thus not smooth enough to average. What we will do to step thebillards system forward in time is to calculate the total change in velocity froma collision, without worrying exactly how forces change the velocity.<p>The method described here is a less exact version of that described in[4]. The method described in the paper steps time at uneven intervals,and is thus unsuitable for animation. My modification steps timeuniformly, at the expense of exact collision dynamics.<p>The change in velocity during impact can be derived for frictionlessballs of equal mass by noting that the the impact force must act in adirection parallel to the line connecting the centers of thetwo impacting balls. The change in velocity must be parallel to the connecting line also, with the velocity component parallel to the line having its sign reversed by the collision and the velocitycomponent perpendicular to the line unchanged. Projecting the initialvelocity onto the line connecting the centers, negating the result, andresolving it back into x and y velocity components gives the velocitychange. If i and j are the indices of the colliding balls define:<p><!WA18><!WA18><!WA18><!WA18><img src="http://www.tc.cornell.edu/Visualization/Education/cs417/SECTIONS/dynamics.eqn.billardsdiff.gif"> <p>then delta v for ball i is given by the following where the right-most termrepresents the projection of the velocity onto the line and the otherterm converts the projection back to x,y coordinates. <p> <!WA19><!WA19><!WA19><!WA19><img src="http://www.tc.cornell.edu/Visualization/Education/cs417/SECTIONS/dynamics.eqn.billards.gif"> <p>The calculation procedure for each time step is to compute:<ol><li> the delta v based on the positions of the balls<li> a new set of positions using <p><!WA20><!WA20><!WA20><!WA20><img src="http://www.tc.cornell.edu/Visualization/Education/cs417/SECTIONS/dynamics.eqn.billardsnew.gif"><p><li> if walls are present detect collisions and modify velocities.</ol>The time step needs to be small enough so that the balls do notpenetrate each other too much during one time step.<hr><b> References </b> <p><ol><li> <i>An Introduction to Computer Simulation Methods, Part 1,</i> by HarveyGould and Jan Tobochnik, Addison-Wesley, 1988 <p><li> <i> Rapid, Stable Fluid dynamics for Computer Graphics, </i>by Micheal Kass and Gavin Miller, Computer Graphics, Vol 24 #4, Aug 1990,pp 49-55 <p><li> <i> Numerical Recipes,</i> by William Press, Saul Teukolsky,William Vetterling and Brian Flannery, Cambrige, 2nd edition, 1992 <P><li><i>Studies in Molecular Dynamics. I. General Method,</i> by B. Alderand T. Wainwright, Journal of Chemical Physics, Vol 31 #2, Aug 1959,pp 459-466 <p><li> <i> Physics for students of science and engineering, Part 1,</i> byRobert Resnick and David Halliday, Wiley, 1963. <p></ol><hr>Comments about Theory Center online documents are welcome and may be sent to<i>doc-comments@tc.cornell.edu</i>. <p>Last modified, 10/12/95 B. Land. <! Revision history: Original document: B Land.><p><!WA21><!WA21><!WA21><!WA21><iMG SRC="http://www.tc.cornell.edu/copyright.xbm"><!WA22><!WA22><!WA22><!WA22><A HREF="http://www.tc.cornell.edu/ctcCopyright.html"> <i>Copyright Statement </I></A></body> </html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -