When Karl Sims did his award-winning computer animation ”Particle Dreams” twenty(!) years ago, he tortured a Connection Machine CM-2 computer with as many as 65,536 processors, using one processor for the simulation of each particle.
Today we simulate tens of thousands of particles in real-time on a single cpu – even in a browser plugin – and advanced particle systems have become common practice for the simulation of snow, rain, dust, smoke, fire, and explosions in most computer games. Modern simulation environments like Processing can be used to produce such astonishingly addicting games as Falling Sand Game, sodaplay, BallDroppings, and Souptoys.
In 2006, Traer Bernstein wrote a pretty impressing particle physics library for Processing, which actually was the inspiration for this particle system toolbox in Matlab. As a matter of fact, object oriented programming in Matlab is not really the fastest lane on the particle system highway; we are back at the good old days of some ten or twenty real-time particles. But – the main purpose of this toolbox has never been to develop state-of-the-art computer games; it was rather planned as an educational, interactive learning-by-doing playground, with the aim to understand the mechanical interactions (and maybe the mathematical background) of the particle system components. Have fun!
Inhaltsverzeichnis (Table of Contents)
- Genesis
- Particle System Creation
- Particle Creation
- Spring Creation
- Attraction Creation
- Simulation...
- Demos
- Demo 1: Free Fall.
- Demo 2: Bullet Time
- Demo 3: Bungee Jumping
- Demo 4: Gimme ya Energy!
- Demo 5: Magic Chain Cable
- Demo 6: Heavy Chain Mail
- Demo 7: Don't Touch me!
- Demo 8: Keep it up.
- Demo 9: Catch me if you Can (There's a Hole in the Bucket)
- Demo 10: The Hose...
- Demo 11: Polyhedrons
- Number of Particles: 3
- Number of Particles: 4
- Number of Particles: 5
- Number of Particles: 6
- Number of Particles: 8
- Number of Particles: 12
- Number of Particles: 20
- Demo 12: Three-Body Eight
- Mathematical Background
- May the Force be with you...
- Gravity
- Inertial Force
- Spring Force.
- Attraction Force
- Damping Force
- Differential Equations.
- May the Force be with you...
- Particle System Object
- Class Definition particle_system
- Properties particle_system
- Constructor particle_system
- Method get_particles_positions
- Method get_particles_velocities.
- Methods kill_spring, kill_attraction
- Method kill_particle...
- Method advance_time.
- Particle System Object (Private Methods)
- Private Method kill_old_particles.
- Private Method get_phase_space_state
- Private Method compute_state_derivative
- Private Method set_phase_space_state
- Private Method aggregate_forces...
- Private Method clear_particle_forces
- Private Method aggregate_springs_forces
- Private Method aggregate_attractions_forces
- Private Method aggregate_drag_forces.
- Private Method aggregate_gravity_forces
- Private Method get_particles_accelerations
- Private Method advance_particles_ages
- Private Method update_graphics_positions
- Particle Object
- Class Definition and Properties particle.
- Constructor particle
- Private Method append
- Methods add_force, clear_force
- Method delete...
- Method set.fixed
- Method set.position.
- Method update_graphics_position
- Spring Object
- Class Definition and Properties spring
- Constructor spring
- Private Method append
- Method delete...
- Method update_graphics_position
- Attraction Object
- Class Definition and Properties attraction
- Constructor attraction
- Private Method append
- Method delete...
- Method update_graphics_position
Zielsetzung und Themenschwerpunkte (Objectives and Key Themes)
This toolbox aims to provide an educational and interactive learning experience, allowing users to explore the mechanics and mathematical principles behind particle systems. By implementing a particle system in MATLAB, the toolbox encourages hands-on learning and understanding of how these systems work.
- Particle System Simulation: The toolbox focuses on simulating particle systems and their interactions, highlighting the fundamental concepts of particle physics.
- Object-Oriented Programming in MATLAB: The toolbox demonstrates the application of object-oriented programming principles in MATLAB, providing practical insights into this approach.
- Real-Time Particle Simulation: While acknowledging limitations, the toolbox explores techniques for achieving real-time particle simulation within MATLAB's environment.
- Educational Value: The toolbox emphasizes its educational purpose, serving as a learning platform for understanding particle systems and their applications.
- Interactive Exploration: The toolbox promotes interactive exploration and experimentation with particle systems, allowing users to modify parameters and observe the results.
Zusammenfassung der Kapitel (Chapter Summaries)
The first chapter, Genesis, covers the foundational concepts and processes involved in creating and simulating particle systems. It delves into the creation of particles, springs, attractions, and the overall simulation process. The chapter serves as a foundation for understanding the core components of the toolbox.
Chapter 2, Demos, presents a collection of interactive demonstrations showcasing various particle system scenarios. Each demo highlights a different aspect of particle behavior and interaction, providing practical examples of how the toolbox can be used.
Chapter 3, Mathematical Background, explores the theoretical underpinnings of particle system simulation, outlining the forces at play and the differential equations that govern particle motion. This chapter provides a deeper understanding of the underlying mathematical concepts.
Chapter 4, Particle System Object, details the implementation of the particle system class in MATLAB. It describes the class properties, constructors, and methods for controlling and manipulating the particle system.
Chapter 5, Particle System Object (Private Methods), delves into the private methods of the particle system class. These methods handle internal operations, such as force aggregation, state calculation, and graphics updates.
Chapter 6, Particle Object, explains the implementation of the particle class, which represents individual particles in the system. It outlines the properties, constructors, and methods associated with particle management.
Chapter 7, Spring Object, describes the implementation of the spring class, which represents the spring force between particles. It provides details on spring properties, constructors, and methods.
Chapter 8, Attraction Object, covers the implementation of the attraction class, which represents the attraction force between particles. It explains the properties, constructors, and methods associated with attraction forces.
Schlüsselwörter (Keywords)
This toolbox revolves around particle system simulation, object-oriented programming, real-time visualization, and educational applications. Key concepts include particle creation, force integration, spring and attraction forces, and interactive demos. The toolbox provides a platform for understanding particle systems, their dynamics, and their implementation using MATLAB.
- Quote paper
- Prof. Dr.-Ing. Jörg Buchholz (Author), 2008, Matlab Particles 2.0, Munich, GRIN Verlag, https://www.grin.com/document/82817