m11.mws

4.6.2  heat1-1.mws     Laplace's equation, 3 homogenous  boundary conditions (Dirichlet)   (example1)

>    restart;

Non-homogeneous boundary condition:

>    f(y):=1;

f(y) := 1

Fourier coefficients:

>    b[n]:=2*int(f(y)*sin(n*Pi*y/M),y=0..M)/M;

b[n] := -2*(cos(n*Pi)-1)/n/Pi

>    b[n]:=factor(subs({sin(n*Pi)=0,cos(n*Pi)=(-1)^n},b[n]));

b[n] := -2*((-1)^n-1)/n/Pi

>    a[n]:=-b[n]/sinh(n*Pi*L/M);

a[n] := 2*((-1)^n-1)/n/Pi/sinh(n*Pi*L/M)

>    u[n](x,y):=a[n]*sinh(n*Pi*(x-L)/M)*sin(n*Pi*y/M);

u[n](x,y) := 2*((-1)^n-1)/n/Pi/sinh(n*Pi*L/M)*sinh(n*Pi*(x-L)/M)*sin(n*Pi*y/M)

>    L:=2;M:=3;

L := 2

M := 3

>    plot(f(y),y=0..M);

[Maple Plot]

VISUALIZATION OF THE SOLUTION:

>    u(x,y):=sum(u[n](x,y),n=1..100):

surface with fixed boundaries:

>    plot3d(u(x,y),x=0..L,y=0..M,axes=boxed,projection=0.9);

[Maple Plot]

>    with(plots):

Warning, the name changecoords has been redefined

stationary distribution of density field:

>    densityplot(u(x,y),x=0..L,y=0..M,axes=none,grid=[100,100],style=patchnogrid);

[Maple Plot]

countourplot with level curves:

>    contourplot(u(x,y),x=0..L,y=0..M,axes=boxed,filled=true,contours=10,coloring=[white,blue],grid=[100,100]);

[Maple Plot]

>