Contents
An Easy Way Of Solving Complex Mathematical Models: The Finite Difference Scheme
 
 
Printer-Friendly VersionPrinter-Friendly Version
 
Latest News
spacer View All spacer
 
November 22, 2009
 
Video Game Watchdog National Institute On Media And The Family Shutting Down [11]
 
Modern Warfare 2 Infinity Ward's 'Most Successful PC Version' Yet [12]
 
New Tech, Design Details Of Project Natal To Emerge At Gamefest In February
spacer
Latest Jobs
spacer View All     Post a Job     RSS spacer
 
November 22, 2009
 
Trion Redwood City
Sr. Evnironment Modeler
 
Trion Redwood City
Sr. Environment Artist
 
Sucker Punch Productions
3D Environment Artist
 
Sucker Punch Productions
Network Programmer
 
Sucker Punch Productions
Character Artist
 
Sucker Punch Productions
Texture Artist
 
Monolith Productions
Sr. Software Engineer, Engine - Monolith Productions - #113767
 
Sony Online Entertainment
Brand Manager
spacer
Latest Features
spacer View All spacer
 
November 22, 2009
 
arrow Upping The Craft: Susan O'Connor On Games Writing [6]
 
arrow Small Developers: Minimizing Risks in Large Productions - Part II [7]
 
arrow iPhone Piracy: The Inside Story [48]
 
arrow And Yet It Grows: Analyzing the Size and Growth of the European Game Market [5]
 
arrow NPD: Behind the Numbers, October 2009 [13]
 
arrow Reflecting On Uncharted 2: How They Did It [5]
 
arrow Sponsored Feature: Rasterization on Larrabee -- Adaptive Rasterization Helps Boost Efficiency
 
arrow Postmortem: Wadjet Eye's The Blackwell Convergence [2]
spacer
Latest Blogs
spacer View All     Post     RSS spacer
 
November 22, 2009
 
Time Fcuk
 
Accepting the Inherent Value of Games
 
Planckogenesis, Part II: Song Structure & Gravy Train [1]
spacer
About
spacer News Director:
Leigh Alexander
Features Director:
Christian Nutt
Editor At Large:
Chris Remo
Advertising:
John 'Malik' Watson
Recruitment/Education:
Gina Gross
 
Features
  An Easy Way Of Solving Complex Mathematical Models: The Finite Difference Scheme
by Raka Jovanovic
0 comments
Share RSS
 
 
June 18, 2008 Article Start Previous Page 2 of 3 Next
 

Heat Equation

While the trampoline is a good example for showing the power of using PDE, it is too complicated for the first contact with the implementation of this type of equation with FDS method.

Learning new methods is best with a simple example, and one of the simplest PDE is the Heat Equation, it models the problem of heat distribution. We shall solve it in one dimension, and in that case the equation looks like this:

Advertisement

Here u(x,t) represents the heat distribution or what temperature is at each point of space at different moments in time. What do we wish to see in real time games? How things change over time. That is just what this equation shows us, the change. ut is called the partial differential of u over t, and it represents how u changes over time (t). It is equal to:

Since we are interested in viewing the heat distribution, we should first find a representation of u , in some useful way. Let's say that un(x) = u(x,dt*n) , where dt is our time step and n is some fixed number (it is not the same as t which is a variable).

This way n*dt just represents some moment in time. Now we want to observe how the heat is distributed in space at that moment. The best way to do this is to use of a grid, xi = x0+i*h , where h is the step in the grid.

The heat distribution at moment n can be seen as an array of points uin = un(xi) . This is best understood by looking at this image:

Now we get to the Finite Difference Scheme. The idea is to approximate ut at each point in the grid. Using the time step dt we have the following approximation for equation (2):

This is actually a good approximation if dt is small. The next thing that we notice in the equation is uxx . This is called the second partial derivative of u over x .

This is nothing more that doing the partial derivative twice on u over x . The partial derivative of u over x , represents how u changes over space( x ). The approximation will be exactly that.

Now we can write the approximated version of equation (1) at every point in the grid.

We are at a point from where we can take a time step, or to move from a moment n at which we know how u looks, to moment n + 1 where we don't know how u looks. If we look closely at the equation (5) we notice that there is only one element that is at the time step n + 1 . So let us solve it:

Equation (6) is the end of the simple use of FDS. Now we can add a mathematical "trick" to make it more precise. First let us take a look at equation (6), it is actually very similar to the approximation of the Euler method.

So we can use an approximation of Runge-Kutta (another time step method) instead to make it more accurate. It is calculated by the following formulas:

 
Article Start Previous Page 2 of 3 Next
 
Comments

none
 
Comment:
 


Submit Comment