Time Line For An Object. Physics According to Verlet. Euler Integration. Computing Position. Implementation. Example 11/8/2011.

Size: px
Start display at page:

Download "Time Line For An Object. Physics According to Verlet. Euler Integration. Computing Position. Implementation. Example 11/8/2011."

Transcription

1 Time Line For An Object Physics According to Verlet Ian Parberry Frame Number: Acceleration Velocity Position Acceleration Velocity Position Δ Acceleration Velocity Position Now Computing Position Suppose we know,, and. Let Δ be the duration of the previous frame. Then Δ is our best guess for the duration of the current frame (which isn t over yet). We can compute and like this: Δ Δ Euler Integration This corresponds to Euler integration. Instead of integrating the curve, we are summing over discrete time slices. 3 4 Implementation We implement this by storing each object s position, velocity, acceleration, and last move time. D3DXVECTOR3 m_vp; //position D3DXVECTOR3 m_vv; //velocity D3DXVECTOR3 m_va; //acceleration int m_nlastmovetime; //time of last move We then update position and velocity once per frame. int t = timegettime(); //current time in msec int dt = t - m_nlastmovetime; //frame time m_vp += m_vv * dt; //update position m_vv += m_va * dt; //update velocity m_nlastmovetime = t; //update time Example An object starts at rest and accelerates at 10 m/sec for 5 seconds. Where does it end up at the end of the 5 seconds? / m 315m 5 6 1

2 Velocity as a Function of Time But in a Game? We compute the distance moved in each frame and accumulate all those distances to get the total distances. We have to assume that the velocity is constant within each frame. We end up with the following set of distances, which is too large 7 8 Velocity as a Discrete Function of Time 9 10 Verlet Integration Loup Verlet, 1951 Developed the concept that is now called Verlet integration for use in particle physics simulation. Why Do We Care? There are mathematical reasons for using Verlet integration instead of Euler integration when simulating real particle systems. But what about in games? We don t care so much about reality. One useful feature of Verlet integration is that it is easy to incorporate constraints, for example, to fix lengths and angles. This means that Verlet integration makes it easier to code soft body animation including cloth and ragdoll. 11 1

3 Verlet s Thinking Suppose we know,, and and want to compute. Let Δ, the amount moved in the previous frame. Start by considering Δ, the amount to be moved in the current frame. We know that Δ Δ Δ / Now, Δ is a good approximation for Δ. Therefore, substituting for Δ: Δ Δ Δ / Verlet s Thinking The story so far: Δ Δ Δ / Since Δ, substituting for Δ : Δ Δ / Substituting for Δ we get Δ / Equivalently, Δ / Summary What does the resulting equation mean? Δ /. It shows us how to compute given,,, and Δ. Notice that there is no need to store velocity. We can even fake a type of friction by using Δ /. Implementation We implement this by storing each object s position, velocity, acceleration, and last move time. D3DXVECTOR3 m_vp; //position D3DXVECTOR3 m_voldp; //previous position D3DXVECTOR3 m_va; //acceleration int m_nlastmovetime; //time of last move We then update location once per frame. int t = timegettime(); //current time in millisec int dt = t - m_nlastmovetime; //frame time D3DXVECTOR3 vtemp = m_vp; //save m_vp += m_vp - m_voldp + m_va*dt*dt/.0f; //update m_voldp = vtemp; //remember m_nlastmovetime = t; //update time Optimization Assume dt is constant. In fact, make it 1. D3DXVECTOR3 m_vp; //position D3DXVECTOR3 m_voldp; //previous position D3DXVECTOR3 m_va; //acceleration Even better, ignore the divide by. Ramp the acceleration down to compensate if you need to. D3DXVECTOR3 vtemp = m_vp; //save m_vp += m_vp - m_voldp + m_va; //update m_voldp = vtemp; //remember But, But, But But 1. However, we can repeat this code many times per frame. For example, const int ITERATIONS = 4; //Why 4? Why not. D3DXVECTOR3 vtemp; for(int i=0; i<iterations; i++){ vtemp = m_vp; //save m_vp += m_vp - m_voldp + m_va; //update m_voldp = vtemp; //remember

4 Implementation Store each object s position, acceleration, and last move time. D3DXVECTOR3 m_vp, m_voldp, m_va; //as before int m_nlastmovetime; //time of last move We then update position multiple times per frame. int t = timegettime(); //current time in millisec int dt = t - m_nlastmovetime; //frame time Now, dt is typically in the range of tens of milliseconds. D3DXVECTOR3 vtemp; for(int i=0; i<dt; i++){ vtemp = m_vp; //save m_vp += m_vp - m_voldp + m_va; //update m_voldp = vtemp; //remember m_nlastmovetime = t; //update time Satisfying Constraints We mentioned earlier that Verlet integration makes it easy to enforce constraints on the particles. For example, let s model a stick by applying Verlet integration to two particles at the ends of the stick. The constraint is that the distance between the particles must remain constant. We move the particles at the ends of the stick independently, then try to fix their positions before rendering if they are the wrong distance apart A Sticky Situation m_vp1 flen Suppose its ends are at positions m_vp1 and m_vp, and it is supposed to have length LEN. const float LEN = 4.0f D3DXVECTOR3 m_vp1, m_vp; First we get a vector vstick along the stick and find its length flen. D3DXVECTOR3 vstick = m_vp1 - m_vp; float m_vp A Sticky Situation m_vp1 LEN flen Then we find the difference between the stick now and what it should be. We split the difference between the two ends. m_vp1 += 0.5f * vstick; m_vp -= 0.5f * vstick; So far, so good. m_vp 1 One Stick Summary Declarations: D3DXVECTOR3 vstick; float flen; Code: vstick = m_vp1 - m_vp; m_vp1 += 0.5f * vstick; m_vp -= 0.5f * vstick; Remember this code. We ll use it again 3 slides from now Two Sticks But what if we ve got sticks joined at the ends? m_vp3 m_vp3 m_vp1 m_vp m_vp1 m_vp Satisfying one constraint may violate the other. m_vp3 m_vp1 m_vp 3 4 4

