We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Diffusion (Read 665 times)
Diffusion
Jul 20th, 2007, 4:44pm
 
Was wondering if anyone has developed a script to model the diffusion of - for example
1) heat through a half-space
2) the diffusion of heat from circular heat source in a media
In particular, I'd like code that uses the diffusion equation as the starting point.  More to the point, I'm not looking for something that is diffusionesque.

Thanks very much

M
Re: Diffusion
Reply #1 - Jul 23rd, 2007, 12:37am
 
Unfortunately the last time I did a diffusion equation simulation it was in Basic, and the code is long gone.  But if I recall, depending on your purposes, a straightforward finite difference approach is usually good enough for diffusion, assuming you respect the required space/time step sizes to achieve stability - if you're unfamiliar with this stuff, http://www.me.ucsb.edu/~moehlis/APC591/tutorials/tutorial5/node3.html has a pretty good explanation of how to apply this to the heat equation in 1 dimension.  The transition to several dimensions is trivial once you understand the method, though feel free to ask if you run into trouble.

BTW, is there any particular reason you need to simulate this?  I'm pretty sure diffusion from a circular source is solvable analytically.

Re: Diffusion
Reply #2 - Jul 26th, 2007, 4:20pm
 
Hi

Thanks very much for the help.  I'm new to Processing and still trying to absorb what it can and can't do.  Most of my day is spent using Mathematica, where I can employ a solver to the differential equation.  In any case, your solution of using the discretized form of the equation is the way to go.  With respect to the question of using the analytic solution, I tend to use odd boundary conditions, so unfortunately, the equation needs to be solved numerically.  Appreciate the reply and help.

M
Page Index Toggle Pages: 1