SlideShare a Scribd company logo
1 of 21
Particle Systems
1
Introduction
• Most important of procedural methods
• Used to model
• Natural phenomena
• Clouds
• Terrain
• Plants
•Crowd Scenes
•Real physical processes
2
Newtonian Particle
• Particle system is a set of particles
• Each particle is an ideal point mass
• Six degrees of freedom
• Position
• Velocity
• Each particle obeys Newtons’ law
f = ma
3
Particle Equations
pi = (xi, yi zi)
vi = dpi /dt = pi
‘
= (dxi /dt, dyi /dt , zi/dt)
m vi
‘
= fi
Hard part is defining force vector
4
Force Vector
• Independent Particles
• Gravity
• Wind forces
• O(n) calulation
• Coupled Particles O(n)
• Meshes
• Spring-Mass Systems
• Coupled Particles O(n2
)
• Attractive and repulsive forces
5
Solution of Particle Systems
float time, delta state[6n],
force[3n];
state = initial_state();
for(time = t0; time<final_time,
time+=delta) {
force = force_function(state,
time);
state = ode(force, state, time,
delta);
render(state, time)
}
6
Simple Forces
• Consider force on particle i
fi= fi(pi, vi)
• Gravity fi= g
gi= (0, -g, 0)
• Wind forces
• Drag
7
pi(t0), vi(t0)
Meshes
• Connect each particle to its closest neighbors
• O(n) force calculation
• Use spring-mass system
8
Spring Forces
• Assume each particle has unit mass and is connected to its
neighbor(s) by a spring
• Hooke’s law: force proportional to distance (d = ||p – q||) between
the points
9
Hooke’s Law
• Let s be the distance when there is no force
f = -ks(|d| - s) d/|d|
ksis the spring constant
d/|d| is a unit vector pointed from p to q
• Each interior point in mesh has four forces applied to it
10
Spring Damping
• A pure spring-mass will oscillate forever
• Must add a damping term
f = -(ks(|d| - s) + kd d·d/|d|)d/|d|
• Must project velocity
11
·
Attraction and Repulsion
• Inverse square law
f = -krd/|d|3
• General case requires O(n2
) calculation
• In most problems, the drop off is such that not many particles
contribute to the forces on any given particle
• Sorting problem: is it O(n log n)?
12
Boxes
• Spatial subdivision technique
• Divide space into boxes
• Particle can only interact with particles in its box or the neighboring
boxes
• Must update which box a particle belongs to after each time step
13
Linked Lists
• Each particle maintains a linked list of its neighbors
• Update data structure at each time step
• Must amortize cost of building the data structures initially
14
Particle Field Calculations
• Consider simple gravity
• We don’t compute forces due to sun, moon, and other large bodies
• Rather we use the gravitational field
• Usually we can group particles into equivalent point masses
15
Solution of ODEs
• Particle system has 6n ordinary differential equations
• Write set as du/dt = g(u,t)
• Solve by approximations using Taylor’s Thm
16
Euler’s Method
u(t + h) ≈ u(t) + h du/dt = u(t) + hg(u, t)
Per step error is O(h2
)
Require one force evaluation per time step
Problem is numerical instability
depends on step size
17
Improved Euler
u(t + h) ≈ u(t) + h/2(g(u, t) + g(u, t+h))
Per step error is O(h3
)
Also allows for larger step sizes
But requires two function evaluations per step
Also known as Runge-Kutta method of order 2
18
Contraints
• Easy in computer graphics to ignore physical reality
• Surfaces are virtual
• Must detect collisions separately if we want exact solution
• Can approximate with
repulsive forces
19
Collisions
Once we detect a collision, we can calculate new path
Use coefficient of resititution
Reflect vertical component
May have to use partial time step
20
Contact Forces
21

More Related Content

What's hot

Quicksort analysis
Quicksort analysisQuicksort analysis
Quicksort analysis
Premjeet Roy
 

What's hot (19)

Lagrangian Mechanics
Lagrangian MechanicsLagrangian Mechanics
Lagrangian Mechanics
 