5 Declarations Using the same declarations as before: const float LEN = 4.0f D3DXVECTOR3 m_vp1, m_vp, m_vp3; D3DXVECTOR3 vstick; float flen; Treat the Sticks Independently We saw this code 3 slides ago vstick = m_vp1 - m_vp; m_vp1 += 0.5f * vstick; m_vp -= 0.5f * vstick; vstick = m_vp - m_vp3; m_vp += 0.5f * vstick; m_vp3 -= 0.5f * vstick; Ditto Remember this code. We ll use it again slides from now 5 6 Details The code is not exactly as we drew it in the picture. When we move m_vp the second time, it s not starting from its original position. But it s making progress towards where it needs to be. m_vp m_vp m_vp Relaxation So repeat the process. It s called relaxation. const int ITERATIONS = 7; for(int i=0; i<iterations; i++){ vstick = m_vp1 - m_vp; m_vp1 += 0.5f * vstick; m_vp -= 0.5f * vstick; vstick = m_vp - m_vp3; m_vp += 0.5f * vstick; m_vp3 -= 0.5f * vstick; We saw this code slides ago. We ll see it again 5 slides from now. 7 8 Jacobi/Gauss/Seidel Iteration This is Jacobi or Gauss Seidel iteration. It is a general method for satisfying multiple constraints that works quite well. Works quite well means that if the conditions are right, it will converge. The number of ITERATIONS will depend on the physical system being modeled, and details such as the speeds and the floating point precision. If ITERATIONS is small, the stick acts like a spring. (This can actually be useful!) As ITERATIONS gets larger, the spring becomes more stick like. Jacobi Gauss Seidel 9 Box or Screen Collision Detection Suppose we want to constrain our particles to be within a box that is 104 by 768 by This is all it takes: m_pp = D3DXVec3Minimize( D3DXVec3Maximize(m_pP, D3DXVECTOR3(0,0,0)), D3DXVECTOR3(104, 768, 1000) ); 30 5

6 Cloth == A Bunch of Springs Cloth Declarations extern const float LEN; extern const int NUMPARTICLES; extern const int NUMSPRINGS; extern const int ITERATIONS; //small D3DXVECTOR3 m_pp[numparticles]; struct SpringType{ int nend1, nend; //indices into m_pp float flen; //rest length ; SpringType m_pspring[numsprings]; 31 3 Cloth Code for(int i=0; i<iterations; i++){ for(int j=0; j<numsprings; j++){ SpringType& s = m_pspring[j]; D3DXVECTOR3& vp1 = m_pp[s.nend1]; D3DXVECTOR3& vp = m_pp[s.nend]; D3DXVECTOR3 vspr = vp1 - vp; float flen=d3dxvec3length(&vspr); vspr *= (flen s.flen)/flen; vp1 += 0.5f * vspr; vp -= 0.5f * vspr; Familiar? Look back 5 slides 33 Giving the Boot to Square Roots The call to D3DXVec3Length uses a implicit square root, which is slow. We can replace it by a division. Here s what we started with: D3DXVECTOR3 vspr = vp1 - vp; float flen = D3DXVec3Length(&vSpr); vspr *= (flen s.flen)/flen; vp1 += 0.5f * vspr; vp -= 0.5f * vspr; 34 Giving the Boot to Square Roots Instead we can eliminate the square root by sticking with squares. D3DXVECTOR3 vspr = vp1 - vp; float flsq = D3DXVec3Dot(&vSpr, &vspr); float L = s.flen * s.flen; vspr *= L/(fLSq + L) 0.5f; vp1 += vspr; vp -= vspr; Technically, this is approximating the square root with one iteration of Newton Raphson. How Many Particles?

7 1 particles If is Even If is Odd Number of Particles If is even, If is odd, Therefore number of particles is /. What is this operator? More on the next slide. Reminder If is a real number, then, pronounced floor of, is the largest integer less than or equal to, and, pronounced ceiling of, is the smallest integer greater than or equal to. If is a floating point value stored in variable float r; is implemented as(int)r. If is an integer stored in variable int n; / is implemented as n/. / /. Therefore, / is implemented as n - n/ How Many Springs? Example:

8 Example: 7 Example: Example: rows of 1springs. / rows of springs. columns of 1springs. 1diagonals of 1springs. 1back diagonals of 1springs. Total is therefore: Sanity Check 1 Let, be the number of springs in our grid. Does, 3 match our examples? Recall that we found that:, 7 7 3, , , 7 88 Sanity Check Check that,7 3 7 :, , , ,

9 Number of Particles and Springs Number of particles is /. Number of springs is 3. Therefore we need these declarations: extern const int NR; //number of rows extern const int NC; //number of cols const int NUMPARTICLES = NR*NC + NR/; const int NUMSPRINGS = (3*NR )*NC NR + NR/; 49 9

1 2 (3 + x 3) x 2 = 1 3 (3 + x 1 2x 3 ) 1. 3 ( 1 x 2) (3 + x(0) 3 ) = 1 2 (3 + 0) = 3. 2 (3 + x(0) 1 2x (0) ( ) = 1 ( 1 x(0) 2 ) = 1 3 ) = 1 3

1 2 (3 + x 3) x 2 = 1 3 (3 + x 1 2x 3 ) 1. 3 ( 1 x 2) (3 + x(0) 3 ) = 1 2 (3 + 0) = 3. 2 (3 + x(0) 1 2x (0) ( ) = 1 ( 1 x(0) 2 ) = 1 3 ) = 1 3 6 Iterative Solvers Lab Objective: Many real-world problems of the form Ax = b have tens of thousands of parameters Solving such systems with Gaussian elimination or matrix factorizations could require

More information

COUNTING AND CONVERTING

COUNTING AND CONVERTING COUNTING AND CONVERTING The base of each number system is also called the radix. The radix of a decimal number is ten, and the radix of binary is two. The radix determines how many different symbols are

More information

Physics Tutorial 2: Numerical Integration Methods

Physics Tutorial 2: Numerical Integration Methods Physics Tutorial 2: Numerical Integration Methods Summary The concept of numerically solving differential equations is explained, and applied to real time gaming simulation. Some objects are moved in a

More information

AP Computer Science Unit 3. Programs

AP Computer Science Unit 3. Programs AP Computer Science Unit 3. Programs For most of these programs I m asking that you to limit what you print to the screen. This will help me in quickly running some tests on your code once you submit them

More information

Repetition Through Recursion

Repetition Through Recursion Fundamentals of Computer Science I (CS151.02 2007S) Repetition Through Recursion Summary: In many algorithms, you want to do things again and again and again. For example, you might want to do something

More information

Table of Laplace Transforms

Table of Laplace Transforms Table of Laplace Transforms 1 1 2 3 4, p > -1 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 Heaviside Function 27 28. Dirac Delta Function 29 30. 31 32. 1 33 34. 35 36. 37 Laplace Transforms

More information

Taking Apart Numbers and Shapes

Taking Apart Numbers and Shapes Taking Apart Numbers and Shapes Writing Equivalent Expressions Using the Distributive Property 1 WARM UP Calculate the area of each rectangle. Show your work. 1. 6 in. 2. 15 in. 12 yd 9 yd LEARNING GOALS

More information

Pointers. A pointer is simply a reference to a variable/object. Compilers automatically generate code to store/retrieve variables from memory

Pointers. A pointer is simply a reference to a variable/object. Compilers automatically generate code to store/retrieve variables from memory Pointers A pointer is simply a reference to a variable/object Compilers automatically generate code to store/retrieve variables from memory It is automatically generating internal pointers We don t have

More information

Lecture VI: Constraints and Controllers

Lecture VI: Constraints and Controllers Lecture VI: Constraints and Controllers Motion Constraints In practice, no rigid body is free to move around on its own. Movement is constrained: wheels on a chair human body parts trigger of a gun opening

More information

(Refer Slide Time: 01.26)

(Refer Slide Time: 01.26) Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture # 22 Why Sorting? Today we are going to be looking at sorting.

More information

Lecture VI: Constraints and Controllers. Parts Based on Erin Catto s Box2D Tutorial

Lecture VI: Constraints and Controllers. Parts Based on Erin Catto s Box2D Tutorial Lecture VI: Constraints and Controllers Parts Based on Erin Catto s Box2D Tutorial Motion Constraints In practice, no rigid body is free to move around on its own. Movement is constrained: wheels on a

More information

Introduction to Computer Graphics. Animation (2) May 26, 2016 Kenshi Takayama

Introduction to Computer Graphics. Animation (2) May 26, 2016 Kenshi Takayama Introduction to Computer Graphics Animation (2) May 26, 2016 Kenshi Takayama Physically-based deformations 2 Simple example: single mass & spring in 1D Mass m, position x, spring coefficient k, rest length

More information

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch Purpose: We will take a look at programming this week using a language called Scratch. Scratch is a programming language that was developed

More information

UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING

UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C SPRING 2012 Lab 3 Matrix Math Introduction Reading In this lab you will write a

More information

(Refer Slide Time: 02:59)

(Refer Slide Time: 02:59) Numerical Methods and Programming P. B. Sunil Kumar Department of Physics Indian Institute of Technology, Madras Lecture - 7 Error propagation and stability Last class we discussed about the representation

More information

6.001 Notes: Section 6.1

6.001 Notes: Section 6.1 6.001 Notes: Section 6.1 Slide 6.1.1 When we first starting talking about Scheme expressions, you may recall we said that (almost) every Scheme expression had three components, a syntax (legal ways of

More information

Lecture Transcript While and Do While Statements in C++

Lecture Transcript While and Do While Statements in C++ Lecture Transcript While and Do While Statements in C++ Hello and welcome back. In this lecture we are going to look at the while and do...while iteration statements in C++. Here is a quick recap of some

More information

2.7 Cloth Animation. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter 2 123

2.7 Cloth Animation. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter 2 123 2.7 Cloth Animation 320491: Advanced Graphics - Chapter 2 123 Example: Cloth draping Image Michael Kass 320491: Advanced Graphics - Chapter 2 124 Cloth using mass-spring model Network of masses and springs

More information

animation projects in digital art animation 2009 fabio pellacini 1

animation projects in digital art animation 2009 fabio pellacini 1 animation projects in digital art animation 2009 fabio pellacini 1 animation shape specification as a function of time projects in digital art animation 2009 fabio pellacini 2 how animation works? flip

More information

1 Probabilistic analysis and randomized algorithms

1 Probabilistic analysis and randomized algorithms 1 Probabilistic analysis and randomized algorithms Consider the problem of hiring an office assistant. We interview candidates on a rolling basis, and at any given point we want to hire the best candidate

More information

Homework # 1 Due: Feb 23. Multicore Programming: An Introduction

Homework # 1 Due: Feb 23. Multicore Programming: An Introduction C O N D I T I O N S C O N D I T I O N S Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.86: Parallel Computing Spring 21, Agarwal Handout #5 Homework #

More information

Cloth Simulation on the GPU. Cyril Zeller NVIDIA Corporation

Cloth Simulation on the GPU. Cyril Zeller NVIDIA Corporation Cloth Simulation on the GPU Cyril Zeller NVIDIA Corporation Overview A method to simulate cloth on any GPU supporting Shader Model 3 (Quadro FX 4500, 4400, 3400, 1400, 540, GeForce 6 and above) Takes advantage

More information

11/3/2011. What You ll See in This Chapter. Word Cloud. How Much Calculus is Needed? A Modest Proposal. Ian Parberry University of North Texas

11/3/2011. What You ll See in This Chapter. Word Cloud. How Much Calculus is Needed? A Modest Proposal. Ian Parberry University of North Texas What You ll See in This Chapter Chapter 11: Mechanics 1: Linear Kinematics & Calculus Fletcher Dunn Valve Software Ian Parberry University of North Texas This chapter gives a taste of linear kinematics

More information

Particle Systems. Lecture 8 Taku Komura

Particle Systems. Lecture 8 Taku Komura Particle Systems Computer Animation and Visualisation Lecture 8 Taku Komura Overview Particle System Modelling fuzzy objects (fire, smoke) Modelling liquid Modelling cloth Integration : implicit integration,

More information

Meeting 1 Introduction to Functions. Part 1 Graphing Points on a Plane (REVIEW) Part 2 What is a function?

Meeting 1 Introduction to Functions. Part 1 Graphing Points on a Plane (REVIEW) Part 2 What is a function? Meeting 1 Introduction to Functions Part 1 Graphing Points on a Plane (REVIEW) A plane is a flat, two-dimensional surface. We describe particular locations, or points, on a plane relative to two number

More information

Integers are whole numbers; they include negative whole numbers and zero. For example -7, 0, 18 are integers, 1.5 is not.

Integers are whole numbers; they include negative whole numbers and zero. For example -7, 0, 18 are integers, 1.5 is not. What is an INTEGER/NONINTEGER? Integers are whole numbers; they include negative whole numbers and zero. For example -7, 0, 18 are integers, 1.5 is not. What is a REAL/IMAGINARY number? A real number is

More information

Congruence Arithmetic

Congruence Arithmetic Module 4 Congruence Arithmetic Popper 4 Introduction to what is like Modulus choices Partitions by modulus Mod 5 Mod 7 Mod 30 Modular Arithmetic Addition Subtraction Multiplication INTEGERS! Mod 12 Cayley

More information

(Refer Slide Time: 00:26)

(Refer Slide Time: 00:26) Programming, Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science and Engineering Indian Institute Technology, Madras Module 07 Lecture 07 Contents Repetitive statements

More information

Numerical Integration

Numerical Integration 1 Numerical Integration Jim Van Verth Insomniac Games jim@essentialmath.com Essential mathematics for games and interactive applications Talk Summary Going to talk about: Euler s method subject to errors

More information

February 23 Math 2335 sec 51 Spring 2016

February 23 Math 2335 sec 51 Spring 2016 February 23 Math 2335 sec 51 Spring 2016 Section 4.1: Polynomial Interpolation Interpolation is the process of finding a curve or evaluating a function whose curve passes through a known set of points.

More information

n! = 1 * 2 * 3 * 4 * * (n-1) * n

n! = 1 * 2 * 3 * 4 * * (n-1) * n The Beauty and Joy of Computing 1 Lab Exercise 9: Problem self-similarity and recursion Objectives By completing this lab exercise, you should learn to Recognize simple self-similar problems which are

More information

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #16 Loops: Matrix Using Nested for Loop

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #16 Loops: Matrix Using Nested for Loop Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #16 Loops: Matrix Using Nested for Loop In this section, we will use the, for loop to code of the matrix problem.

More information

The Future of Real-Time Energy Management Systems For Transmission System Operations

The Future of Real-Time Energy Management Systems For Transmission System Operations San Francisco Chapter The Institute of Electrical and Electronic Engineers Power Engineering Society The Future of Real-Time Energy Management Systems For Transmission System Operations John Sell, EleQuant,

More information

Graded Assignment 2 Maple plots

Graded Assignment 2 Maple plots Graded Assignment 2 Maple plots The Maple part of the assignment is to plot the graphs corresponding to the following problems. I ll note some syntax here to get you started see tutorials for more. Problem

More information

Discrete Element Method

Discrete Element Method Discrete Element Method Midterm Project: Option 2 1 Motivation NASA, loyalkng.com, cowboymining.com Industries: Mining Food & Pharmaceutics Film & Game etc. Problem examples: Collapsing Silos Mars Rover

More information

NON-CALCULATOR ARITHMETIC

NON-CALCULATOR ARITHMETIC Mathematics Revision Guides Non-Calculator Arithmetic Page 1 of 30 M.K. HOME TUITION Mathematics Revision Guides: Level: GCSE Foundation Tier NON-CALCULATOR ARITHMETIC Version: 3.2 Date: 21-10-2016 Mathematics

More information

COMP 161 Lecture Notes 16 Analyzing Search and Sort

COMP 161 Lecture Notes 16 Analyzing Search and Sort COMP 161 Lecture Notes 16 Analyzing Search and Sort In these notes we analyze search and sort. Counting Operations When we analyze the complexity of procedures we re determine the order of the number of

More information

Chapter 1. Math review. 1.1 Some sets

Chapter 1. Math review. 1.1 Some sets Chapter 1 Math review This book assumes that you understood precalculus when you took it. So you used to know how to do things like factoring polynomials, solving high school geometry problems, using trigonometric

More information

CS450 - Structure of Higher Level Languages

CS450 - Structure of Higher Level Languages Spring 2018 Streams February 24, 2018 Introduction Streams are abstract sequences. They are potentially infinite we will see that their most interesting and powerful uses come in handling infinite sequences.

More information

1. CONVEX POLYGONS. Definition. A shape D in the plane is convex if every line drawn between two points in D is entirely inside D.

1. CONVEX POLYGONS. Definition. A shape D in the plane is convex if every line drawn between two points in D is entirely inside D. 1. CONVEX POLYGONS Definition. A shape D in the plane is convex if every line drawn between two points in D is entirely inside D. Convex 6 gon Another convex 6 gon Not convex Question. Why is the third

More information

Divisibility Rules and Their Explanations

Divisibility Rules and Their Explanations Divisibility Rules and Their Explanations Increase Your Number Sense These divisibility rules apply to determining the divisibility of a positive integer (1, 2, 3, ) by another positive integer or 0 (although

More information

Cloth Simulation. Tanja Munz. Master of Science Computer Animation and Visual Effects. CGI Techniques Report

Cloth Simulation. Tanja Munz. Master of Science Computer Animation and Visual Effects. CGI Techniques Report Cloth Simulation CGI Techniques Report Tanja Munz Master of Science Computer Animation and Visual Effects 21st November, 2014 Abstract Cloth simulation is a wide and popular area of research. First papers

More information

Reals 1. Floating-point numbers and their properties. Pitfalls of numeric computation. Horner's method. Bisection. Newton's method.

Reals 1. Floating-point numbers and their properties. Pitfalls of numeric computation. Horner's method. Bisection. Newton's method. Reals 1 13 Reals Floating-point numbers and their properties. Pitfalls of numeric computation. Horner's method. Bisection. Newton's method. 13.1 Floating-point numbers Real numbers, those declared to be

More information

#$ % $ $& "$%% " $ '$ " '

#$ % $ $& $%%  $ '$  ' ! " This section of the course covers techniques for pairwise (i.e., scanto-scan) and global (i.e., involving more than 2 scans) alignment, given that the algorithms are constrained to obtain a rigid-body

More information

Lesson 15. Student Outcomes. Lesson Notes. Classwork. Opening (2 minutes) Opening Exercise (3 minutes) (optional)

Lesson 15. Student Outcomes. Lesson Notes. Classwork. Opening (2 minutes) Opening Exercise (3 minutes) (optional) Lesson 5 Lesson 5: Piecewise Functions Student Outcomes Students examine the features of piecewise functions including the absolute value function and step functions. Students understand that the graph

More information

Introduction to Computer Science Unit 3. Programs

Introduction to Computer Science Unit 3. Programs Introduction to Computer Science Unit 3. Programs This section must be updated to work with repl.it Programs 1 to 4 require you to use the mod, %, operator. 1. Let the user enter an integer. Your program

More information

CSci 1113, Fall 2015 Lab Exercise 4 (Week 5): Write Your Own Functions. User Defined Functions

CSci 1113, Fall 2015 Lab Exercise 4 (Week 5): Write Your Own Functions. User Defined Functions CSci 1113, Fall 2015 Lab Exercise 4 (Week 5): Write Your Own Functions User Defined Functions In previous labs, you've encountered useful functions, such as sqrt() and pow(), that were created by other

More information

Math Lab 6: Powerful Fun with Power Series Representations of Functions Due noon Thu. Jan. 11 in class *note new due time, location for winter quarter

Math Lab 6: Powerful Fun with Power Series Representations of Functions Due noon Thu. Jan. 11 in class *note new due time, location for winter quarter Matter & Motion Winter 2017 18 Name: Math Lab 6: Powerful Fun with Power Series Representations of Functions Due noon Thu. Jan. 11 in class *note new due time, location for winter quarter Goals: 1. Practice

More information

Homework # 2 Due: October 6. Programming Multiprocessors: Parallelism, Communication, and Synchronization

Homework # 2 Due: October 6. Programming Multiprocessors: Parallelism, Communication, and Synchronization ECE669: Parallel Computer Architecture Fall 2 Handout #2 Homework # 2 Due: October 6 Programming Multiprocessors: Parallelism, Communication, and Synchronization 1 Introduction When developing multiprocessor

More information

2D/3D Geometric Transformations and Scene Graphs

2D/3D Geometric Transformations and Scene Graphs 2D/3D Geometric Transformations and Scene Graphs Week 4 Acknowledgement: The course slides are adapted from the slides prepared by Steve Marschner of Cornell University 1 A little quick math background

More information

Standard Chapter/Unit Notes

Standard Chapter/Unit Notes . (C, F, T).,00 (C, F, S, T). (C, F, P, S, T).,,, (C, T) Workout. (C, F, P, S, T). (C, F, P, S, T). (C, F, G, P, T). (C, F, P, T). (C, E, G, P, T) 0. (C, F, P, S, T) Solution/Representation - Problem #0

More information

Notebook Assignments

Notebook Assignments Notebook Assignments These six assignments are a notebook using techniques from class in the single concrete context of graph theory. This is supplemental to your usual assignments, and is designed for

More information

Unit 1, Lesson 1: Moving in the Plane

Unit 1, Lesson 1: Moving in the Plane Unit 1, Lesson 1: Moving in the Plane Let s describe ways figures can move in the plane. 1.1: Which One Doesn t Belong: Diagrams Which one doesn t belong? 1.2: Triangle Square Dance m.openup.org/1/8-1-1-2

More information

Simulating ocean currents

Simulating ocean currents Simulating ocean currents We will study a parallel application that simulates ocean currents. Goal: Simulate the motion of water currents in the ocean. Important to climate modeling. Motion depends on

More information

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #44. Multidimensional Array and pointers

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #44. Multidimensional Array and pointers Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #44 Multidimensional Array and pointers In this video, we will look at the relation between Multi-dimensional

More information

Dependent Independent Input Discrete. X Y Output Continuous

Dependent Independent Input Discrete. X Y Output Continuous Domain and Range Review Vocabulary Words Dependent Independent Input Discrete X Y Output Continuous Domain is all the values. It is the variable. It is also the of the function. Range is all the values.

More information

Ragdoll Physics. Abstract. 2 Background. 1 Introduction. Gabe Mulley, Matt Bittarelli. April 25th, Previous Work

Ragdoll Physics. Abstract. 2 Background. 1 Introduction. Gabe Mulley, Matt Bittarelli. April 25th, Previous Work Ragdoll Physics Gabe Mulley, Matt Bittarelli April 25th, 2007 Abstract The goal of this project was to create a real-time, interactive, and above all, stable, ragdoll physics simulation. This simulation

More information

Simulation in Computer Graphics. Deformable Objects. Matthias Teschner. Computer Science Department University of Freiburg

Simulation in Computer Graphics. Deformable Objects. Matthias Teschner. Computer Science Department University of Freiburg Simulation in Computer Graphics Deformable Objects Matthias Teschner Computer Science Department University of Freiburg Outline introduction forces performance collision handling visualization University

More information

Watkins Mill High School. Algebra 2. Math Challenge

Watkins Mill High School. Algebra 2. Math Challenge Watkins Mill High School Algebra 2 Math Challenge "This packet will help you prepare for Algebra 2 next fall. It will be collected the first week of school. It will count as a grade in the first marking

More information

CS201 Discussion 7 MARKOV AND RECURSION

CS201 Discussion 7 MARKOV AND RECURSION CS201 Discussion 7 MARKOV AND RECURSION Before we begin Any questions about the midterm solutions? Making a Markov Map Recall that in Markov, we re trying to make a map of all k-grams to all k-grams that

More information

Module 10A Lecture - 20 What is a function? Why use functions Example: power (base, n)

Module 10A Lecture - 20 What is a function? Why use functions Example: power (base, n) Programming, Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science and Engineering Indian Institute of Technology, Madras Module 10A Lecture - 20 What is a function?

More information

Chapter 12: Pointers and Arrays. Chapter 12. Pointers and Arrays. Copyright 2008 W. W. Norton & Company. All rights reserved.

Chapter 12: Pointers and Arrays. Chapter 12. Pointers and Arrays. Copyright 2008 W. W. Norton & Company. All rights reserved. Chapter 12 Pointers and Arrays 1 Introduction C allows us to perform arithmetic addition and subtraction on pointers to array elements. This leads to an alternative way of processing arrays in which pointers

More information

Excel Basics: Working with Spreadsheets

Excel Basics: Working with Spreadsheets Excel Basics: Working with Spreadsheets E 890 / 1 Unravel the Mysteries of Cells, Rows, Ranges, Formulas and More Spreadsheets are all about numbers: they help us keep track of figures and make calculations.

More information

Text Input and Conditionals

Text Input and Conditionals Text Input and Conditionals Text Input Many programs allow the user to enter information, like a username and password. Python makes taking input from the user seamless with a single line of code: input()

More information

Project 1: Particle System The Animation of Natural Phenomena Due 10/18

Project 1: Particle System The Animation of Natural Phenomena Due 10/18 Project 1: Particle System The Animation of Natural Phenomena Due 10/18 In this project you will implement a particle system with constraints. You must implement at least the required features. You must

More information

Objective- Students will be able to use the Order of Operations to evaluate algebraic expressions. Evaluating Algebraic Expressions

Objective- Students will be able to use the Order of Operations to evaluate algebraic expressions. Evaluating Algebraic Expressions Objective- Students will be able to use the Order of Operations to evaluate algebraic expressions. Evaluating Algebraic Expressions Variable is a letter or symbol that represents a number. Variable (algebraic)

More information

Structure and Synthesis of Robot Motion

Structure and Synthesis of Robot Motion Structure and Synthesis of Robot Motion Dynamics: Constraints, Continua, etc. Subramanian Ramamoorthy School of Informatics 5 February, 2009 Recap Last time, we discussed two major approaches to describing

More information

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives.

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives. D Graphics Primitives Eye sees Displays - CRT/LCD Frame buffer - Addressable pixel array (D) Graphics processor s main function is to map application model (D) by projection on to D primitives: points,

More information

SHOW ALL NEEDED WORK IN YOUR NOTEBOOK.

SHOW ALL NEEDED WORK IN YOUR NOTEBOOK. DO NOW: 1 3: NO CALCULATORS 1. Consider the function f () x the value of f (4.1)? SHOW ALL NEEDED WORK IN YOUR NOTEBOOK. x. We all know that f (4), but without a calculator, what is . The approximate value

More information

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #43. Multidimensional Arrays

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #43. Multidimensional Arrays Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #43 Multidimensional Arrays In this video will look at multi-dimensional arrays. (Refer Slide Time: 00:03) In

More information

COMP 250 Fall recurrences 2 Oct. 13, 2017

COMP 250 Fall recurrences 2 Oct. 13, 2017 COMP 250 Fall 2017 15 - recurrences 2 Oct. 13, 2017 Here we examine the recurrences for mergesort and quicksort. Mergesort Recall the mergesort algorithm: we divide the list of things to be sorted into

More information

EEN118 LAB FOUR. h = v t ½ g t 2

EEN118 LAB FOUR. h = v t ½ g t 2 EEN118 LAB FOUR In this lab you will be performing a simulation of a physical system, shooting a projectile from a cannon and working out where it will land. Although this is not a very complicated physical

More information

Cloth Simulation. COMP 768 Presentation Zhen Wei

Cloth Simulation. COMP 768 Presentation Zhen Wei Cloth Simulation COMP 768 Presentation Zhen Wei Outline Motivation and Application Cloth Simulation Methods Physically-based Cloth Simulation Overview Development References 2 Motivation Movies Games VR

More information

CS Lecture 19: Loop invariants

CS Lecture 19: Loop invariants CS 1110 Lecture 19: Loop invariants Announcements Prelim 2 conflicts Today (April 2) is two weeks before the prelim, and the deadline for submitting prelim conflicts. Instructor travel This week and the

More information

6.001 Notes: Section 4.1

6.001 Notes: Section 4.1 6.001 Notes: Section 4.1 Slide 4.1.1 In this lecture, we are going to take a careful look at the kinds of procedures we can build. We will first go back to look very carefully at the substitution model,

More information

T6: Position-Based Simulation Methods in Computer Graphics. Jan Bender Miles Macklin Matthias Müller

T6: Position-Based Simulation Methods in Computer Graphics. Jan Bender Miles Macklin Matthias Müller T6: Position-Based Simulation Methods in Computer Graphics Jan Bender Miles Macklin Matthias Müller Jan Bender Organizer Professor at the Visual Computing Institute at Aachen University Research topics

More information

MPI Casestudy: Parallel Image Processing

MPI Casestudy: Parallel Image Processing MPI Casestudy: Parallel Image Processing David Henty 1 Introduction The aim of this exercise is to write a complete MPI parallel program that does a very basic form of image processing. We will start by

More information

Statistics Case Study 2000 M. J. Clancy and M. C. Linn

Statistics Case Study 2000 M. J. Clancy and M. C. Linn Statistics Case Study 2000 M. J. Clancy and M. C. Linn Problem Write and test functions to compute the following statistics for a nonempty list of numeric values: The mean, or average value, is computed

More information

Announcements. Lab Friday, 1-2:30 and 3-4:30 in Boot your laptop and start Forte, if you brought your laptop

Announcements. Lab Friday, 1-2:30 and 3-4:30 in Boot your laptop and start Forte, if you brought your laptop Announcements Lab Friday, 1-2:30 and 3-4:30 in 26-152 Boot your laptop and start Forte, if you brought your laptop Create an empty file called Lecture4 and create an empty main() method in a class: 1.00

More information

Computer Vision. Matlab

Computer Vision. Matlab Computer Vision Matlab A good choice for vision program development because Easy to do very rapid prototyping Quick to learn, and good documentation A good library of image processing functions Excellent

More information

Today s class. Roots of equation Finish up incremental search Open methods. Numerical Methods, Fall 2011 Lecture 5. Prof. Jinbo Bi CSE, UConn

Today s class. Roots of equation Finish up incremental search Open methods. Numerical Methods, Fall 2011 Lecture 5. Prof. Jinbo Bi CSE, UConn Today s class Roots of equation Finish up incremental search Open methods 1 False Position Method Although the interval [a,b] where the root becomes iteratively closer with the false position method, unlike

More information

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #49. Structures in C -1

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #49. Structures in C -1 Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #49 Structures in C -1 So, in this lecture will talk about structures and C, which is syntactic feature that

More information

Lecture Numbers. Richard E Sarkis CSC 161: The Art of Programming

Lecture Numbers. Richard E Sarkis CSC 161: The Art of Programming Lecture Numbers Richard E Sarkis CSC 161: The Art of Programming Class Administrivia Agenda To understand the concept of data types To be familiar with the basic numeric data types in Python To be able

More information

Arrays, Type Casting and Constants. Engineering 1D04, Teaching Session 5

Arrays, Type Casting and Constants. Engineering 1D04, Teaching Session 5 Arrays, Type Casting and Constants Engineering 1D04, Teaching Session 5 High Score System We want to produce a program to keep track of the high scores in a video game. The top ten scores and the names

More information

Hanoi, Counting and Sierpinski s triangle Infinite complexity in finite area

Hanoi, Counting and Sierpinski s triangle Infinite complexity in finite area Hanoi, Counting and Sierpinski s triangle Infinite complexity in finite area Math Circle December 5, 2017 1. Per usual we are going to be watching a video today, but we aren t going to be watching it right

More information

Lab 6 Vectors and functions

Lab 6 Vectors and functions CMSC160 Intro to Algorithmic Design Blaheta Lab 6 Vectors and functions 11 October 2016 The drill for this lab is another part of the Chapter 4 drill. Come to lab on Tuesday either with it completed or

More information

Jacobians. 6.1 Linearized Kinematics. Y: = k2( e6)

Jacobians. 6.1 Linearized Kinematics. Y: = k2( e6) Jacobians 6.1 Linearized Kinematics In previous chapters we have seen how kinematics relates the joint angles to the position and orientation of the robot's endeffector. This means that, for a serial robot,

More information

6. Asymptotics: The Big-O and Other Notations

6. Asymptotics: The Big-O and Other Notations Chapter 7 SEARCHING 1. Introduction, Notation 2. Sequential Search 3. Binary Search 4. Comparison Trees 5. Lower Bounds 6. Asymptotics: The Big-O and Other Notations Outline Transp. 1, Chapter 7, Searching

More information

Arrays: Higher Dimensional Arrays. CS0007: Introduction to Computer Programming

Arrays: Higher Dimensional Arrays. CS0007: Introduction to Computer Programming Arrays: Higher Dimensional Arrays CS0007: Introduction to Computer Programming Review If the == operator has two array variable operands, what is being compared? The reference variables held in the variables.

More information

Introduction to Programming in C Department of Computer Science and Engineering\ Lecture No. #02 Introduction: GCD

Introduction to Programming in C Department of Computer Science and Engineering\ Lecture No. #02 Introduction: GCD Introduction to Programming in C Department of Computer Science and Engineering\ Lecture No. #02 Introduction: GCD In this session, we will write another algorithm to solve a mathematical problem. If you

More information

Contents. Slide Set 1. About these slides. Outline of Slide Set 1. Typographical conventions: Italics. Typographical conventions. About these slides

Contents. Slide Set 1. About these slides. Outline of Slide Set 1. Typographical conventions: Italics. Typographical conventions. About these slides Slide Set 1 for ENCM 369 Winter 2014 Lecture Section 01 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary Winter Term, 2014 ENCM 369 W14 Section

More information

Arrays array array length fixed array fixed length array fixed size array Array elements and subscripting

Arrays array array length fixed array fixed length array fixed size array Array elements and subscripting Arrays Fortunately, structs are not the only aggregate data type in C++. An array is an aggregate data type that lets us access many variables of the same type through a single identifier. Consider the

More information

Objects 2: Curves & Splines Christian Miller CS Fall 2011

Objects 2: Curves & Splines Christian Miller CS Fall 2011 Objects 2: Curves & Splines Christian Miller CS 354 - Fall 2011 Parametric curves Curves that are defined by an equation and a parameter t Usually t [0, 1], and curve is finite Can be discretized at arbitrary

More information

EEN118 LAB FOUR. h = v t ½ g t 2

EEN118 LAB FOUR. h = v t ½ g t 2 EEN118 LAB FOUR In this lab you will be performing a simulation of a physical system, shooting a projectile from a cannon and working out where it will land. Although this is not a very complicated physical

More information

Programming for Electrical and Computer Engineers. Pointers and Arrays

Programming for Electrical and Computer Engineers. Pointers and Arrays Programming for Electrical and Computer Engineers Pointers and Arrays Dr. D. J. Jackson Lecture 12-1 Introduction C allows us to perform arithmetic addition and subtraction on pointers to array elements.

More information

Imelda C. Go, South Carolina Department of Education, Columbia, SC

Imelda C. Go, South Carolina Department of Education, Columbia, SC PO 082 Rounding in SAS : Preventing Numeric Representation Problems Imelda C. Go, South Carolina Department of Education, Columbia, SC ABSTRACT As SAS programmers, we come from a variety of backgrounds.

More information

Lecture 15 : Review DRAFT

Lecture 15 : Review DRAFT CS/Math 240: Introduction to Discrete Mathematics 3/10/2011 Lecture 15 : Review Instructor: Dieter van Melkebeek Scribe: Dalibor Zelený DRAFT Today slectureservesasareviewofthematerialthatwillappearonyoursecondmidtermexam.

More information

9 abcd = dcba b + 90c = c + 10b b = 10c.

9 abcd = dcba b + 90c = c + 10b b = 10c. In this session, we ll learn how to solve problems related to place value. This is one of the fundamental concepts in arithmetic, something every elementary and middle school mathematics teacher should

More information

FOR Loops. Last Modified: 01 June / 1

FOR Loops. Last Modified: 01 June / 1 FOR Loops http://people.sc.fsu.edu/ jburkardt/isc/week04 lecture 08.pdf... ISC3313: Introduction to Scientific Computing with C++ Summer Semester 2011... John Burkardt Department of Scientific Computing

More information

Design and Analysis of Algorithms Prof. Madhavan Mukund Chennai Mathematical Institute. Week 02 Module 06 Lecture - 14 Merge Sort: Analysis

Design and Analysis of Algorithms Prof. Madhavan Mukund Chennai Mathematical Institute. Week 02 Module 06 Lecture - 14 Merge Sort: Analysis Design and Analysis of Algorithms Prof. Madhavan Mukund Chennai Mathematical Institute Week 02 Module 06 Lecture - 14 Merge Sort: Analysis So, we have seen how to use a divide and conquer strategy, we

More information