Difference between revisions of "Dynamic models - 2014"
Jump to navigation
Jump to search
Kevin Dunn (talk | contribs) |
Kevin Dunn (talk | contribs) |
||
Line 105: | Line 105: | ||
Test your understanding before and after class with [http://www.pc-education.mcmaster.ca/Edumat.htm these resources from Dr. Thomas Marlin]. This website also contains full Powerpoint slides for each chapter from his textbook. Use this as a resource if you are still waiting for your copy of the Marlin textbook to arrive. | Test your understanding before and after class with [http://www.pc-education.mcmaster.ca/Edumat.htm these resources from Dr. Thomas Marlin]. This website also contains full Powerpoint slides for each chapter from his textbook. Use this as a resource if you are still waiting for your copy of the Marlin textbook to arrive. | ||
== Computer code: class 02B, 15 January == | |||
In a file called '''<tt>cstr_height.m</tt>''': | |||
<syntaxhighlight lang="matlab"> | |||
function d_depnt__d_indep = cstr_height(indep, depnt) | |||
% Dynamic balance for the CSTR height | |||
% indep: the independent ODE variable, such as time or length or the reactor | |||
% depnt: a VECTOR of dependent variables | |||
% | |||
% Returns: | |||
% | |||
% d(depnt) | |||
% ---------- = a vector of ODEs | |||
% d(indep) | |||
% Assign some variables for convenience of notation: one row per DEPENDENT variable | |||
h = depnt(1); | |||
% Constant and other equations | |||
A = 0.5; % m^2 | |||
F_i = 0.8; % m^3/min | |||
R = 15; % min/m^2 | |||
F_o = h/R; % m^3/min | |||
% Output from this ODE function must be a COLUMN vector, with n rows | |||
% n = how many ODEs in this system? | |||
n = numel(depnt); d_depnt__d_indep = zeros(n,1); | |||
% Specify every element in the vector below: 1, 2, ... n | |||
d_depnt__d_indep(1) = 1/A * (F_i - F_o); | |||
</syntaxhighlight> |
Revision as of 15:03, 15 January 2014
Class date(s): | 13 to 17 January 2014 | ||||
| |||||
Readings and preparation for class; video and audio files
Date | Class number | Reading (Marlin) | Reading (Seborg*) | Reading (other) | Handout | Video and audio files | |
---|---|---|---|---|---|---|---|
13 January | 02A | Chapter 3 and Appendix B | Chapter 2 |
|
None | Video (361M) | Audio (42M) |
15 January | 02B | Chapter 3 | Chapter 2 | None | |||
17 January | 02C | Chapter 3 | Chapter 2 |
* The book by Seborg et al. is easily available new or second hand, as it was the prescribed textbook in 2013 (Marlin's book was prescribed in 2012). I will make reference to the chapters from Seborg on the website as well.
Test your understanding before and after class with these resources from Dr. Thomas Marlin. This website also contains full Powerpoint slides for each chapter from his textbook. Use this as a resource if you are still waiting for your copy of the Marlin textbook to arrive.
Computer code: class 02B, 15 January
In a file called cstr_height.m:
function d_depnt__d_indep = cstr_height(indep, depnt)
% Dynamic balance for the CSTR height
% indep: the independent ODE variable, such as time or length or the reactor
% depnt: a VECTOR of dependent variables
%
% Returns:
%
% d(depnt)
% ---------- = a vector of ODEs
% d(indep)
% Assign some variables for convenience of notation: one row per DEPENDENT variable
h = depnt(1);
% Constant and other equations
A = 0.5; % m^2
F_i = 0.8; % m^3/min
R = 15; % min/m^2
F_o = h/R; % m^3/min
% Output from this ODE function must be a COLUMN vector, with n rows
% n = how many ODEs in this system?
n = numel(depnt); d_depnt__d_indep = zeros(n,1);
% Specify every element in the vector below: 1, 2, ... n
d_depnt__d_indep(1) = 1/A * (F_i - F_o);