Spooky action from a distance
Spooky action from a distanceSpooky action from a distance
Spooky action from a distance
 
thermodynamics
thermodynamicsthermodynamics
thermodynamics
 
Introduction to Diffusion Monte Carlo
Introduction to Diffusion Monte CarloIntroduction to Diffusion Monte Carlo
Introduction to Diffusion Monte Carlo
 
Quantum mechanics
Quantum mechanicsQuantum mechanics
Quantum mechanics
 
Physics Quantum mechanics
Physics Quantum mechanicsPhysics Quantum mechanics
Physics Quantum mechanics
 
Neuromat seminar 13 11-2017
Neuromat seminar 13 11-2017Neuromat seminar 13 11-2017
Neuromat seminar 13 11-2017
 
Data Structure in Quantum Computing
Data Structure in Quantum ComputingData Structure in Quantum Computing
Data Structure in Quantum Computing
 
Ensemble Data Assimilation on a Non-Conservative Adaptive Mesh
Ensemble Data Assimilation on a Non-Conservative Adaptive MeshEnsemble Data Assimilation on a Non-Conservative Adaptive Mesh
Ensemble Data Assimilation on a Non-Conservative Adaptive Mesh
 
Nonsmooth and level-resolved dynamics of a driven tight binding model
Nonsmooth and level-resolved dynamics of a driven tight binding modelNonsmooth and level-resolved dynamics of a driven tight binding model
Nonsmooth and level-resolved dynamics of a driven tight binding model
 
Quantum Mechanics
Quantum MechanicsQuantum Mechanics
Quantum Mechanics
 
Quicksort analysis
Quicksort analysisQuicksort analysis
Quicksort analysis
 
Quantum
QuantumQuantum
Quantum
 
Proposed experiments to prove the grid dimensions theory
Proposed experiments to prove the grid dimensions theory Proposed experiments to prove the grid dimensions theory
Proposed experiments to prove the grid dimensions theory
 
Application of particle swarm optimization in 3 dimensional travelling salesm...
Application of particle swarm optimization in 3 dimensional travelling salesm...Application of particle swarm optimization in 3 dimensional travelling salesm...
Application of particle swarm optimization in 3 dimensional travelling salesm...
 
A short introduction to Quantum Computing and Quantum Cryptography
A short introduction to Quantum Computing and Quantum CryptographyA short introduction to Quantum Computing and Quantum Cryptography
A short introduction to Quantum Computing and Quantum Cryptography
 
SHAILESH RAJ
SHAILESH RAJSHAILESH RAJ
SHAILESH RAJ
 
Quantum Computation and Algorithms
Quantum Computation and Algorithms Quantum Computation and Algorithms
Quantum Computation and Algorithms
 
The Wave Mechanics of Large-scale Structure
The Wave Mechanics of Large-scale StructureThe Wave Mechanics of Large-scale Structure
The Wave Mechanics of Large-scale Structure
 

Similar to Particle Systems

Background Physics Information
Background Physics InformationBackground Physics Information
Background Physics Information
jflewelling
 
Variable mass system
Variable mass systemVariable mass system
Variable mass system
pastimespace
 
Presentation on SOM
Presentation on SOMPresentation on SOM
Presentation on SOM
ArchiLab 7
 

Similar to Particle Systems (20)

Mass Resconstruction with HEP detectors
Mass Resconstruction with HEP detectorsMass Resconstruction with HEP detectors
Mass Resconstruction with HEP detectors
 
Applications Of Computer Science in Astronomy
Applications Of Computer Science in AstronomyApplications Of Computer Science in Astronomy
Applications Of Computer Science in Astronomy
 
Background Physics Information
Background Physics InformationBackground Physics Information
Background Physics Information
 
Neural ODE
Neural ODENeural ODE
Neural ODE
 
Finite element method (matlab) milan kumar rai
Finite element method (matlab) milan kumar raiFinite element method (matlab) milan kumar rai
Finite element method (matlab) milan kumar rai
 
Reinforcement Learning and Artificial Neural Nets
Reinforcement Learning and Artificial Neural NetsReinforcement Learning and Artificial Neural Nets
Reinforcement Learning and Artificial Neural Nets
 
