N B ODY G RAVITATIONAL P ROBLEM Seminar By Srinivasan Manoharan.

Slides:



Advertisements
Similar presentations
Analysis of Computer Algorithms
Advertisements

Teach GCSE Maths x x x x x x x x x x Weekly Household Income (£) f (millions) weekly household income (£) Data Handling.
Introduction to C Programming
Chapter 1: INTRODUCTION TO DATA STRUCTURE
Instructor Notes Lecture discusses parallel implementation of a simple embarrassingly parallel nbody algorithm We aim to provide some correspondence between.
Chapter 4 Motion in two dimensions (Chap. 2 in the textbook page 30)
Introduction to Vectors. Vectors ScalarsVectors Distance Time Mass Work Energy Speed Displacement Velocity Acceleration Force Momentum Torque Magnitude.
Forging new generations of engineers
Kinetics of Particles Impulse and Momentum.
N-Body I CS 170: Computing for the Sciences and Mathematics.
Response Spectrum Analysis as per Indian IS: 1893 (Part 1)-2002
Parallel Strategies Partitioning consists of the following steps –Divide the problem into parts –Compute each part separately –Merge the results Divide.
Angular Momentum (of a particle) O The angular momentum of a particle, about the reference point O, is defined as the vector product of the position, relative.
Partitioning and Divide-and-Conquer Strategies ITCS 4/5145 Cluster Computing, UNC-Charlotte, B. Wilkinson, 2007.
Linear Momentum and Collisions
Review of basic mathematics: Vectors & Matrices Differential equations Rende Steerenberg (BE/OP) 16 January 2012 Rende Steerenberg (BE/OP) 16 January 2012.
1 Matrix Addition, C = A + B Add corresponding elements of each matrix to form elements of result matrix. Given elements of A as a i,j and elements of.
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
Gravitational Potential energy Mr. Burns
PHYS 218 sec Review Chap. 9 Rotation of Rigid Bodies.
Motion and Speed. Motion Definition: When an object changes its position relative to a reference point Distance – How far an object has moved. Displacement.
Newtonian Gravitation and Orbits
NEWTON'S SECOND LAW. OBJECTIVES  Students will be able to explain Newton's second law of motion.  They will be able to derive the formula for calculating.
Molecular Dynamics Sathish Vadhiyar Courtesy: Dr. David Walker, Cardiff University.
Computational issues in Carbon nanotube simulation Ashok Srinivasan Department of Computer Science Florida State University.
1 Electric Field – Continuous Charge Distribution As the average separation between source charges is smaller than the distance between the charges and.
Introduction : In this chapter we will introduce the concepts of work and kinetic energy. These tools will significantly simplify the manner in which.
Chapter 12 Universal Law of Gravity
Chapter 4 The Laws of Motion. Classes of Forces Contact forces involve physical contact between two objects Field forces act through empty space No physical.
Copyright © 2010 Pearson Education South Asia Pte Ltd
 Assess. Statements due Monday, 10/20/14.
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
6.1 – Work. Objectives Explain the meaning of work. Explain the meaning of work. Describe how work and energy are related. Describe how work and energy.
1 The Law of Universal Gravitation. 2 A little background … Legend has it that Sir Isaac Newton was struck on the head by a falling apple while napping.
Electric Fields. The gravitational and electric forces can act through space without any physical contact between the interacting objects. Just like the.
An Efficient CUDA Implementation of the Tree-Based Barnes Hut n-body Algorithm By Martin Burtscher and Keshav Pingali Jason Wengert.
Spring 2002 Lecture #21 Dr. Jaehoon Yu 1.Kepler’s Laws 2.The Law of Gravity & The Motion of Planets 3.The Gravitational Field 4.Gravitational.
Chapter 5 The Laws of Motion.
Smoothed Particle Hydrodynamics Matthew Zhu CSCI 5551 — Fall 2015.
Barnes Hut N-body Simulation Martin Burtscher Fall 2009.
Data Structures and Algorithms in Parallel Computing Lecture 10.
Gravitational Potential Energy Gravitational Potential B Fg = mg Gravitational Potential A The particle with a given mass will have more G.P.E at pt B.
Barnes Hut – A Broad Review Abhinav S Bhatele The 27th day of April, 2006.
1 Chapter 4 The Laws of Motion Classes of Forces Contact forces involve physical contact between two objects Field forces act through empty.
Barnes Hut N-body Simulation Martin Burtscher Fall 2009.
Acceleration & Force Section 8.2.
All-to-All Pattern A pattern where all (slave) processes can communicate with each other Somewhat the worst case scenario! 1 ITCS 4/5145 Parallel Computing,
AXEL-2017 Introduction to Particle Accelerators
ChaNGa: Design Issues in High Performance Cosmology
Copyright © 2010 Pearson Education South Asia Pte Ltd
Lecture 19 MA471 Fall 2003.
Chapter 4 Laws of Motion.
Example Fill in the grid so that every row, column and box contains each of the numbers 1 to 9:
and Divide-and-Conquer Strategies
Variable acceleration
Coulomb’s Law Section
Objective of This Course
Chapter 5 The Laws of Motion.
Supported by the National Science Foundation.
Projectile Motion.
Sathish Vadhiyar Courtesy: Dr. David Walker, Cardiff University
Force and Motion 3.1 Mrs. Chastain On-Level 2017.
Find the velocity of a particle with the given position function
All-to-All Pattern A pattern where all (slave) processes can communicate with each other Somewhat the worst case scenario! ITCS 4/5145 Parallel Computing,
All-to-All Pattern A pattern where all (slave) processes can communicate with each other Somewhat the worst case scenario! ITCS 4/5145 Parallel Computing,
Topic9_Pressure_Correction
All-to-All Pattern A pattern where all (slave) processes can communicate with each other Somewhat the worst case scenario! ITCS 4/5145 Parallel Computing,
AE/ME 339 Computational Fluid Dynamics (CFD) K. M. Isaac 4/30/2019
Presentation transcript:

