Example 15.5-2 Operation of a simple Temperature Controller

> restart;

> eqliq:=diff(Ul(t),t)=Q(t)+wCpl*(Ti-T(t));

[Maple Math]

> eqcoil:=diff(Uc(t),t)=-Q(t)+Qc(t);

[Maple Math]

> Ul:=t->rVCl*(T(t)-Tbar);

[Maple Math]

> Uc:=t->rVCc*(Tc(t)-Tbar);

[Maple Math]

> Q:=t->UA*(Tc(t)-T(t));

[Maple Math]

> Qc:=t->b*(Tmax-T(t));

[Maple Math]

> eqliq; eq. 15.5-15

[Maple Math]

> eqcoil; eq. 15.5-16

[Maple Math]

> eqss:=rhs(eqliq)+rhs(eqcoil); Note that this does not include Tc(t)

[Maple Math]

> Tss:=solve(eqss,T(t)); The steady state solution for any value of Ti.

[Maple Math]

> Tinit:=subs(Ti=T0,Tss); eq. 15.5-17. This is what the book calls T(0).

[Maple Math]

> Tinf:=subs(Ti=T1,Tss); eq. 15.5-19. This is what the book calls T(infinity).

[Maple Math]

> Tcss:=solve(rhs(eqcoil),Tc(t)); The steady state for the coil for any given T(t)

[Maple Math]

> Tcinit:=simplify(subs(T(t)=Tinit,Tcss)); eq. 15.5-18, but note that T(0) which we called Tinit has not been substituted into eq. 15.5-18

[Maple Math]

> Tcinf:=simplify(subs(T(t)=Tinf,Tcss)); eq. 15.5-20 and Tinf has not been substituted into 15.5-20.

[Maple Math]

> Ti:=T1;

[Maple Math]

> tr:={T=Tinf+Theta*(T0-Tinf),Tc=Tcinf+Thetac*(Tc0-Tcinf),t=rVCl*tau/UA};

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

> with(PDEtools[dchange]);

[Maple Math]

> lst:={eqliq,eqcoil}; Putting the two DEs in a list. This turns out not to be useful, but does demonstrate that dchange can handle multiple equations in a single call to it.

[Maple Math]
[Maple Math]

> rVCc:=rVCl/R; wCpl:=UA*F; b:=B*UA; eq. 15.5-24. R is the ratio of the heat capacity of the tank to the coil. eq. 15.5-25. F is the ratio of the heat transfer coef to the flow heat capacity. eq. 15.5-26. B is the ratio of the control action to the heat transfer coef.

[Maple Math]

[Maple Math]

[Maple Math]

> newlst:=simplify(dchange(tr,lst,[Theta(tau),tau,Thetac(tau)]));

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

> eqtheta:=simplify(newlst[1]*(F+B)/UA/(T0*(F+B)-F*T1-B*Tmax)); Here I had to look at each equation separately. Note that Maple may oder the two equations in newlst differently on different occasions.

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

> eqthetac:=simplify(newlst[2]*(F+B)/UA/(Tc0*(F+B)-F*T1-B*(Tmax*(1+F)-F*T1)));

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

> simplify(coeff(rhs(eqtheta),Theta(tau))); This should be -(1+F)

[Maple Math]

> simplify(coeff(rhs(eqtheta),Thetac(tau))); This should be 1-B

[Maple Math]

> simplify(%-1+B); Here is what is left over from what we expect.

[Maple Math]

> simplify(coeff(rhs(eqthetac),Theta(tau))); This should b +1

[Maple Math]

> simplify(%-1); Here is what is left over from what we expect.

[Maple Math]

> simplify(coeff(rhs(eqthetac),Thetac(tau))); This should be -1

[Maple Math]

> solve(rhs(eqcoil),Tc(t)); The steady state equation for Tc

[Maple Math]

> Tc0:=T0+B*Tmax-B*T0; Making Tc0 satisfy 15.5-18

[Maple Math]

> eqtheta:=simplify(eqtheta); That's better.

[Maple Math]

> eqthetac:=simplify(eqthetac); So is this.

[Maple Math]

> s:=dsolve({eqtheta,eqthetac,Theta(0)=1,Thetac(0)=1},{Theta(tau),Thetac(tau)}): Here we go, but don't look. It is very long.

> assign(s); Just one of the variables is bad enough.

> Theta:=simplify(unapply(Theta(tau),tau)); We will look at Theta.

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

> Thetac:=unapply(Thetac(tau),tau): But not Thetac

> eq:=(1+F+R)^2-4*R*(B+F); Inspection of eq. 15.5-32 shows this should be the dividing line between oscillation and exponential behavior.

[Maple Math]

> Bcrit:=solve(eq,B);

[Maple Math]

> Bcrit:=unapply(Bcrit,F,R);

[Maple Math]

> Bcrit(3,20);

[Maple Math]

> Th:=unapply(Theta(tau),tau,B,F,R); Th wil be a function of tau and the three parameters: B, F, and R

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

> thet1:=simplify(Th(tau,22/5,3,20),assume=positive); For B>Bcrit.

[Maple Math]
[Maple Math]

> thet2:=simplify(Th(tau,20/5,3,20),assume=positive); For B<Bcrit

[Maple Math]

> thet1:=evalc(thet1); evaluating using complex relations.

[Maple Math]

> plot(thet1,tau=0...1);

> plot(thet2,tau=0...1);

> plot(thet1-thet2,tau=0...1);

>