To solve a 2D heat equation with Implicit Euler in time and Central Differencing in space using a Jacobi solver, the MATLAB code can look like the following:
main.m1540 chars41 lines
The jacobi_solve
function can be defined as follows:
main.m923 chars40 lines
This code will plot the temperature on the plate at t=0, 1, 2, 5, 10, and 100 seconds. The resulting plot is a 3D surface with x-axis and y-axis representing the spatial coordinates and the z-axis representing the temperature at each point in space and time.
gistlibby LogSnag