Example: Heat Flow on a Square Plate - I
Solve for the steady-state temperature distribution of a square plate using the partial differential equation solver
multigrid.
Solving Laplace's Equation
Find the temperature T(x,y) of a square plate with a constant internal heat source. The boundary of the source is pinned at zero degrees.
1. Define the dimension of the square plate:
2. Write a Laplace equation, in two variables, to represent points on the plate that are free of the heat source:
3. Set the dimensions of the heat source ρ:
4. Define the position of the heat source:
5. Define the strength of the heat source:
6. Set the number of cycles at each level of multigrid iteration:
7. Use function multigrid to find the solution:
8. Create a 3D plot to show the heat distribution over the square plate:
9. Create a contour plot to show the lines of constant temperature:
10. Define a different configuration of heat sources positioned at different locations:
11. Set the number of cycles at each level of the multigrid iteration:
12. Use function multigrid to find the solution:
13. Create a 3D plot to show the heat distribution over the square plate:
14. Create a contour plot to show the lines of constant temperature: