Worksheet: Turkey.mw 

Cooking a Spherical Turkey: 

The Heat Equation in Spherical Coordinates 

 

This worksheet examines a series solution that arises in a separation of variables solution for the heat equation in spherical coordinates : 

u[t]=kappa(u[rr]+`+`(`/`(`*`(2), `*`(r))) u[r])   0 < r < a      

with boundary conditions 

 

u(a,t) =T[1]    u(0,t) bounded 

with initial condition 

u(r,0)=T[0]     0 < x< a  

                             

> restart:with(plots):
 

> a:=1;kappa:=2/100;T0:=75;T1:=350;
 

 

 

 

1
`/`(1, 50)
75
350
 

Let's approximate the initial condition with the eigenfunctions that came from separation of variables. 

> f:=n->sin(n*Pi*r/a)/r;
 

proc (n) options operator, arrow; `/`(`*`(sin(`/`(`*`(n, `*`(Pi, `*`(r))), `*`(a)))), `*`(r)) end proc
 

> c:=n->int(1*f(n)*r^2,r=0..a)/int((f(n))^2*r^2,r=0..a);
 

proc (n) options operator, arrow; `/`(`*`(int(`*`(f(n), `*`(`^`(r, 2))), r = 0 .. a)), `*`(int(`*`(`^`(f(n), 2), `*`(`^`(r, 2))), r = 0 .. a))) end proc
 

> seq(c[n]=c(n),n=1..10);
 

c[1] = `+`(`/`(`*`(2), `*`(Pi))), c[2] = `+`(`-`(`/`(1, `*`(Pi)))), c[3] = `+`(`/`(`*`(`/`(2, 3)), `*`(Pi))), c[4] = `+`(`-`(`/`(`*`(`/`(1, 2)), `*`(Pi)))), c[5] = `+`(`/`(`*`(`/`(2, 5)), `*`(Pi))), c...
c[1] = `+`(`/`(`*`(2), `*`(Pi))), c[2] = `+`(`-`(`/`(1, `*`(Pi)))), c[3] = `+`(`/`(`*`(`/`(2, 3)), `*`(Pi))), c[4] = `+`(`-`(`/`(`*`(`/`(1, 2)), `*`(Pi)))), c[5] = `+`(`/`(`*`(`/`(2, 5)), `*`(Pi))), c...
 

> M:=10;
 

10
 

> u:=(r,t)->T1+(T0-T1)*sum(c(m)*f(m)*exp(-kappa*m^2*Pi^2*t/a^2),m=1..M);
 

proc (r, t) options operator, arrow; `+`(T1, `*`(`+`(T0, `-`(T1)), `*`(sum(`*`(c(m), `*`(f(m), `*`(exp(`+`(`-`(`/`(`*`(kappa, `*`(`^`(m, 2), `*`(`^`(Pi, 2), `*`(t)))), `*`(`^`(a, 2))))))))), m = 1 .. ...
 

> u(r,t);
 

`+`(350, `-`(`/`(`*`(550, `*`(sin(`*`(Pi, `*`(r))), `*`(exp(`+`(`-`(`*`(`/`(1, 50), `*`(`^`(Pi, 2), `*`(t))))))))), `*`(Pi, `*`(r)))), `/`(`*`(275, `*`(sin(`+`(`*`(2, `*`(Pi, `*`(r))))), `*`(exp(`+`(`...
`+`(350, `-`(`/`(`*`(550, `*`(sin(`*`(Pi, `*`(r))), `*`(exp(`+`(`-`(`*`(`/`(1, 50), `*`(`^`(Pi, 2), `*`(t))))))))), `*`(Pi, `*`(r)))), `/`(`*`(275, `*`(sin(`+`(`*`(2, `*`(Pi, `*`(r))))), `*`(exp(`+`(`...
`+`(350, `-`(`/`(`*`(550, `*`(sin(`*`(Pi, `*`(r))), `*`(exp(`+`(`-`(`*`(`/`(1, 50), `*`(`^`(Pi, 2), `*`(t))))))))), `*`(Pi, `*`(r)))), `/`(`*`(275, `*`(sin(`+`(`*`(2, `*`(Pi, `*`(r))))), `*`(exp(`+`(`...
`+`(350, `-`(`/`(`*`(550, `*`(sin(`*`(Pi, `*`(r))), `*`(exp(`+`(`-`(`*`(`/`(1, 50), `*`(`^`(Pi, 2), `*`(t))))))))), `*`(Pi, `*`(r)))), `/`(`*`(275, `*`(sin(`+`(`*`(2, `*`(Pi, `*`(r))))), `*`(exp(`+`(`...
 

> plot({u(r,0),75},r=0..a,thickness=2);
 

Plot_2d
 

Note the Gibb's phenomena at the endpoints -- convergence is non-uniform at t=0, but uniform for any positive t. 

> animate(u(r,t),r=0..a,t=0..5,thickness=2,frames=50);
 

Plot_2d
 

> Uc:=simplify(expand(limit(u(r,t),r=0)));
 

`+`(350, `-`(`*`(550, `*`(exp(`+`(`-`(`*`(`/`(1, 50), `*`(`^`(Pi, 2), `*`(t))))))))), `*`(550, `*`(exp(`+`(`-`(`*`(`/`(32, 25), `*`(`^`(Pi, 2), `*`(t)))))))), `*`(550, `*`(exp(`+`(`-`(`*`(`/`(2, 25), ...
`+`(350, `-`(`*`(550, `*`(exp(`+`(`-`(`*`(`/`(1, 50), `*`(`^`(Pi, 2), `*`(t))))))))), `*`(550, `*`(exp(`+`(`-`(`*`(`/`(32, 25), `*`(`^`(Pi, 2), `*`(t)))))))), `*`(550, `*`(exp(`+`(`-`(`*`(`/`(2, 25), ...
 

> plot({Uc,150},t=0..5,thickness=2);
 

Plot_2d
 

> fsolve(Uc=150,t=4..6);
 

4.828469711
 

It takes approximately 5 hours to cook the turkey!!