Question: pdsolve solution with unexpected imaginary term

2D Heat Equation problem.

 

In most cases, pdsolve generates expected results. For this one, it does not. Is there an obvious error

in my worksheet?

 

restart; interface(imaginaryunit = i); heat_equation := diff(T(x, y, t), t) = k*(diff(T(x, y, t), x, x)+diff(T(x, y, t), y, y))

 

Writing out the boundary conditions:

bces := T(0, y, t) = 0, T(L, y, t) = 0, T(x, 0, t) = 0, T(x, L, t) = 0

Writing out the initial conditions

ice := T(x, y, 0) = T__0(x, y)

 

where

"`T__0`(x,y) := 1/(4)*sin((2 Pi*x)/(L) )^(2)*sin((3 Pi*y)/(L)):"

 

Showing the initial condition of the system.

L := 1; plot3d_display := scaling = constrained, size = [600, 600], orientation = [-121, 75, 1]; plot3d(T__0(x, y), x = 0 .. L, y = 0 .. L, plot3d_display)

 

Solving the heat equation.

sols := `assuming`([pdsolve({bces, ice, heat_equation}, T(x, y, t))], [k > 0])

T(x, y, t) = Sum(Sum(piecewise(n = 4, -((1/8)*I)*sin(n1*Pi*y)*sin(4*Pi*x)*exp(-Pi^2*k*t*(n1^2+16)), -4*sin(n*Pi*x)*exp(-Pi^2*k*t*(n^2+n1^2))*(-1+(-1)^n)*sin(n1*Pi*y)/(Pi*(n^3-16*n))), n = 1 .. infinity), n1 = 1 .. infinity)

(1)

Notice the imaginary expression in the solution?

 

Tsol := value(eval(rhs(sols), infinity = 12))

 

Looking at one value that includes an imaginary term.

eval(Tsol, {k = .1, t = 0, x = .2, y = .2})

-.3490991334-.1130635622*I

(2)

And plotting at t = 0.

plot3d(eval(Tsol, {k = .3, t = 0}), x = 0 .. L, y = 0 .. L, plot3d_display)

 

NULL

Note, if the sin(3*Pi*y/L) term is squared, then pdsolve returns a real solution.

NULL

Download Heat_Eq_2D.mw

Please Wait...