Question: 1D Heat Equationwith Robin boundary conditions

Since my problem involving a 2d heat equation was answered so well,

(hats off to nm !!) I thought I would try another PDE question.

 

Question: can pdsolve handle a combination of the function and its derivative for

the boundary conditions, i.e., Robin boundary conditions?

 

I looked through the document example, pdsolve_boundaryconditions, which was

beautifully written. However, I saw no example with Robin BCs.

 

"restart; interface(imaginaryunit = i):      StartTemp(x):= `T__0`*(e)^(-`alpha__0` )*cos(Pi*(x)/(`L__0`));   `L__0` := 10: #` Length of rod` `T__0` := 100: #` max temperature` `alpha__0` := 6/(100): #`  Dampening factor` plot(StartTemp(x) , x = 0 .. `L__0`,  thickness = 5,             view = [0..`L__0`, -100..100],  labels = ["Position on rod", "Temperature"], labelfont = [Times, 14],             labeldirections = [horizontal, vertical], title = "Temperature in rod at t = 0" , titlefont = [Times, 16],             size = [500, 225]);"

proc (x) options operator, arrow, function_assign; T__0*exp(-alpha__0)*cos(Pi*x/L__0) end proc

 

 

The equation and the initial condition:

heat_equation := diff(T(x, t), t) = k*(diff(T(x, t), x, x)); initial_condition := T(x, 0) = T__i(x)

Using a linear combination of the function and its derivative, i.e., Robin BCs.

boundary_conditions := `α__r`*T(0, t)+`β__r`*(D[1](T))(0, t) = f(t), `α__r`*T(L__0, t)+`β__r`*(D[1](T))(L__0, t) = g(t)

 

Setting the constants

"  `alpha__r` := 1:  #` Constant for boundary condition`  `beta__r` := 2: #` Constant for boundary condition`     `T__s`:= 10:  #` Time interval`  k:=9/(10):  #` Heat-conductivity of material`    f(t) :=-1/(10) t:                  g(t):=1/(10) t:  "

Solving using nm's technique of not defining the function before calling pdsolve

sols := pdsolve({heat_equation, boundary_conditions, initial_condition}, T(x, t))

 

Now include the initial temperature function

"`T__i`(x) := StartTemp(x):  "

Extracting the solution, and using 20 terms

sol := eval(rhs(sols), infinity = 20)

-134/135+(1/270)*x^3-(7/90)*x^2+(67/135)*x+Sum(exp(-(9/1000)*Pi^2*n^2*t)*(Pi*n*cos((1/10)*n*Pi*x)-5*sin((1/10)*n*Pi*x))*(Int(-(x^3-21*x^2+134*x-27000*exp(-3/50)*cos((1/10)*Pi*x)-268)*(Pi*n*cos((1/10)*n*Pi*x)-5*sin((1/10)*n*Pi*x)), x = 0 .. 10))/(1350*Pi^2*n^2+33750), n = 1 .. 20)+(1/50)*t*x-(7/50)*t

(1)

Evaluate the integrals and build the solution to the temperature as a function of position and time

T__sol := MakeFunction(value(sol), x, t)

 

Here is the problem:

in plotting the solution at t = 0, we do NOT reproduce the initial temperature function.

 

plot(T__sol(x, 0), x = 0 .. L__0, -120 .. 120, thickness = 5, size = [500, 225])

 

If I use boundary conditions for either Dirichlet or Neumann, i.e., T(0, t) & T(L__0, t) 

or "`T__x`(0,t) & `T__x`(`L__0`,t)", the initial function is reproduced at t = 0.

 

Is this example one of those situations that was addressed in the notes?

Given a problem with PDEs and some BCs, note the following:

• 

Depending on how you write a general PDE solution, it becomes
possible or nearly impossible to adjust it to match the BCs.

 

NULL

Download Heat_Equation_1D_Robin_Conditions.mw

Please Wait...