Physics

/Physics
­

Let’s talk physics: Elastic Collision

It has been some time since I last made a post. I have been a bit busy with college and some personal projects, but I have some time now to talk about the last subject of what I wanted to share about physics: Elastic collision.

Just like previously, let’s take a look at what Wikipedia has to say about Elastic Collision:

An elastic collision is an encounter between two bodies in which the total kinetic energy of the two bodies after the encounter is equal to their total kinetic energy before the encounter. Elastic collisions occur only if there is no net conversion of kinetic energy into other forms.

During the collision of small objects, kinetic energy is first converted to potential energy associated with a repulsive force between the particles (when the particles move against this force, i.e. the angle between the force and the relative velocity is obtuse), then this potential energy is converted back to kinetic energy (when the particles move with this force, i.e. the angle between the force and the relative velocity is acute).

To fully understand this, you must understand what kinetic energy is. I’ll let you follow the link in the Wikipedia quote if you want a broad explanation on the matter, but for the most basic explanation, you can think of it that every moving object has energy due to its motion. This energy can be transferred to another object on impact and that is exactly what we are going to do here.

To calculate the new motion of an object after collision, we will need to know at least the mass and the current velocity. Let’s initialize some spheres for our simulation:

In here I simply put some random position values

By |March 29th, 2012|Categories: Physics, Programming|Comments Off on Let’s talk physics: Elastic Collision

Let’s talk physics: Soft Body Dynamics

Welcome back to another post about physics and this time I will be talking about Soft Body Dynamics. Soft Body Dynamics can be done in several approaches, the one I am going to discuss here is the Mass-Spring approach. Just like last time I’m going to take a look at what wikipedia has to say about these 2 topics:

About Soft Body Dynamics:

Soft body dynamics is a field of computer graphics that focuses on visually realistic physical simulations of the motion and properties of deformable objects (or soft bodies). The applications are mostly in video games and film. Unlike in simulation of rigid bodies, the shape of soft bodies can change, meaning that the relative distance of two points on the object is not fixed. While the relative distances of points are not fixed, the body is expected to retain its shape to some degree (unlike a fluid). The scope of soft body dynamics is quite broad, including simulation of soft organic materials such as muscle, fat, hair and vegetation, as well as other deformable materials such as clothing and fabric. Generally, these methods only provide visually plausible emulations rather than accurate scientific/engineering simulations, though there is some crossover with scientific methods, particularly in the case of finite element simulations. Several physics engines currently provide software for soft-body simulation.

About Mass-Springs:

In this approach, the body is modeled as a set of point masses (nodes) connected by ideal weightless elastic springs obeying some variant of Hooke’s law. The nodes may either derive from the edges of a two-dimensional polygonal mesh representation of the surface of the object, or from a three-dimensional network of nodes

By |October 19th, 2011|Categories: Physics, Programming|2 Comments

Let’s talk physics: Orbital Motion

Welcome back to a new post about physics. Last time I talked about Ballistic Motion in it’s simplest form: Dropping a ball under the influence of gravity. This time I will explain Orbital motion or more specifically, the n-body problem. Just like last time, let’s take a look at what wikipedia has to say about it:

About orbit:

In physics, an orbit is the gravitationally curved path of an object around a point in space, for example the orbit of a planet around the center of a star system, such as the Solar System. Orbits of planets are typically elliptical.

Current understanding of the mechanics of orbital motion is based on Albert Einstein‘s general theory of relativity, which accounts for gravity as due to curvature of space-time, with orbits following geodesics. For ease of calculation, relativity is commonly approximated by the force-based theory of universal gravitationbased on Kepler’s laws of planetary motion

About the n-body problem:

The n-body problem is the problem of predicting the motion of a group of celestial objects that interact with each other gravitationally. Solving this problem has been motivated by the need to understand the motion of the Sun, planets and the visible stars. Its first complete mathematical formulation appeared in Isaac Newton‘s Principia (the n-body problem in general relativity is considerably more difficult).[citation needed] Since gravity was responsible for the motion of planets and stars, Newton had to express gravitational interactions in terms of differential equations. Newton proved in thePrincipia that a spherically-symmetric body can be modelled as a point mass.

So what we’ll

By |October 6th, 2011|Categories: Physics, Programming|2 Comments

Let’s talk physics: Ballistic Motion

Welcome to the first actual post on physics and in this part I’ll be talking about Ballistic Motion. Just like I did, you might think to yourself: “What is Ballistic Motion?” Let’s take a look at what Wikipedia has to say.

Ballistics (gr. βάλλειν (‘ba’llein’), “throw”) is the science of mechanics that deals with the flight, behavior, and effects of projectiles, especially bulletsgravity bombsrockets, or the like; the science or art of designing and accelerating projectiles so as to achieve a desired performance.

ballistic body is a body which is free to move, behave, and be modified in appearance, contour, or texture by ambient conditions, substances, or forces, as by the pressure of gases in a gun, by rifling in a barrel, by gravity, by temperature, or by air particles. A ballistic missile is a missile only guided during the relatively brief initial powered phase of flight, whose course is subsequently governed by the laws of classical mechanics.

If you’re not familiar with physics, this might be some information to swallow, but let’s narrow it down to what I’ll be discussing here: How can we make an object (in this case, a ball) fall and bounce on the ground. That narrows it down quite a bit doesn’t it? So what you will see here will be 2 different implementations of a ball that falls down to the ground under the influence of gravity and bounces when it hits the ground. These 2 different implementations will be the Euler Integrator and the Perfect Integrator.

Euler Integrator

So we want to make the ball bounce in the most simplest way, but still convincing. First let’s define some things

By |October 2nd, 2011|Categories: Physics, Programming|1 Comment