ME 303 Project 2 Solution

M.M. Yovanovich

PROJ2S99SOL.MWS

Project 2 Solution.

The complete solution of the problem of Project 2.

The Maple worksheet follows closely the procedure one would use to get the solution by paper and pencil.

> restart:

System parameter values.

> syspar:= (D=5/1000, L=100/1000, k=80, S=2e6, TL=70, Tinfty=20, alpha=12e-6);

[Maple Math]

> assume(S>0, k>0, alpha>0):

Nonhomogeneous PDE.

> PDE:= diff(theta(x,t),x$2)+ S/k - 1/alpha*diff(theta(x,t),t) = 0;

[Maple Math]

Separation of nonhomogeneous PDE into nonhomgeneous ODE and homogeneous PDE.

> theta(x,t):= v(x) + w(x,t);

[Maple Math]

> PDE2:= PDE;

[Maple Math]

Steady-state solution.

> ode:= diff(v(x),x$2) + S/k=0;

[Maple Math]

> solode:= dsolve(ode, v(x));

[Maple Math]

> bc1:= simplify(subs(x=0, diff(rhs(solode),x)))=0;

[Maple Math]

> bc2:=subs(x=L, rhs(solode)) = thetaL;

[Maple Math]

> consts:= solve({bc1,bc2},{_C1,_C2});

[Maple Math]

> assign(consts):

> expand(solode);

[Maple Math]

Solution of homogeneous PDE.

> PDE2:= diff(w(x,t),x$2) -1/alpha*diff(w(x,t),t) = 0;

[Maple Math]

Separation of Variables Method.

> w(x,t):= X(x)*T(t);

[Maple Math]

> PDE3:= expand(PDE2/w(x,t));

[Maple Math]

Solution of separated spatial ODE.

> odeX:= diff(X(x),x$2) + lambda^2*X(x) = 0;

[Maple Math]

> assume(lambda>0):

> solodeX:= dsolve(odeX, X(x));

[Maple Math]

> bc0:= simplify(subs(x=0, diff(rhs(solodeX),x)))=0;

[Maple Math]

> _C4:= 0;

[Maple Math]

> solodeX;

[Maple Math]

> subs(x=L, rhs(solodeX)) = 0;

[Maple Math]

Since the constant of integration cannot be set to zero (this gives a trivial solution), we must set [Maple Math] . This relation gives us the eigenvalues [Maple Math] , for all positive integers.

> lambdan:=(2*n-1)*Pi/(2*L);

[Maple Math]

The spatial solution consists of cosines.

Solution of the time ODE.

> odeT:= diff(T(t),t) + lambda^2*alpha*T(t)=0;

[Maple Math]

> solodeT:= dsolve(odeT, T(t));

[Maple Math]

Auxiliary transient solution.

> w:= C*exp(-lambda^2*alpha*t)*cos(lambda*x);

[Maple Math]

Fourier coefficients for temperature are based on the initial condition.

> v:= expand(rhs(solode));

[Maple Math]

> Cn:= 2/L*Int(-v*cos(lambdan*x),x=0..L);

[Maple Math]

> thetaL:= TL-Tinfty;

[Maple Math]

Fourier Coefficients for Temperature.

> Cn:= expand(value(Cn));

[Maple Math]
[Maple Math]

Remove [Maple Math] and set [Maple Math]

> Cn:= subs(sin(n*Pi)=0, cos(n*Pi)=(-1)^n, Cn);

[Maple Math]
[Maple Math]

Compute the first two Fourier coefficients.

> C1:= subs(syspar, n=1, Cn): evalf(%);

[Maple Math]

> C2:= subs(syspar, n=2, Cn): evalf(%);

[Maple Math]

General Expression for Fourier coefficients for Temperature.

The above expression can be put into a simpler form by collecting common terms. It can be written as

> C[n]:= (16*(-1)^n)/((2*n-1)^3*Pi)*((S*L^2)/(Pi^2*k) + (T[L]-T[infinity])*(n^2-n+1/4));

[Maple Math]

Fourier coefficients for instantaneous heat flow rate through boundary at [Maple Math] .

> En:= expand(-lambdan*Cn*sin(lambdan*L));

[Maple Math]
[Maple Math]
[Maple Math]

The above expression for [Maple Math] can be simplified by noting that [Maple Math] . Collecting common terms with common factors simplifies the relation greatly. It can be written as

> E[n]:= 8/(2*n-1)^2*((S*L^2)/(Pi^2*k) + (T[L]-T[infinity])*(n^2-n+1/4));

[Maple Math]

Heat flow rates.

Steady-state heat flow rate through [Maple Math] .

> QL1:= -k*A*subs(x=L, diff(v,x));

[Maple Math]

Transient component of the heat flow rate through [Maple Math] .

> QL2:= -k*A*En*exp(-(lambdan*L)^2*tau):

> A:= Pi*D^2/4;

[Maple Math]

Calculation of steady-state heat flow rate for given system parameter values.

> QL11:= evalf(subs(syspar, QL1));

[Maple Math]

Calculation of transient heat flow rate for given system parameter values.

Use the first 200 terms for the summation. Compute the heat transfer rate for the three dimensionless times.

> nmax:= 200:
QL:= sum(evalf(subs(syspar, QL2)),n=1..nmax):

> Q1:= evalf(subs(tau=0.01, syspar, QL1 + QL));

[Maple Math]

> Q2:= evalf(subs(tau=0.1, syspar, QL1 + QL));

[Maple Math]

> Q3:= evalf(subs(tau=1, syspar, QL1 + QL));

[Maple Math]

Computation of the Fourier coefficients.

> Cns:= evalf([seq(subs(syspar, Cn),n=1..nmax)]):

> Cns[1]; Cns[nmax];

[Maple Math]

[Maple Math]

Steady-state solution.

> v;

[Maple Math]

Steady-state temperature for given system parameter values.

> v:=subs(syspar, subs(x=L*xi, v));

[Maple Math]

> plot(v,xi=0..1);

[Maple Plot]

Transient temperature distributions [Maple Math] .

> nmax:= 200: tau:='tau':

> T1:= v + sum(subs(tau=0.01, syspar, Cn*exp(-(lambdan*L)^2*tau)*cos(lambdan*L*xi)), n=1..nmax)+20:

> T2:= v + sum(subs(tau=0.1, syspar, Cn*exp(-(lambdan*L)^2*tau)*cos(lambdan*L*xi)), n=1..nmax)+20:

> T3:= v + sum(subs(tau=1, syspar, Cn*exp(-(lambdan*L)^2*tau)*cos(lambdan*L*xi)), n=1..nmax)+20:

Plot of transient temperature and steady-state temperature distributions.

Plot the steady-state and transient solutions.

> plot({T1, T2, T3, v+20}, xi=0..1);

[Maple Plot]

>