NotebookDirectory[]

Equilibrium temperature distribution - 2D problem

The problem

The objective is to solve the PDE 

(((∂^2)u)/(∂(x^2)))(x,y)+(((∂^2)u)/(∂(y^2)))(x,y)=0  on  {(x,y) ∈  | 0≤x ≤K, 0 ≤y≤L},

subject to the conditions

u(x,0) = (Subscript[f, 1])(x), u(x,L)=(Subscript[f, 2])(x)   (call these Boundary Conditions for x) 

u(0,y) = (Subscript[g, 1])(y), u(K,y)=(Subscript[g, 2])(y)  (call these Boundary Conditions for y)

The trick is to split this problem into two problems

Problem 1

In this part, Problem 1, the objective is to solve the PDE 

(((∂^2)u)/(∂(x^2)))+(((∂^2)u)/(∂(y^2)))=0  on  0≤x ≤K, 0 ≤y≤L,

subject to the conditions

u(x,0) = (Subscript[f, 1])(x), u(x,L)=(Subscript[f, 2])(x) (call these Boundary Conditions for x) 

u(0,y) = 0, u(K,y)=0  (call these Zero Boundary Conditions for y)

Step 1. First ignore  Boundary Conditions for x and solve

(((∂^2)u)/(∂(x^2)))+(((∂^2)u)/(∂(y^2)))=0  on  0≤x ≤K, 0 ≤y≤L,
subject to the conditions
u(0,y) = 0, u(K,y)=0  (Zero Boundary Conditions for y)

Using the Separation of Variables (SofV) method we find a “few” solutions of this problem. These are two sequences of solutions: (below n ∈ℕ)

Sin[((n Pi)/K)x] ((Sinh[((n Pi)/K)y])/(Sinh[((n Pi)/K)L]))

Sin[((n Pi)/K)x] ((Sinh[((n Pi)/K)(L-y)])/(Sinh[((n Pi)/K)L]))