01-Chapter 01 Moaveni.pdf
01-Chapter 01 Moaveni.pdf01-Chapter 01 Moaveni.pdf
01-Chapter 01 Moaveni.pdf
 
Adamek_SestoGR18.pdf
Adamek_SestoGR18.pdfAdamek_SestoGR18.pdf
Adamek_SestoGR18.pdf
 
Atomic structure
Atomic structureAtomic structure
Atomic structure
 
NANO266 - Lecture 6 - Molecule Properties from Quantum Mechanical Modeling
NANO266 - Lecture 6 - Molecule Properties from Quantum Mechanical ModelingNANO266 - Lecture 6 - Molecule Properties from Quantum Mechanical Modeling
NANO266 - Lecture 6 - Molecule Properties from Quantum Mechanical Modeling
 
Variable mass system
Variable mass systemVariable mass system
Variable mass system
 
Engg Mechanic Lecture 1.pptx
Engg Mechanic Lecture 1.pptxEngg Mechanic Lecture 1.pptx
Engg Mechanic Lecture 1.pptx
 
Ceplerley lecture
Ceplerley lectureCeplerley lecture
Ceplerley lecture
 
Presentation on SOM
Presentation on SOMPresentation on SOM
Presentation on SOM
 
lectI
lectIlectI
lectI
 
Fem 1
Fem 1Fem 1
Fem 1
 
Wamit
WamitWamit
Wamit
 
Chapter 12 kinematics of a particle part-i
Chapter 12 kinematics of a particle   part-iChapter 12 kinematics of a particle   part-i
Chapter 12 kinematics of a particle part-i
 
Mekanika Teknik Kuliah perdana nomor 1.ppt
Mekanika Teknik Kuliah perdana nomor 1.pptMekanika Teknik Kuliah perdana nomor 1.ppt
Mekanika Teknik Kuliah perdana nomor 1.ppt
 
Physics for Game: Part1 - Basics
Physics for Game: Part1 - BasicsPhysics for Game: Part1 - Basics
Physics for Game: Part1 - Basics
 

More from Syed Zaid Irshad

Basic Concept of Information Technology
Basic Concept of Information TechnologyBasic Concept of Information Technology
Basic Concept of Information Technology
Syed Zaid Irshad
 
Introduction to ICS 1st Year Book
Introduction to ICS 1st Year BookIntroduction to ICS 1st Year Book
Introduction to ICS 1st Year Book
Syed Zaid Irshad
 

More from Syed Zaid Irshad (20)

Operating System.pdf
Operating System.pdfOperating System.pdf
Operating System.pdf
 
DBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_SolutionDBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_Solution
 
Data Structure and Algorithms.pptx
Data Structure and Algorithms.pptxData Structure and Algorithms.pptx
Data Structure and Algorithms.pptx
 
Design and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptxDesign and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptx
 
Professional Issues in Computing
Professional Issues in ComputingProfessional Issues in Computing
Professional Issues in Computing
 
Reduce course notes class xi
Reduce course notes class xiReduce course notes class xi
Reduce course notes class xi
 
Reduce course notes class xii
Reduce course notes class xiiReduce course notes class xii
Reduce course notes class xii
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
 
C Language
C LanguageC Language
C Language
 
Flowchart
FlowchartFlowchart
Flowchart
 
Algorithm Pseudo
Algorithm PseudoAlgorithm Pseudo
Algorithm Pseudo
 
Computer Programming
Computer ProgrammingComputer Programming
Computer Programming
 
ICS 2nd Year Book Introduction
ICS 2nd Year Book IntroductionICS 2nd Year Book Introduction
ICS 2nd Year Book Introduction
 
Security, Copyright and the Law
Security, Copyright and the LawSecurity, Copyright and the Law
Security, Copyright and the Law
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
 
Data Communication
Data CommunicationData Communication
Data Communication
 
Information Networks
Information NetworksInformation Networks
Information Networks
 
Basic Concept of Information Technology
Basic Concept of Information TechnologyBasic Concept of Information Technology
Basic Concept of Information Technology
 
