Note: The fsolve function must be available. This is standard with MATLAB 4.x, but requires the optimization toolbox for MATLAB 5.x. To run this file, the user must first enter the global parameter vector CSTR_PAR which has 11 elements.
Case 2 values are shown in the function code. The book illustrates that the Case 2 parameter values have three possible solutions, depending on the initial guesses for the states. See pages 564-565 and Table M9.2 for the following
x0 = [9;300]; % initial guess for concentration and temperature
x = fsolve('cstr_ss',x0);
The solution obtained for case 2 and this initial guess is
x =
8.5636
311.1710
which is a low temperature steady-state.
For guess 2
x0 = [5;350]; % initial guess for concentration and temperature
x = fsolve('cstr_ss',x0);
The solution obtained for this initial guess is
x =
5.518
339.1
which is an intermediate temperature steady-state.
The following is for a third initial guess
x0 = [1;450]; % initial guess for concentration and temperature
x = fsolve('cstr_ss',x0);
The solution obtained for case 2 and this initial guess is
x =
2.359
368.1
which is a high temperature steady-state.
To reproduce Figure M9.2, use:
x0 = [9;300];
[t,x] = ode45('cstr_dyn',[0 30],x0); % MATLAB 5.x
[t,x] = ode45('cstr_dyn',0,30,x0); % MATLAB 4.x
To reproduce Figure M9.3, use:
x0 = [5;325];
[t,x] = ode45('cstr_dyn',[0 30],x0); % MATLAB 5.x
[t,x] = ode45('cstr_dyn',0,30,x0); % MATLAB 4.x
To reproduce Figure M9.4, use:
x0 = [1;400];
[t,x] = ode45('cstr_dyn',[0 30],x0); % MATLAB 5.x
[t,x] = ode45('cstr_dyn',0,30,x0); % MATLAB 4.x
See pages 569-570 for examples.
Do not forget to put values for all 11 elements of the CSTR_PAR vector. To use this file for MATLAB 5.x, you need to modify the calls to ode45 within the file.
See Figure M9.9 and page 578 for an example. Do not forget to enter the 11 elements of the CSTR_PAR vector.
Do not forget to enter the 11 elements of the CSTR_PAR vector.