N B ODY G RAVITATIONAL P ROBLEM Seminar By Srinivasan Manoharan

P ROBLEM To compute the position of N bodies over a set of Iterations by using the forces that exists between the other bodies. A big mathematical conundrum I chose this problem because of the huge amount of computation involved in this problem. Mathematical Problem:- Consider n point masses in three dimensional space Assumption :- Force experienced between them is Newtonian. Then, if the initial positions in space and initial velocities are specified for every particle at some present instant t 0, determine the position of each particle at every future (or past) moment of time

P ROBLEM (C ONTD..) The All Pairs Approach is a brute force technique which evaluates the interactions between all the pairs of the N bodies. The problem with this approach is that the worst case computational complexity is O(N 2 ). The all pair approach is used for evaluating bodies that are interacting very closely. So the all pairs method is combined with a more efficient method,far field approximation of long range forces(Barnes Hut method). This far field method is only valid when the two bodies are well separated. The all pairs method requires substantial time to compute and an area where acceleration can be used.

C ALCULATION Force Between two bodies with a distance r is The total Force on the Body i is the summation of the all the forces other than i. i.e where j is 1 to N and not equal to j. Due to approximation, softening factor is included and Force = mass * Acceleration. Acceleration of the body,a i F ij =G*(m i* m j )/r ij 2 F i =∑F ij F i =G*m i *∑((m j r ij )/r ij 3 ) F i =G*m i *∑((m j r ij )/(r ij 2 +ε 2 ) 3/2 ). a i =G*∑((m j r ij )/(r ij 2 +ε 2 ) 3/2 ).

C ALCULATION ( CONTD..) With acceleration calculated, we can get the velocity v and the distance x for the body to move. We can calculate all F ij in a grid of size N * N. F11F12F13F14F15F16F1jF1n F21F22F23F24F25F26F2jF2n F31F32F33F34F35F36F3jF3n F41F42F43F44F45F46F4jF4n Fi1Fi2Fi3Fi4Fi5Fi6FijFin Fn1Fn2Fn3Fn4Fn5Fn6FnjFnn

S TRATEGY First we randomly position the bodies in the 3 dimensional space. Then we calculate the force exerted in all the axis using the formula. We calculate the acceleration by dividing the force by mass We calculate the velocity by multiplying the acceleration with delta time. Then finally we calculate the new position by multiplying the velocity with delta time.

S TRATEGY Each entry in the Grid can be calculated independently, therefore there is N 2 parallelism. But Since the memory is limited, we cannot use N 2 threads each computing the force in the grid. So we can calculate the forces in a row to be calculated in sequential order. And parallelize the columns as each thread can calculate the Force and acceleration of the body.

A NALYSIS We need to obtain the performance by By varying the number of bodies N interacting By Varying the number of iterations. By varying the number of threads per block. By varying the number of processors. The number of threads per block can also be varied,but the performance was better when I used p= 256 i.e 256 threads per block. Number of Blocks = Number of Bodies / Number of threads

T ABLE (N & N UMBER OF I TERATIONS )-S EQUENTIAL

T ABLE (N & N UMBER OF I TERATIONS )-P ARALLEL N - Number of BodiesTime for 2 Iteration in Milli sec16 Iteration128 iterations

P ERFORMANCE (T IME V S N)

P ERFORMANCE (T IME V S P ROCESSORS ) As the number of Nodes increases, the performance is better.

A NALYSIS & I NFERENCE The number of calculations involved is and computed in 11.4 milli seconds. Each calculation involves 14 operations. When the number of computation is less the processors are underutilized. But when the calculations increase the performance is far better than the sequential code. When the number of bodies is 32 the performance is better in parallel.i.e calculations.

QUESTIONS Thank You