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);
> 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;
Separation of nonhomogeneous PDE into nonhomgeneous ODE and homogeneous PDE.
> theta(x,t):= v(x) + w(x,t);
> PDE2:= PDE;
Steady-state solution.
> ode:= diff(v(x),x$2) + S/k=0;
> solode:= dsolve(ode, v(x));
> bc1:= simplify(subs(x=0, diff(rhs(solode),x)))=0;
> bc2:=subs(x=L, rhs(solode)) = thetaL;
> consts:= solve({bc1,bc2},{_C1,_C2});
> assign(consts):
> expand(solode);
Solution of homogeneous PDE.
> PDE2:= diff(w(x,t),x$2) -1/alpha*diff(w(x,t),t) = 0;
Separation of Variables Method.
> w(x,t):= X(x)*T(t);
> PDE3:= expand(PDE2/w(x,t));
Solution of separated spatial ODE.
> odeX:= diff(X(x),x$2) + lambda^2*X(x) = 0;
> assume(lambda>0):
> solodeX:= dsolve(odeX, X(x));
> bc0:= simplify(subs(x=0, diff(rhs(solodeX),x)))=0;
> _C4:= 0;
> solodeX;
> subs(x=L, rhs(solodeX)) = 0;
Since the constant of integration cannot be set to zero (this gives a trivial solution), we must set . This relation gives us the eigenvalues , for all positive integers.
> lambdan:=(2*n-1)*Pi/(2*L);
The spatial solution consists of cosines.
Solution of the time ODE.
> odeT:= diff(T(t),t) + lambda^2*alpha*T(t)=0;
> solodeT:= dsolve(odeT, T(t));
Auxiliary transient solution.
> w:= C*exp(-lambda^2*alpha*t)*cos(lambda*x);
Fourier coefficients for temperature are based on the initial condition.
> v:= expand(rhs(solode));
> Cn:= 2/L*Int(-v*cos(lambdan*x),x=0..L);
> thetaL:= TL-Tinfty;
Fourier Coefficients for Temperature.
> Cn:= expand(value(Cn));
Remove and set
> Cn:= subs(sin(n*Pi)=0, cos(n*Pi)=(-1)^n, Cn);
Compute the first two Fourier coefficients.
> C1:= subs(syspar, n=1, Cn): evalf(%);
> C2:= subs(syspar, n=2, Cn): evalf(%);
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));
Fourier coefficients for instantaneous heat flow rate through boundary at .
> En:= expand(-lambdan*Cn*sin(lambdan*L));
The above expression for can be simplified by noting that . 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));
Heat flow rates.
Steady-state heat flow rate through .
> QL1:= -k*A*subs(x=L, diff(v,x));
Transient component of the heat flow rate through .
> QL2:= -k*A*En*exp(-(lambdan*L)^2*tau):
> A:= Pi*D^2/4;
Calculation of steady-state heat flow rate for given system parameter values.
> QL11:= evalf(subs(syspar, QL1));
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));
> Q2:= evalf(subs(tau=0.1, syspar, QL1 + QL));
> Q3:= evalf(subs(tau=1, syspar, QL1 + QL));
Computation of the Fourier coefficients.
> Cns:= evalf([seq(subs(syspar, Cn),n=1..nmax)]):
> Cns[1]; Cns[nmax];
Steady-state solution.
> v;
Steady-state temperature for given system parameter values.
> v:=subs(syspar, subs(x=L*xi, v));
> plot(v,xi=0..1);
Transient temperature distributions .
> 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);
>