To find the temperature of the wall as a function of position when dealing with transient two-dimensional heat conduction in MATLAB, you can use the finite difference method.
Assuming that the wall is a rectangular plate with uniform thermal conductivity, you can discretize the plate using a meshgrid, where each node corresponds to a temperature value. Then, apply the heat conduction equation to each node, considering the temperature values of its adjacent nodes. This will give you a system of linear equations that can be solved iteratively using numerical methods (such as Gauss-Seidel or Jacobi) until a steady state solution is reached.
Here is some sample code that solves the 2D transient heat conduction problem for a rectangular plate:
main.m1292 chars53 lines
This code creates a rectangular plate with length L
and width W
, and solves the heat conduction equation iteratively using finite differences until a steady state solution is reached (or until a certain time tEnd
is reached). The resulting temperature distribution is plotted using surf
.
Note that the code assumes uniform thermal conductivity and neglects any internal heat sources or sinks.
gistlibby LogSnag