CSTR Dynamic Solution in MATLAB

  Рет қаралды 39,820

APMonitor.com

APMonitor.com

Күн бұрын

Пікірлер
@umaRFTW
@umaRFTW 4 жыл бұрын
@6:32, if the 'xa' is mole fraction, then you should have an extra total concentration 'C' term with the reaction term in the equation, since your reaction is second order. You may have left it out since it is equal to 1, but maybe it should be included in the code if someone wanted to change the total concentration value.
@apm
@apm 3 жыл бұрын
Yes, you are correct. It is cancelled out from the right and left hand side of the equations. As long as the total concentration is constant (not necessarily 1) then it can cancel out of the equation.
@umaRFTW
@umaRFTW 3 жыл бұрын
@@apm Sorry, I think I am misunderstanding. The left hand side has 1 C term (derived nA with the formulas you have given), whereas the right hand side has C^2. C is constant, but only 1 of the C are eliminated. This would mean that there is 1 C remaining on the RHS, and if the total concentration =/= 1, then this would have an impact on the mole fraction profiles. Is this true?
@umaRFTW
@umaRFTW 3 жыл бұрын
C_A = C * x_A, this is the equation I am using. Since the RHS reaction equations both are second order, then C_A and C_B would both yield a 'C' term each.
@apm
@apm 3 жыл бұрын
Thanks, you are right with the two concentrations in the reaction. If it is a first order reaction then they cancel.
@donharrold1375
@donharrold1375 Жыл бұрын
Didn’t see the point in the linearised function? What advantage do you get from that?
@apm
@apm Жыл бұрын
Much of control system theory is built upon linear analysis such as stability analysis, model predictive control, etc. Here is are a few of the representations of the CSTR in linearized state space and transfer function form: apmonitor.com/che436/index.php/Main/CaseStudyCSTR
@cesurc7977
@cesurc7977 8 жыл бұрын
very benefical course. thanks for your sharing and precious expression.
@apm
@apm 8 жыл бұрын
+berna berna you are welcome. Thanks for the positive feedback!
@apm
@apm 8 жыл бұрын
+APMonitor.com And great cover photo of Delicate Arch in Utah - it is just a short drive away from me.
@angiemar88
@angiemar88 2 жыл бұрын
What if the density changes and the outlet flowarte is unknown, how do you calculate it ?
@apm
@apm 2 жыл бұрын
Try starting with the original balance equations and simplicity from there. apmonitor.com/pdc/index.php/Main/PhysicsBasedModels
@angiemar88
@angiemar88 2 жыл бұрын
@@apm thank you very much for your reply! however in this example the outlet volumetric flow rate is fixed, what if it is unknown? I have a specific example in mind, an isothermal, isobaric dynamic cstr where gas phase reactions take place (density is not constant but can be calculated from the ideal gas assumption). To find the outlet volumetric flow rate we'd need an extra equation and I don't know what it would be
@apm
@apm 2 жыл бұрын
@@angiemar88 the outlet is either dependent on the height of the liquid or a valve position. If it is dependent on the height of the liquid then use Bernoulli's equation to define the equation for the outlet flow. If it is a valve then use the valve equations: apmonitor.com/pdc/index.php/Main/FlowValves
@shraiygupta7967
@shraiygupta7967 4 жыл бұрын
Hello, great video. I had one question. When you solve for all of your mole fractions, how would you revert them back into concentrations? Do u just divide by the total volume of the CSTR reactor?
@apm
@apm 4 жыл бұрын
You can convert back to concentration with ci = n * yi / V where n is the total number of mole, yi is the mole fraction, V is the Volume, and ci is the concentration of species i.
@maanvimaheshwari3154
@maanvimaheshwari3154 4 жыл бұрын
Showing error in line 6 column 19 related to parenthesis, not able to figure out, help.
@apm
@apm 4 жыл бұрын
You can download the CSTR source from here: apmonitor.com/che436/index.php/Main/CaseStudyCSTR
@tubisbendotato
@tubisbendotato 9 жыл бұрын
Great video Professor, I need an help: how i manage a discrete variation in time of xa_in ? I'm working on a model with n CSTR in series and a PID controlled concentration at the inlet. So, I have an array of xa_in controlled values in time (every 30 seconds), is it possible to feed the ODE with xa_in changing in time? I tried to fit xa_in(t) with a continuous function (declared as a nested function) but in this way I lose accuracy and automation, cause every time I change PID gains I have to fit xa_in(t) with a new function. Thank you.
@apm
@apm 9 жыл бұрын
+Andrea Canali At 15:55 you'll see the ode call to solve the differential equation. If ca_in needs to change in time then I'd recommend setting up a loop with the ode integrator call inside. Every loop could be 30 seconds of simulation with different values of ca_in. Additional CSTR resources are here: apmonitor.com/che436/index.php/Main/CaseStudyCSTR
@marsearth5060
@marsearth5060 3 жыл бұрын
Is the cstr in steady state or insteady state?
@apm
@apm 3 жыл бұрын
It starts at steady state and then changes to unsteady state when there is a change to the cooling jacket temperature.
@morakaeugene
@morakaeugene 6 жыл бұрын
How do i model this one the dynamics of adiabatic flash tank process the main objective is to analyze the time it takes the temperature of the drum to reach steady state
@apm
@apm 6 жыл бұрын
You should start with balance equations and VLE equations. Here is a tutorial on simulating these systems. apmonitor.com/pdc/index.php/Main/Physics
@halilozen74
@halilozen74 Жыл бұрын
i've wrote the exact same thing as you but i get "it requires more input arguments to run" error. Can it give an error because of the matlab version or something or what am i doing wrong i really need to make this work
@halilozen74
@halilozen74 Жыл бұрын
and at the ode part i get "unrecognized function or variable 'cstr' " error
@apm
@apm Жыл бұрын
Here is additional information that may help: apmonitor.com/che436/index.php/Main/CaseStudyCSTR
@apm
@apm Жыл бұрын
Try this models: apmonitor.com/che436/uploads/Main/sp5_files.zip Close MATLAB and double click to open the Simulink Model file. It is likely a problem with your run directory path.
@halilozen74
@halilozen74 Жыл бұрын
@@apm thank you so much I will try that.
@juliasim1691
@juliasim1691 10 жыл бұрын
Hi, first of all, excellent videos that you upload to your channel. A simple question. What's the benefits of using the linear equations instead nonlinear?
@apm
@apm 10 жыл бұрын
I mostly like to work with nonlinear models directly. However, if the linear model is a sufficiently accurate representation of the process over a limited range, it may be useful for linear systems techniques for stability analysis, PID controller tuning correlations, controllability and observability analysis, and for Linear Model Predictive Control (most industrial implementations). There are other reasons to linearize to analyze a system but I would certainly recommend working with the nonlinear model directly if possible.
@juliasim1691
@juliasim1691 10 жыл бұрын
Thanks Professor
@emmanuelda5822
@emmanuelda5822 9 жыл бұрын
Prof., Please i need your help, how do i model a cooling problem in matlab using an Model Reference Adaptive Control (MRAC) or model reference adaptive system (MRAS). Mathematically, i am applying control to the Newton's Law of Cooling. Thank you.
@apm
@apm 9 жыл бұрын
Emmanuel, check out the dynamic optimization course at apmonitor.com/do You'll see methods to do adaptive Moving Horizon Estimation and Model Predictive Control.
@emmanuelda5822
@emmanuelda5822 9 жыл бұрын
+APMonitor.com Thanks Prof. Am currently studying it.
@kanagaraja1093
@kanagaraja1093 5 жыл бұрын
If I run it, It shows error in 7th line.
@apm
@apm 5 жыл бұрын
Could you include the error message? Make sure you unzip the archive and change your run directory to that folder so that it can find the required files.
@kanagaraja1093
@kanagaraja1093 5 жыл бұрын
How can I do this? Any video for this problem?
@kanagaraja1093
@kanagaraja1093 5 жыл бұрын
Error in ode15s (line148) (neq, tspan, ntspan, next, t0, etc....) Error in main (line 7) [t1,xa1] = ode15s(@(t,x)cstr(t,x,xa_in),[0 5],xa);
@kanagaraja1093
@kanagaraja1093 5 жыл бұрын
Sorry.. We are new to Matlab. We change the directory... Anyway thanks for the instructions
@kanagaraja1093
@kanagaraja1093 5 жыл бұрын
Not enough input arguments. cstr_linear(t, xa, xa_in)
@opetal9776
@opetal9776 8 жыл бұрын
kindly share the matlab code you use
@apm
@apm 8 жыл бұрын
+opetal Sure, here is the code and some additional examples: apmonitor.com/che436/index.php/Main/CaseStudyCSTR and apmonitor.com/do/index.php/Main/NonlinearControl (Python, MATLAB, and Simulink).
@joaovitorpaiva6625
@joaovitorpaiva6625 7 жыл бұрын
You could be a little more didatic, man
@apm
@apm 7 жыл бұрын
Here is additional content on the CSTR solution: apmonitor.com/che436/index.php/Main/CaseStudyCSTR
Arduino Stability Analysis with Controller Tuning
14:23
APMonitor.com
Рет қаралды 7 М.
Batch reactor modeling and simulation by MATLAB
13:53
Sandip Derle
Рет қаралды 13 М.
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
Batch Reactor Simulation  - Mathematical modelling and simulation on MATLAB Part 1 of 2
18:30
MATLAB Nonlinear Optimization with fmincon
14:26
APMonitor.com
Рет қаралды 243 М.
Reaction Kinetics in MATLAB
24:51
Lab and Theory
Рет қаралды 33 М.
Everything You Need to Know About Control Theory
16:08
MATLAB
Рет қаралды 592 М.
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 89 М.
How to STUDY so FAST it feels like CHEATING
8:03
The Angry Explainer
Рет қаралды 2,5 МЛН
Solving ODEs in MATLAB
25:22
Vincent Stevenson
Рет қаралды 28 М.