Numerical Methods for Supercomputers
Graphics Assignment 3
Dr. Ed Donley
Due ***

Suppose a unit square metal plate is in an environment in which the edges are kept at temperatures f1, f2, f3, and f4, as in the illustration below

and the two unit-square faces are insulated. Once the temperature has reached a steady state, the temperature at any point in the square satisfies Laplace's equation,

(d/dx)^2 u + (d/dy)^2 u = 0, u(0,y)=f1(y),
u(x,0)=f2(x), u(1,y)=f3(y), u(x,1)=f4(x), 0<x<1, 0<y<1

An approximation to the temperature can be obtained by partitioning the square with a lattice, say with N+1 intervals in each direction and replacing the partial derivatives above with second centered differences, as discussed in class.

Write a program which will solve the resulting system of linear equations for any N using SOR with red-black coloring. Use any functions you want for u1, u2, u3, and u4. For this approximation to Laplace's equation it has been shown that the optimal value of omega is 2/(1 + sqrt(1-rho(B_gs))) where rho(B_gs) = [rho(B_j)]^2 and rho(B_j) = cos(pi/(N+1)). Furthermore, for this value of omega, rho(B_omega) = omega - 1. Solve the problem for N = 50 and generate a color animation showing SOR converging to the solution using colors to represent temperatures. Hand in your source program and the name of the CGM graphics metafile so that I can see your plot.