ClearAll["Global`*"]

2D Steady Heat Equation in a plate

In class, we solved this problem by hand. As a reminder, the problem statement and answers are:
(Subscript[L, 1]), (Subscript[L, 2]), (Subscript[T, cold]), and (Subscript[T, hot]) are all known quantities.

For this problem, the fundamental equation is (((d^2)T)/(dx^2)) + (((d^2)T)/(dy^2)) = 0.
The 4 necessary boundary conditions are:
1. T(x = 0) = (Subscript[T, cold])
2. T(x = L1) = (Subscript[T, cold])
3. T(y = L2) = (Subscript[T, cold])
4. T(y = 0) = (Subscript[T, hot])

You will recall that we invented some new variables to make our lives easier:
Θ=((T-(Subscript[T, cold]))/((Subscript[T, hot])-(Subscript[T, cold])))
Ny = ((Subscript[L, 2])/(Subscript[L, 1]))
xstar=(x/(Subscript[L, 1]))
ystar=(y/(Subscript[L, 1]))
Substitution of these definitions gave us new versions of the main equation and the boundary conditions:
(((d^2)Θ)/(dxstar^2)) + (((d^2)Θ)/(dystar^2)) = 0
1. Θ(xstar = 0) = 0
2. Θ(xstar =1) = 0
3. Θ(ystar =Ny) = 0
4. Θ(ystar = 0) = 1

So, we will solve for Θ instead of T. When we’re done, we can convert it back to T (if we care) using the definition: T = Θ*((Subscript[T, hot])-(Subscript[T, cold]))+(Subscript[T, cold])

Also, for the rest of the solution you see below, I’m too lazy to write “xstar” and “ystar”, so I’ll just be writing x and y instead, with the hope that you’ll remember that this is what I’m doing. 

Partway through our solution, we discovered that we needed an odd function that was 1 for 0 < x< 1, and we came up with this one:

lim=70;
f[x_]= (∑_(n=1)^lim)(4/((2 n - 1) π ))  Sin[(2 n - 1) π x];

Let’s see if this this solution was reasonable:

Plot[f[x],{x,-2,2},PlotStyle->Directive[RGBColor[1,0,0],AbsoluteThickness[2]],PlotRange-> {-1.2,1.2}]

OK, that looks good. We then used this function as a step along the way to discovering the final temperature field. Before I can plot it, I need to finalize my geometry by picking an actual value for the relative height “Ny”:

Ny=1.5;
Θ[x_,y_]= (∑_(n=1)^lim)((4 Sinh[(2 n - 1) π (Ny-y) ])/((2 n - 1) π  Sinh[Ny (2 n - 1) π  ]))  Sin[(2 n - 1) π x];
ContourPlot[Θ[x,y],{x,0,1},{y,0,Ny},Contours->30,ColorFunction->"Rainbow",AspectRatio->Ny]

Notice that when I rewrote it, there are no integrals remaining. I’ve already plugged in the simplified results of every integral. You’ll need to do that too!

We can easily discover the value at any position:

Θ[.3,.6]

We could also get answers in “real units”, although the Θ we calculated was good for any units. Suppose we were actually given the following: (Subscript[T, hot])=450 K, (Subscript[T, cold])=270 K, (Subscript[L, 1])=5 m wide, and (Subscript[L, 2])=7.5 m tall. You’ll notice that this width and height are acceptable because their ratio “Ny” is 1.5, just like we used in the above plot. 
Then, corresponding to the values we just calculated, when xstar = 0.3, then (Subscript[x, actual]) = (0.3)(5m) = 1.5m, and when ystar = 0.6, then (Subscript[x, actual]) = (0.6)(7.5m) = 4.5m. Similarly, when Θ = 0.156, then

(Subscript[T, actual]) = Θ*((Subscript[T, hot])-(Subscript[T, cold]))+(Subscript[T, cold])   = (0.156306)*(450 K - 270 K) + 270K = 298.135K

The main thing to notice about this is that Θ tells you the fraction of the temperature range that T is above the minimum. Specifically, for this point, the actual temperature is about 15% warmer than the minimum, where 100% warmer would be the same as being at (Subscript[T, hot]).

Thot=450;Tcold=270;
Tactual = Θ[.3,.6](Thot-Tcold) + Tcold

The closer we get to the bottom, the warmer the temperature is (i.e., it approaches 100% warmer than the coldest temperature):

Θ[.1,.005] (* within 0.5% of the bottom edge, most of the way to the left of center *)
Θ[.55,.005] (* within 0.5% of the bottom edge, a little to the right of the center *)