MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Week 2 : Dynamics & Numerical Methods Goal : To write a simple physics simulation Topics: Intro.

Slides:



Advertisements
Similar presentations
AP Physics C Mechanics Review.
Advertisements

AP C UNIT 3 WORK & ENERGY.
Numeric Integration Methods Jim Van Verth Red Storm Entertainment
Work Done by a Constant Force
Ch 3.8: Mechanical & Electrical Vibrations
Integration Techniques
Fall Final Review WKS: WORD PROBLEMS Part II. 1. A car travels at a constant speed of 15 m/s for 10 seconds. How far did it go?
Chaper 15, Oscillation Simple Harmonic Motion (SHM)
Springs And pendula, and energy. Spring Constants SpringkUnits Small Spring Long Spring Medium spring 2 in series 2 in parallel 3 in series 3 in parallel.
Chapter 14 Oscillations Chapter Opener. Caption: An object attached to a coil spring can exhibit oscillatory motion. Many kinds of oscillatory motion are.
Oscillation.
Mechanical Energy and Simple Harmonic Oscillator 8.01 Week 09D
Simple Harmonic Motion
Oscillations Phys101 Lectures 28, 29 Key points:
Springs And pendula, and energy. Harmonic Motion Pendula and springs are examples of things that go through simple harmonic motion. Simple harmonic motion.
Simple Harmonic Motion
Physics 2.2.
Newton’s Third Law of Motion
Spring Topic Outline for Physics 1 Spring 2011.
JEOPARDY REVIEW Subterm 1.
Copyright © Cengage Learning. All rights reserved. 5 Applications of Integration.
Dynamics. Chapter 1 Introduction to Dynamics What is Dynamics? Dynamics is the study of systems in which the motion of the object is changing (accelerating)
Game Physics – Part I Dan Fleck Coming up: Rigid Body Dynamics.
Newton’s Law of Gravitation. Newton concluded that gravity was a force that acts through even great distances Newton did calculations on the a r of the.
Give the expression for the velocity of an object rolling down an incline without slipping in terms of h (height), M(mass), g, I (Moment of inertia) and.
Kinetic Energy, Work, Power, and Potential Energy
Physics 3.3. Work WWWWork is defined as Force in the direction of motion x the distance moved. WWWWork is also defined as the change in total.
Chapter 13 SHM? WOD are underlined. Remember Hooke’s Law F = - k Δx New Symbol: “k” Spring constant. “Stiffness” of the spring. Depends on each spring’s.
Simple Harmonic Motion
Simple Harmonic Motion
Simple Harmonic Motion
Motion Revision Quiz questions. Round 1 1.Which of the following is a scalar measurement? displacement distance velocity.
Chapter 4 Dynamics: Newton’s Laws of Motion
Forces & Newton’s Laws Ch. 4. Forces What is a force? –Push or pull one body exerts on another –Units = Newton (N) –Examples: List all of the forces that.
Equation of Motion for a Particle Sect nd Law (time independent mass): F = (dp/dt) = [d(mv)/dt] = m(dv/dt) = ma = m(d 2 r/dt 2 ) = m r (1) A 2.
Scientific Computing Numerical Solution Of Ordinary Differential Equations - Euler’s Method.
Copyright © 2009 Pearson Education, Inc. Chapter 14 Oscillations.
Equilibrium Forces and Unbalanced Forces. Topic Overview A force is a push or a pull applied to an object. A net Force (F net ) is the sum of all the.
Copyright © 2009 Pearson Education, Inc. Oscillations of a Spring Simple Harmonic Motion Energy in the Simple Harmonic Oscillator The Simple Pendulum Lecture.
When a weight is added to a spring and stretched, the released spring will follow a back and forth motion.
Chapter 8 Potential Energy. Potential energy is the energy associated with the configuration of a system of objects that exert forces on each other This.
Potential Energy ~March 1, 2006.
Advanced Computer Graphics Rigid Body Simulation Spring 2002 Professor Brogan.
Wednesday, Nov. 19, 2003PHYS , Fall 2003 Dr. Jaehoon Yu 1 PHYS 1443 – Section 003 Lecture #21 Wednesday, Nov. 19, 2003 Dr. Mystery Lecturer 1.Fluid.
Simple Harmonic Motion. Restoring Forces in Spring  F=-kx  This implies that when a spring is compressed or elongated, there is a force that tries to.
Chapter 15 Oscillations. Periodic motion Periodic (harmonic) motion – self-repeating motion Oscillation – periodic motion in certain direction Period.
Proportionality between the velocity V and radius r
When a weight is added to a spring and stretched, the released spring will follow a back and forth motion.
Periodic Motions.
Motion I Kinematics and Newton’s Laws Basic Quantities to Describe Motion Motion is about Space (position) and Time (duration) and how we change position.
Game Technology Animation V Generate motion of objects using numerical simulation methods Physically Based Animation.
Spring 2002 Lecture #18 Dr. Jaehoon Yu 1.Simple Harmonic Motion 2.Energy of the Simple Harmonic Oscillator 3.The Pendulum Today’s Homework Assignment.
Physics In Motion 1-D Kinematics Aristotle’s Notion of Motion  All objects will remain at rest unless an external force is acted upon them. If an.
Work Done by a Constant Force The work done by a constant force is defined as the distance moved multiplied by the component of the force in the direction.
SHM – Types of Pendulums AP Physics. Pendulum Simple Physical/Compound  Oscillates due to gravity  Mass of pendulum bob is irrelevant  Oscillates due.
PHY 151: Lecture Motion of an Object attached to a Spring 12.2 Particle in Simple Harmonic Motion 12.3 Energy of the Simple Harmonic Oscillator.
Chapter 13: Oscillatory Motion
Advanced Computer Graphics Rigid Body Simulation
Copyright © Cengage Learning. All rights reserved.
Springs And pendula, and energy.
Periodic Motion Oscillations: Stable Equilibrium: U  ½kx2 F  kx
PHYS 1443 – Section 003 Lecture #21
Oscillations Readings: Chapter 14.
Chapter 15 Oscillations.
Oscillatory Motion Periodic motion Spring-mass system
PHYS 1443 – Section 003 Lecture #19
Periodic Motion Oscillations: Stable Equilibrium: U  ½kx2 F  -kx
Copyright © Cengage Learning. All rights reserved.
Simple Harmonic Motion and Wave Interactions
PHYS 1443 – Section 501 Lecture #25
Presentation transcript:

MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Week 2 : Dynamics & Numerical Methods Goal : To write a simple physics simulation Topics: Intro to ODEs, numerical methods for solving differential equations (using Euler Step, Runge-Kutta, Verlet Integration), 1D spring simulation, Particle Systems, cloth simulation, spring-graph layout.

MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Dynamics Dynamics is the study of the effects of forces on the motion of objects. In particular, a dynamic system models the time evolution of a physical process. The process is generally governed by a set of intertwined equations for the relevant forces, such as gravity, velocity, acceleration, friction, wind resistance, angular momentum, etc. The time variable is the “independent” variable, and the other variables are “dependent” variables that change with time...

MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Simple Examples Dropping a rock off of a cliff: need to model gravity, center of balance, air resistance, wind velocity Pushing an object along a surface: gravity, friction of object, friction of surface, angle of incline of surface, initial force Firing a cannonball: initial velocity, gravity, wind resistance, etc Stretching and then letting go of a spring: Spring elasticity/stiffness (spring constant), initial displacement position, dampening factor (so it doesn’t spring forever)

MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Simple Example #1: Gravity Dropping a rock off of a cliff: need to model gravity, other forces are less important Force = mass * acceleration Gravitational force = (G * m1 * m2) / r 2 Where G = the gravitational constant, m1 = the mass of the rock m2 = the mass of the earth r = the distance from the center of the rock to the center of the earth

MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Simple Example #1: Gravity Then we can solve for the acceleration of the rock: F G = m 1 a = Gm 1 m 2 /r 2 and m 1 cancels out, leaving: a = Gm 2 / r 2 Plugging in the gravitational constant and using the average radius of the earth, we get an approximate value for a = 9.81m / s 2

MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Simple Example #1: Gravity Knowing the initial position (the height) and the constant acceleration due to the gravitational force, we can use the appropriate kinematic equation to calculate the position of the rock at any time between when we first drop it and when we let it go. We of course have a “boundary condition” where we stop calculating when the rock hits the earth. p t = p i + v i - ½(at 2 ) Kinematic equation For instance, if we simply drop the rock from 100 meters, then after 3 seconds the rock is: (0) -.5(9.81 * 3 2 ) = meters above the earth.

MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Simple example #2: Spring Stretching and then letting go of a spring: need to model spring elasticity/stiffness (spring constant), initial displacement position, dampening factor (so it doesn’t spring forever) Force = mass * acceleration Spring force = -k(p 1 - p 0 ) – cv (Hooke’s Law) Where k = the stiffness of the spring (based on the structural properties of the spring) p 0 = the length of the spring at its equilibrium positions (at rest) p 1 = the length of the spring when being stretched c = a damping constant which models the reduction of velocity over time v = the velocity

MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Simple example #2: Spring Lets call the stretch distance x, so that our force equation is: Spring force = -kx – cv F = ma a is the second derivative of the position, x so, ma = -kx – cv or, a = -k/m * x – c/m * v

MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Simple example #2: Spring or, a = k/m * x – c/m * v Now there happens to be an analytical solution to this, but instead we are going to use a numerical method to approximate it. In order to solve a 2 nd order differential equation we need to split it into a series of 1 st order equations dy/dt = v dv/dt = −(k⁄m) * y − (c⁄m) * v = a That is, the change in position is based on the velocity, and the velocity is based on the acceleration.

MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Differential Equations The spring system is what’s called an Ordinary Differential Equation, or ODE. Differential equations calculate the change in some quantity in relationship to another quantity. In this case we are calculating the change in position with respect to time as well as the change in velocity with respect to time.

MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Differential Equations How can we calculate the position of the spring? Start with an initial condition for the position: eg, y = -10 Use our equations to determine the position after a small increment of time. The change in position is based on the velocity, and the velocity is based on the acceleration. So we need to solve for the acceleration and the velocity “simultaneously”, that is, before we can update the position.

MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Euler’s Step y n+1 = y n + hf(t n, y n ) Where y n is our current position h is our time step and f(t n, y n ) is our system of differential equations which solve the spring velocity for a particular y position and a particular time. (draw example on board)

MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Euler’s Step Has problems Expects the derivative at the current point is a good estimate of the derivative on the interval Approximation can drift off the actual function – adds energy to system! Worse farther from known values Especially bad when the system oscillates (springs, orbits, pendulums or when the time step gets large. Lousy for forces dependant on position Okay for forces dependant on velocity Bad for constant forces

MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Runge-Kutta methods idea is to take samples from nearby the original points (t, y) and average the velocity derivates together. RK2 takes 2 samples... RK4 takes 4 samples... taking more samples doesn’t significantly increase accuracy (at least not for our spring simulation) RK4: y n+1 = y n + 1/6(k 1 + 2k 2 + 2k 3 + k 4 ) Where: k 1 = hf(t n, y n ) k 2 = hf(t n + h/2, y n + k 1 /2) k 3 = hf(t n + h/2, y n + k 2 /2) k 4 = hf(t n + h, y n + k 3 ) (draw on board)

MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Runge-Kutta methods RK4 works better for larger time steps Tends to dampen energy Expensive – requires many evaluations per time step Okay for forces dependant on position Okay for forces dependant on velocity Great for constant forces

MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Verlet Integration Given y n and v n First calculate y 1 = y 0 + hv 0 (Euler step) thereafter, use y n+1 = 2y n – y n-1 + h 2 /m f(t n, y n ) Where: m = mass of the object the verlet equation doesn’t require keeping track of the velocity

MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Verlet Integration Velocity-less scheme originally developed by Newton and first used in molecular dynamics Uses position from previous time step Very stable, but velocity estimated so potentially inaccurate Good for particle systems Better for forces dependant on position (particles) Okay for forces dependant on velocity (friction, springs, etc)

MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Comparison see demos for comparison of numerical methods... code examples online...