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; % % revise the following if you want a step change in jacket flow delFj = 0; 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 = [dTdt; dTjdt]; %Figure M5.7a is obtained using the following commands (MATLAB 4.x) %x0 = % 124.6525 % 154.9880 % [t,x] = ode45('heater',0,5,x0); % plot(t,x(:,1)) % % for MATLAB 5.x, use % [t,x] = ode45('heater',[0 5],x0);