Introduction to ICS 1st Year Book
Introduction to ICS 1st Year BookIntroduction to ICS 1st Year Book
Introduction to ICS 1st Year Book
 
Using the set operators
Using the set operatorsUsing the set operators
Using the set operators
 

Recently uploaded

Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 

Recently uploaded (20)

Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdf
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 

Particle Systems

  • 2. Introduction • Most important of procedural methods • Used to model • Natural phenomena • Clouds • Terrain • Plants •Crowd Scenes •Real physical processes 2
  • 3. Newtonian Particle • Particle system is a set of particles • Each particle is an ideal point mass • Six degrees of freedom • Position • Velocity • Each particle obeys Newtons’ law f = ma 3
  • 4. Particle Equations pi = (xi, yi zi) vi = dpi /dt = pi ‘ = (dxi /dt, dyi /dt , zi/dt) m vi ‘ = fi Hard part is defining force vector 4
  • 5. Force Vector • Independent Particles • Gravity • Wind forces • O(n) calulation • Coupled Particles O(n) • Meshes • Spring-Mass Systems • Coupled Particles O(n2 ) • Attractive and repulsive forces 5
  • 6. Solution of Particle Systems float time, delta state[6n], force[3n]; state = initial_state(); for(time = t0; time<final_time, time+=delta) { force = force_function(state, time); state = ode(force, state, time, delta); render(state, time) } 6
  • 7. Simple Forces • Consider force on particle i fi= fi(pi, vi) • Gravity fi= g gi= (0, -g, 0) • Wind forces • Drag 7 pi(t0), vi(t0)
  • 8. Meshes • Connect each particle to its closest neighbors • O(n) force calculation • Use spring-mass system 8
  • 9. Spring Forces • Assume each particle has unit mass and is connected to its neighbor(s) by a spring • Hooke’s law: force proportional to distance (d = ||p – q||) between the points 9
  • 10. Hooke’s Law • Let s be the distance when there is no force f = -ks(|d| - s) d/|d| ksis the spring constant d/|d| is a unit vector pointed from p to q • Each interior point in mesh has four forces applied to it 10
  • 11. Spring Damping • A pure spring-mass will oscillate forever • Must add a damping term f = -(ks(|d| - s) + kd d·d/|d|)d/|d| • Must project velocity 11 ·
  • 12. Attraction and Repulsion • Inverse square law f = -krd/|d|3 • General case requires O(n2 ) calculation • In most problems, the drop off is such that not many particles contribute to the forces on any given particle • Sorting problem: is it O(n log n)? 12
  • 13. Boxes • Spatial subdivision technique • Divide space into boxes • Particle can only interact with particles in its box or the neighboring boxes • Must update which box a particle belongs to after each time step 13
  • 14. Linked Lists • Each particle maintains a linked list of its neighbors • Update data structure at each time step • Must amortize cost of building the data structures initially 14
  • 15. Particle Field Calculations • Consider simple gravity • We don’t compute forces due to sun, moon, and other large bodies • Rather we use the gravitational field • Usually we can group particles into equivalent point masses 15
  • 16. Solution of ODEs • Particle system has 6n ordinary differential equations • Write set as du/dt = g(u,t) • Solve by approximations using Taylor’s Thm 16
  • 17. Euler’s Method u(t + h) ≈ u(t) + h du/dt = u(t) + hg(u, t) Per step error is O(h2 ) Require one force evaluation per time step Problem is numerical instability depends on step size 17
  • 18. Improved Euler u(t + h) ≈ u(t) + h/2(g(u, t) + g(u, t+h)) Per step error is O(h3 ) Also allows for larger step sizes But requires two function evaluations per step Also known as Runge-Kutta method of order 2 18
  • 19. Contraints • Easy in computer graphics to ignore physical reality • Surfaces are virtual • Must detect collisions separately if we want exact solution • Can approximate with repulsive forces 19
  • 20. Collisions Once we detect a collision, we can calculate new path Use coefficient of resititution Reflect vertical component May have to use partial time step 20