I am trying to model a Packed bed reactor for ethylbenzene dehydrogenation reaction for styrene production on Matlab but the code does not work, not sure why. I am posting what I did on Matlab.
|
Posted 26 April 2016 - 01:41 PM
I am trying to model a Packed bed reactor for ethylbenzene dehydrogenation reaction for styrene production on Matlab but the code does not work, not sure why. I am posting what I did on Matlab.
Posted 26 April 2016 - 06:19 PM
Dear Sharna:
From what I see, you have defined a function to calculate the derivatives of the composition (x's):
function dydt= @DehyR1 (w,x).. (Remove the @ on the function definition, or it will give an error).
Regarding your question: "Not sure what do I put on the command window", you need to use a function like ode45, the usage is like this:
[w,x]=ode45(@DehyR1,[wIni wEnd],x0)
Note that the first parameter is a function that outputs the derivative values, given the independent variable (w) and the values of the dependent variables (x), the second parameter is the interval of the independent variable used for the calculation, and the third parameter is a vector containing the initial values of the dependent variables.
As a result of ode45 you will get
w: a vector containing values of the independent variable,
x: the corresponding values of the dependent variables.
This can be implement both on the command window or a separate script. After you have w, x from ode45, you can do any postprocessing, like the graphs you mentioned.
Best regards.
Posted 27 April 2016 - 02:24 AM
I have put that,
Posted 27 April 2016 - 11:45 AM
Dear Sharna:
I tried check your code, but the version of the function "DehyR1" have a number of issues, missing parenthesis, undefined variables, etc.
Please be more specific about the error matlab gives to you, and attach the version of the code you are currently working on.
Best regards.
Methanol ProductionStarted by Guest_Manue_* , 21 Mar 2024 |
|
|
||
Linear Alkyl Benzene Sulfonic Acid Production (Labsa) SimulationStarted by Guest_Emranm02_* , 03 Mar 2024 |
|
|
||
Reactive Distillation For Dimethyl Carbonate ProductionStarted by Guest_JakeHollier_* , 02 Mar 2024 |
|
|
||
Oil Production And Desalting UnitStarted by Guest_Ali4269278331_* , 25 Feb 2024 |
|
|
||
Asme Code For Fiberglass Pressure Tank FeaStarted by Guest_Pheeto_* , 13 Feb 2024 |
|
|