Code covered by the BSD License  

Highlights from
Diffusion in 1D and 2D

5.0 | 3 ratings Rate this file 134 Downloads (last 30 days) File Size: 3.44 KB File ID: #38088 Version: 1.0
image thumbnail

Diffusion in 1D and 2D


Suraj Shankar (view profile)


The parabolic diffusion equation is simulated in both 1D and 2D

| Watch this File

File Information

The diffusion equation is simulated using finite differencing methods (both implicit and explicit) in both 1D and 2D domains. In both cases central difference is used for spatial derivatives and an upwind in time.

Required Products MATLAB
MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
26 Feb 2014 Xin Jin  
12 Dec 2013 Steven

Steven (view profile)

Those modifications are for the Diffusion_2D.m

Comment only
12 Dec 2013 Steven

Steven (view profile)

These are quite nice visualizations. I found it nice to increase the time step to 100 to see more progression.

For better visualization, I recommend adding the command 'clf' immediately at the beginning of the loop as well as adding these line just before and after drawnow:

pause(0.01) % or 0.1 for slower update

05 Sep 2013 Suraj Shankar

Suraj Shankar (view profile)

The code is meant to be pedagogical in nature and has been made in line with the 12-steps to Navier-Stokes practical module, for which I would like to credit Lorena Barba and her online course on CFD.

Comment only
06 Dec 2012 Tatsuo

Tatsuo (view profile)


Contact us