Test these solutions: (the command below (D[#,{x,2}]+D[#,{y,2}])&[ ] calculates the second partial derivatives and adds them, the function is inclosed in the square brackets)

(D[#,{x,2}]+D[#,{y,2}])&[Sin[((n Pi)/K)x](( Sinh[((n Pi)/K)y])/( Sinh[((n Pi)/K)L]))]

Check the boundary conditions:

FullSimplify[(Sin[((n Pi)/K)x] (( Sinh[((n Pi)/K)y])/( Sinh[((n Pi)/K)L])))/.{x->{0,K}}]

We need to tell Mathematica that n is an integer.

FullSimplify[(Sin[((n Pi)/K)x] (( Sinh[((n Pi)/K)y])/( Sinh[((n Pi)/K)L])))/.{x->{0,K}},n∈Integers]

Verify the sequence of second solutions:

(D[#,{x,2}]+D[#,{y,2}])&[Sin[((n Pi)/K)x] ((Sinh[((n Pi)/K)(L-y)])/( Sinh[((n Pi)/K)L]))]

FullSimplify[(Sin[((n Pi)/K)x](( Sinh[((n Pi)/K)(L-y)])/(Sinh[((n Pi)/K)L])))/.{x->{0,K}},n∈Integers]

Step 2. Now that we have a “few” solutions, we form many solutions.  This is commonly known as the superposition principle:

(Subscript[u, 1])(x,y) = (∑_(n=1)^nn) (Subscript[a, n ])Sin[((n Pi)/K)x] ((Sinh[((n Pi)/K)y])/(Sinh[((n Pi)/K)L]))+(∑_(n=1)^nn) (Subscript[b, n ])Sin[((n Pi)/K)x](( Sinh[((n Pi)/K)(L-y)])/(Sinh[((n Pi)/K)L]))

Next we choose (Subscript[a, n]) and (Subscript[b, n]) such that the above function satisfies  Boundary Conditions for x. First substitute y=0. This leads to the formula for (Subscript[b, n]).

(Subscript[f, 1])(x)= u(x,0) = (∑_(n=1)^nn) (Subscript[a, n ])Sin[((n Pi)/K)x] ((Sinh[((n Pi)/K)0])/(Sinh[((n Pi)/K)L]))+(∑_(n=1)^nn) (Subscript[b, n ])Sin[((n Pi)/K)x](( Sinh[((n Pi)/K)(L-0)])/(Sinh[((n Pi)/K)L]))=(∑_(n=1)^nn) (Subscript[b, n ])Sin[((n Pi)/K)x]

Thus

(Subscript[f, 1])(x)=(∑_(n=1)^nn) (Subscript[b, n ])Sin[((n Pi)/K)x]

Multiply both sides with  Sin[((j Pi)/K)x]

(Subscript[f, 1])(x)Sin[((j Pi)/K)x] =(∑_(n=1)^nn) (Subscript[b, n ])Sin[((n Pi)/K)x]Sin[((j Pi)/K)x]

Integrate both sides from 0 to K. We need the following integrals:

(∫_0^K)(Subscript[f, 1])(x)Sin[((j Pi)/K)x]dx =(∑_(n=1)^nn) (Subscript[b, n ])(∫_0^K)Sin[((n Pi)/K)x]Sin[((j Pi)/K)x]dx

Clear[K]; FullSimplify[Integrate[Sin[((n Pi)/K)x]Sin[((j Pi)/K)x],{x,0,K}],And[n∈Integers,j∈Integers,Or[j>n,j<n]]]

Clear[K]; FullSimplify[Integrate[Sin[((n Pi)/K)x]Sin[((n Pi)/K)x],{x,0,K}],And[n∈Integers]]

Based on the above two integral calculations we have

(∫_0^K)(Subscript[f, 1])(x)Sin[((j Pi)/K)x]dx =(∑_(n=1)^nn) (Subscript[b, n ])(∫_0^K)Sin[((n Pi)/K)x]Sin[((j Pi)/K)x]dx =(Subscript[b, j ])(∫_0^K)Sin[((j Pi)/K)x]Sin[((j Pi)/K)x]dx

(∫_0^K)(Subscript[f, 1])(x)Sin[((j Pi)/K)x]dx = (Subscript[b, j ])(∫_0^K)Sin[((j Pi)/K)x]Sin[((j Pi)/K)x]dx

(∫_0^K)(Subscript[f, 1])(x)Sin[((j Pi)/K)x]dx = (Subscript[b, j ])(K/2)

Hence

(Subscript[b, j ])=(2/K)(∫_0^K)(Subscript[f, 1])(x)Sin[((j Pi)/K)x]dx  (we have the formula for (Subscript[b, j]))

Step 3. Now we substitute y = L in the formula for the solution. This will give us  (Subscript[a, n ])

(Subscript[f, 2])(x) = u(x,L) = (∑_(n=1)^nn) (Subscript[a, n ])Sin[((n Pi)/K)x] ((Sinh[((n Pi)/K)L])/(Sinh[((n Pi)/K)L]))+(∑_(n=1)^nn) (Subscript[b, n ])Sin[((n Pi)/K)x](( Sinh[((n Pi)/K)(L-L)])/(Sinh[((n Pi)/K)L])) = (∑_(n=1)^nn) (Subscript[a, n ])Sin[((n Pi)/K)x]

Thus

(Subscript[f, 2])(x) = (∑_(n=1)^nn) (Subscript[a, n ])Sin[((n Pi)/K)x]

Multiply both sides with  Sin[((j Pi)/K)x]

(Subscript[f, 2])(x)Sin[((j Pi)/K)x] =(∑_(n=1)^nn) (Subscript[a, n ])Sin[((n Pi)/K)x]Sin[((j Pi)/K)x]

Integrate both sides from 0 to K. We need the following integrals:

(∫_0^K)(Subscript[f, 2])(x)Sin[((j Pi)/K)x]dx =(∑_(n=1)^nn) (Subscript[a, n ])(∫_0^K)Sin[((n Pi)/K)x]Sin[((j Pi)/K)x]dx

We need the following integral in the sum:

Clear[K]; FullSimplify[Integrate[Sin[((n Pi)/K)x]Sin[((j Pi)/K)x],{x,0,K}],And[n∈Integers,j∈Integers,Or[j>n,j<n]]]

Clear[K]; FullSimplify[Integrate[Sin[((n Pi)/K)x]Sin[((n Pi)/K)x],{x,0,K}],And[n∈Integers]]

Based on the above two integral calculations we have

(∫_0^K)(Subscript[f, 2])(x)Sin[((j Pi)/K)x]dx =(∑_(n=1)^nn) (Subscript[a, n ])(∫_0^K)Sin[((n Pi)/K)x]Sin[((j Pi)/K)x]dx =(Subscript[a, j ])(∫_0^K)Sin[((j Pi)/K)x]Sin[((j Pi)/K)x]dx

(∫_0^K)(Subscript[f, 2])(x)Sin[((j Pi)/K)x]dx =  (Subscript[a, j ])(∫_0^K)Sin[((j Pi)/K)x]Sin[((j Pi)/K)x]dx

(∫_0^K)(Subscript[f, 2])(x)Sin[((j Pi)/K)x]dx =  (Subscript[a, j ])(K/2)

Hence

(Subscript[a, j ]) = (2/K)(∫_0^K)(Subscript[f, 2])(x)Sin[((j Pi)/K)x]dx   (we have the formula for (Subscript[a, j]))

Problem 2

In this part, Problem 2, the objective is to solve the PDE 

(((∂^2)u)/(∂(x^2)))+(((∂^2)u)/(∂(y^2)))=0  on  0≤x ≤K, 0 ≤y≤L,

subject to the conditions

u(x,0) = 0, u(x,L)=0   (Zero Boundary Conditions for x)  

u(0,y) = (Subscript[g, 1])(y), u(K,y)=(Subscript[g, 2])(y)   (Boundary Conditions for y)

Step 1. First ignore the Boundary Conditions for y  and solve

(((∂^2)u)/(∂(x^2)))+(((∂^2)u)/(∂(y^2)))=0  on  0≤x ≤K, 0 ≤y≤L,

subject to the conditions

u(x,0) = 0, u(x,L)=0   (Zero Boundary Conditions for x)

Using Separation of Variables method we find a “few” solutions of this problem:

Sin[((n Pi)/L)y] ((Sinh[((n Pi)/L)x])/(Sinh[((n Pi)/L)K]))

Sin[((n Pi)/L)y] ((Sinh[((n Pi)/L)(K-x)])/(Sinh[((n Pi)/L)K]))

Test these solutions:

The first sequence

(D[#,{x,2}]+D[#,{y,2}])&[Sin[((n Pi)/L)y](( Sinh[((n Pi)/L)x])/(Sinh[((n Pi)/L)K]))]

FullSimplify[(Sin[((n Pi)/L)y] ((Sinh[((n Pi)/L)x])/(Sinh[((n Pi)/L)K])))/.{y->{0,L}},n∈Integers]

The second sequence

(D[#,{x,2}]+D[#,{y,2}])&[Sin[((n Pi)/L)y] ((Sinh[((n Pi)/L)(K-x)])/(Sinh[((n Pi)/L)K]))]

FullSimplify[(Sin[((n Pi)/L)y] ((Sinh[((n Pi)/L)(K-x)])/(Sinh[((n Pi)/L)K])))/.{y->{0,L}},n∈Integers]

Step 2. Now that we have a “few” solutions we form many solutions.  This is commonly known as the superposition principle:

(Subscript[u, 2])(x,y) =(∑_(n=1)^nn) (Subscript[c, n ])Sin[((n Pi)/L)y] ((Sinh[((n Pi)/L)x])/(Sinh[((n Pi)/L)K]))+(∑_(n=1)^nn) (Subscript[d, n ])Sin[((n Pi)/L)y] ((Sinh[((n Pi)/L)(K-x)])/(Sinh[((n Pi)/L)K]))

Now we choose (Subscript[c, n]) and (Subscript[d, n]) such that the above function satisfies the Boundary Conditions for  conditions. First substitute x=0. This leads to the formula for (Subscript[d, n]). Then substitute x=K. This leads to the formula for (Subscript[c, n]).

Similarly as in Problem 1, we first set x=0:

(Subscript[g, 1])(y)=(Subscript[u, 2])(0,u) =(∑_(n=1)^nn) (Subscript[c, n ])Sin[((n Pi)/L)y] ((Sinh[((n Pi)/L)0])/(Sinh[((n Pi)/L)K]))+(∑_(n=1)^nn) (Subscript[d, n ])Sin[((n Pi)/L)y] ((Sinh[((n Pi)/L)(K-0)])/(Sinh[((n Pi)/L)K]))=(∑_(n=1)^nn) (Subscript[d, n ])Sin[((n Pi)/L)y]

Hence,

(Subscript[g, 1])(y)=(∑_(n=1)^nn) (Subscript[d, n ])Sin[((n Pi)/L)y]

Multiply both sides with  Sin[((j Pi)/L)y]

(Subscript[g, 1])(y)Sin[((j Pi)/L)y] =(∑_(n=1)^nn) (Subscript[d, n ])Sin[((n Pi)/L)y]Sin[((j Pi)/L)y]

Integrate both sides from 0 to L. We need the following integrals:

(∫_0^L)(Subscript[g, 1])(y)Sin[((j Pi)/L)y]dy =(∑_(n=1)^nn) (Subscript[d, n ])(∫_0^L)Sin[((n Pi)/L)y]Sin[((j Pi)/L)y]dy

We need the following integral in the sum:

Clear[L]; FullSimplify[Integrate[Sin[((n Pi)/L)y]Sin[((j Pi)/L)y],{y,0,L}],And[n∈Integers,j∈Integers,Or[j>n,j<n]]]

Clear[L]; FullSimplify[Integrate[Sin[((n Pi)/L)y]Sin[((n Pi)/L)y],{y,0,L}],And[n∈Integers]]

Based on the above two integral calculations we have

(∫_0^L)(Subscript[g, 1])(y)Sin[((j Pi)/L)y]dy =(∑_(n=1)^nn) (Subscript[d, n ])(∫_0^L)Sin[((n Pi)/L)y]Sin[((j Pi)/L)y]dy =(Subscript[d, j ])(∫_0^L)Sin[((j Pi)/L)y]Sin[((j Pi)/L)y]dy

Hence:

(∫_0^L)(Subscript[g, 1])(y)Sin[((j Pi)/L)y]dy =(Subscript[d, j ])(∫_0^L)Sin[((j Pi)/L)y]Sin[((j Pi)/L)y]dy

(∫_0^L)(Subscript[g, 1])(y)Sin[((j Pi)/L)y]dy =  (Subscript[d, j ])(L/2)

Hence

(Subscript[d, j ]) = (2/L)(∫_0^L)(Subscript[g, 1])(y)Sin[((j Pi)/L)y]dy   (we have the formula for (Subscript[d, j]))

Similarly we calculate (Subscript[c, j]): we set x=K:

(Subscript[g, 2])(y)=(Subscript[u, 2])(K,u) =(∑_(n=1)^nn) (Subscript[c, n ])Sin[((n Pi)/L)y] ((Sinh[((n Pi)/L)K])/(Sinh[((n Pi)/L)K]))+(∑_(n=1)^nn) (Subscript[d, n ])Sin[((n Pi)/L)y] ((Sinh[((n Pi)/L)(K-K)])/(Sinh[((n Pi)/L)K]))=(∑_(n=1)^nn) (Subscript[c, n ])Sin[((n Pi)/L)y]

Hence,

(Subscript[g, 2])(y)=(∑_(n=1)^nn) (Subscript[c, n ])Sin[((n Pi)/L)y]

Multiply both sides with  Sin[((j Pi)/L)y]

(Subscript[g, 2])(y)Sin[((j Pi)/L)y] =(∑_(n=1)^nn) (Subscript[c, n ])Sin[((n Pi)/L)y]Sin[((j Pi)/L)y]

Integrate both sides from 0 to L. We need the following integrals:

(∫_0^L)(Subscript[g, 2])(y)Sin[((j Pi)/L)y]dy =(∑_(n=1)^nn) (Subscript[c, n ])(∫_0^L)Sin[((n Pi)/L)y]Sin[((j Pi)/L)y]dy

We need the following integral in the sum:

Clear[L]; FullSimplify[Integrate[Sin[((n Pi)/L)y]Sin[((j Pi)/L)y],{y,0,L}],And[n∈Integers,j∈Integers,Or[j>n,j<n]]]

Clear[L]; FullSimplify[Integrate[Sin[((n Pi)/L)y]Sin[((n Pi)/L)y],{y,0,L}],And[n∈Integers]]

Based on the above two integral calculations we have

(∫_0^L)(Subscript[g, 2])(y)Sin[((j Pi)/L)y]dy =(∑_(n=1)^nn) (Subscript[c, n ])(∫_0^L)Sin[((n Pi)/L)y]Sin[((j Pi)/L)y]dy =(Subscript[c, j ])(∫_0^L)Sin[((j Pi)/L)y]Sin[((j Pi)/L)y]dy

Hence:

(∫_0^L)(Subscript[g, 2])(y)Sin[((j Pi)/L)y]dy =(Subscript[c, j ])(∫_0^L)Sin[((j Pi)/L)y]Sin[((j Pi)/L)y]dy

(∫_0^L)(Subscript[g, 2])(y)Sin[((j Pi)/L)y]dy =  (Subscript[c, j ])(L/2)

Hence

(Subscript[c, j ]) = (2/L)(∫_0^L)(Subscript[g, 2])(y)Sin[((j Pi)/L)y]dy   (we have the formula for (Subscript[c, j]))

A symbolic implementation

Here are the given quantities

Clear[lK1,lL1,f11,f21,g11,g21,nn1];

nn1=15; 

lK1 = 1; lL1 = 1;

f11[x_]=4(x^2)(1-x); 

g21[y_]=4y(((1-y))^2); 

f21[x_]=0; 

g11[y_]=0;

Clear[aa1];

aa1[n_]=FullSimplify[(2/(lK1 ))Integrate[f21[x]Sin[((n Pi)/lK1)x],{x,0,lK1}],And[n∈Integers,n>0]]

Clear[bb1];

bb1[n_]=FullSimplify[(2/(lK1 ))Integrate[f11[x]Sin[((n Pi)/lK1)x],{x,0,lK1}],And[n∈Integers,n>0]]

Clear[cc1];

cc1[n_]=FullSimplify[(2/(lL1 ))Integrate[g21[y]Sin[((n Pi)/lL1)y],{y,0,lL1}],And[n∈Integers,n>0]]

Clear[dd1];

dd1[n_]=FullSimplify[(2/(lL1 ))Integrate[g11[y]Sin[((n Pi)/lL1)y],{y,0,lL1}],And[n∈Integers,n>0]]

The solution is

Clear[uu1]; 

uu1[x_,y_]=(∑_(n=1)^nn1) aa1[n]Sin[((n Pi)/lK1)x] ((Sinh[((n Pi)/lK1)y])/(Sinh[((n Pi)/lK1)lL1]))+(∑_(n=1)^nn1) bb1[n]Sin[((n Pi)/lK1)x] ((Sinh[((n Pi)/lK1)(lL1-y)])/(Sinh[((n Pi)/lK1)lL1]))+ (∑_(n=1)^nn1) cc1[n]Sin[((n Pi)/lL1)y] ((Sinh[((n Pi)/lL1)x])/(Sinh[((n Pi)/lL1)lK1]))+(∑_(n=1)^nn1) dd1[n] Sin[((n Pi)/lL1)y] ((Sinh[((n Pi)/lL1)(lK1-x)])/(Sinh[((n Pi)/lL1)lK1]));

How good is our approximation for the function f1[x] in the boundary conditions? Here is a visual answer.

Plot[{f11[x],uu1[x,0]},{x,0,lK1},PlotStyle->{{Blue,Thickness[0.01]},{Red,Thickness[0.005]}}]

Plot[uu1[x,lL1],{x,0,lK1}]

Plot[uu1[0,y],{y,0,lL1}]

Plot[{g21[y],uu1[lK1,y]},{y,0,lL1},PlotStyle->{{Blue,Thickness[0.01]},{Red,Thickness[0.005]}}]

Plot3D[N[uu1[x,y]],{x,0,lK1},{y,0,lL1},Mesh->Automatic]

DensityPlot[N[uu1[x,y]],{x,0,lK1},{y,0,lL1},Frame->True,PlotRange->{{0,1},{0,1}},ColorFunction->(RGBColor[1,1-#,1-#]&)]

A numerical implementation

Here are the given quantities

Clear[lK2,lL2,f12,f22,g12,g22,nn2];

nn2=45; 

lK2 = Pi; lL2 = Pi;

f12[x_]=(((Sin[x]))^(1/10));g22[y_]=0; f22[x_]=0; g12[y_]=0;

Plot[f12[x],{x,0,lK2},PlotRange->{0,1.2}]

Clear[aa2];

aa2[n_]=(2/lK2)Integrate[f22[x]Sin[((n Pi)/lK2)x],{x,0,lK2}]

Clear[bbl2];

bbl2=Chop[Table[(2/lK2)NIntegrate[f12[x]Sin[((n Pi)/lK2)x],{x,0,lK2},
Method->{Automatic},MaxRecursion->200,AccuracyGoal->12,PrecisionGoal->16],{n,1,nn2}]]

Clear[cc2];

cc2[n_]=(2/(lL2 Sinh[((n Pi)/lL2)lK2]))Integrate[g22[y]Sin[((n Pi)/lL2)y],{y,0,lL2}]

Clear[dd2];

dd2[n_]=(2/(lL2 ))Integrate[g12[y]Sin[((n Pi)/lL2)y],{y,0,lL2}]

The solution is

Clear[uu2];

uu2[x_,y_]=(∑_(n=1)^nn2) aa2[n]Sin[((n Pi)/lK2)x] ((Sinh[((n Pi)/lK2)y])/(Sinh[((n Pi)/lK2)lL2]))+(∑_(n=1)^nn2) bbl2[[n]]Sin[((n Pi)/lK2)x] ((Sinh[((n Pi)/lK2)(lL2-y)])/(Sinh[((n Pi)/lK2)lL2]))+ (∑_(n=1)^nn2) cc2[n]Sin[((n Pi)/lL2)y] ((Sinh[((n Pi)/lL2)x])/(Sinh[((n Pi)/lL2)lK2]))+(∑_(n=1)^nn2) dd2[n] Sin[((n Pi)/lL2)y] ((Sinh[((n Pi)/lL2)(lK2-x)])/(Sinh[((n Pi)/lL2)lK2]));

Plot[{f12[x],uu2[x,0]},{x,0,lK2},PlotRange->{0,1.2}]

Plot[uu2[x,lL2],{x,0,lK2}]

Plot[uu2[0,y],{y,0,lL2}]

Plot[uu2[lK2,y],{x,0,lL2}]

Plot3D[N[uu2[x,y]],{x,0,lK2},{y,0,lL2}]

DensityPlot[N[uu2[x,y]],{x,0,lK2},{y,0,lL2},Frame->True,PlotRange->{{0,lK2},{0,lL2}},ColorFunction->(RGBColor[1,1-#,1-#]&)]

A symbolic implementation with a problem

Here are the given quantities

Clear[lK3,lL3,f13,f23,g13,g23,nn3];

nn3=20; 

lK3 = 1; lL3 = 1;

f13[x_]=3(x^2)+1; 

g23[y_]=4-8y (y-1); 

f23[x_]=4+8 x (x-1); 

g13[y_]=1+3(y^2);

Clear[aa3];

aa3[n_]=FullSimplify[(2/(lK3 ))Integrate[f23[x]Sin[((n Pi)/lK3)x],{x,0,lK3}],And[n∈Integers,n>0]]

Clear[bb3];

bb3[n_]=FullSimplify[(2/(lK3 ))Integrate[f13[x]Sin[((n Pi)/lK3)x],{x,0,lK3}],And[n∈Integers,n>0]]

Clear[cc3];

cc3[n_]=FullSimplify[(2/(lL3 ))Integrate[g23[y]Sin[((n Pi)/lL3)y],{y,0,lL3}],And[n∈Integers,n>0]]

Clear[dd3];

dd3[n_]=(2/(lL3 ))Integrate[g13[y]Sin[((n Pi)/lL3)y],{y,0,lL3}]

The solution is

Clear[uu3]; 

uu3[x_,y_]=(∑_(n=1)^nn3) aa3[n]Sin[((n Pi)/lK3)x] ((Sinh[((n Pi)/lK3)y])/(Sinh[((n Pi)/lK3)lL3]))+(∑_(n=1)^nn3) bb3[n]Sin[((n Pi)/lK3)x] ((Sinh[((n Pi)/lK3)(lL3-y)])/(Sinh[((n Pi)/lK3)lL3]))+ (∑_(n=1)^nn3) cc3[n]Sin[((n Pi)/lL3)y] ((Sinh[((n Pi)/lL3)x])/(Sinh[((n Pi)/lL3)lK3]))+(∑_(n=1)^nn3) dd3[n] Sin[((n Pi)/lL3)y] ((Sinh[((n Pi)/lL3)(lK3-x)])/(Sinh[((n Pi)/lL3)lK3]));

How good are the approximations? Here are visual answers:

Plot[{f13[x],uu3[x,0]},{x,0,lK3},PlotStyle->{{Blue,Thickness[0.01]},{Red,Thickness[0.005]}},PlotRange->All]

Plot[{g23[y],uu3[lK3,y]},{y,0,lL3},PlotStyle->{{Blue,Thickness[0.01]},{Red,Thickness[0.005]}},PlotRange->All]

Plot[{f23[x],uu3[x,lL3]},{x,0,lK3},PlotStyle->{{Blue,Thickness[0.01]},{Red,Thickness[0.005]}},PlotRange->All]

Plot[{g13[y],uu3[0,y]},{y,0,lL3},PlotStyle->{{Blue,Thickness[0.01]},{Red,Thickness[0.005]}},PlotRange->All]

Plot3D[N[uu3[x,y]],{x,0,lK3},{y,0,lL3},Mesh->Automatic,PlotRange->{0,6.5}]

DensityPlot[N[uu3[x,y]],{x,0,lK3},{y,0,lL3},Frame->True,PlotRange->{{0,lK3},{0,lL3}},ColorFunction->(RGBColor[1,1-#,1-#]&)]