Appendix



next up previous
Next: About this document Up: No Title Previous: Student Exercises

Appendix

1. Using MATLAB to convert from State Space to Transfer Function Models - SS2TF

State Space Model

a =

   -0.4000    0.3000

    3.0000   -4.5000

b =

         0   -7.5000    0.1000         0

   50.0000         0         0    1.5000


c =

     1     0

     0     1

d =

     0     0     0     0

     0     0     0     0

Find transfer function polynomials for input 1

[num1,den] = ss2tf(a,b,c,d,1)

num1 =

         0    0.0000   15.0000

         0   50.0000   20.0000

den =

    1.0000    4.9000    0.9000

Find tranfer function polynomials for input 2

[num2,den] = ss2tf(a,b,c,d,2)

num2 =
         0   -7.5000  -33.7500

         0   -0.0000  -22.5000

den =

    1.0000    4.9000    0.9000

Find tranfer function polynomials for input 3

[num3,den] = ss2tf(a,b,c,d,3)

num3 =

         0    0.1000    0.4500

         0    0.0000    0.3000

den =

    1.0000    4.9000    0.9000

Find tranfer function polynomials for input 4

[num4,den] = ss2tf(a,b,c,d,4)

num4 =

         0    0.0000    0.4500

         0    1.5000    0.6000

den =

    1.0000    4.9000    0.9000

Eigenvalues and Eigenvectors

[v,lambda] = eig(a)

v =

    0.8207   -0.0695

    0.5714    0.9976

lambda =

   -0.1911         0

         0   -4.7089

2. MATLAB function routine for nonlinear heater model

%
function xdot = heater(t,x);
%
%  Dynamics of a stirred tank heater
%  (c) 1994 - B.W. Bequette 
%  8 July 94
%
%  x(1)     =  T  =  temperature in tank
%  x(2)     =  Tj =  temperature in jacket
%  delFj    =        change in jacket flowrate
%  F        =        Tank flowrate
%  Tin      =        Tank inlet temperature
%  Tji      =        Jacket inlet temperature
%  V        =        Tank volume
%  Vj       =        Jacket volume
%  rhocp    =        density*heat capacity
%  rhocpj   =        density*heat capacity,jacket fluid
%
%  parameter and steady-state variable values are:
%
  F     =   1;
  Fjs   =   1.5;
  Ti    =  50;
  Tji   = 200; 
  V     =  10;
  Vj    =   1;
  rhocp = 61.3;
  rhocpj= 61.3;
  UA    = 183.9;
%
  delFj =   -0.1;
  Fj = Fjs + delFj;
  T = x(1);
  Tj= x(2);
%
% odes
%
  dTdt = (F/V)*(Ti - T) + UA*(Tj - T)/(V*rhocp);
  dTjdt = (Fj/Vj)*(Tji - Tj) - UA*(Tj - T)/(Vj*rhocpj);
  xdot(1) = dTdt;
  xdot(2) = dTjdt;

Figure 7a is obtained using the following commands

x0 = [124.6525;154.9880];

[t,x] = ode45('heater',0,5,x0);

plot(t,x(:,1))



B. Wayne Bequette, bequeb@rpi.edu