I am simulating a cstr using Matlab UnitOperation. I have 5 compounds in the simulation. When I try to index the compounds using the following code,
%Compound indices:
Cobalt (III) oxide=1;
Sulphuric acid=2;
Sulphur dioxide=3;
Cobalt sulphate=4;
Water=5;
It keeps showing the error in the line %Compound indices: which says "Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise check for mismatched delimiters."
How can I rectify this error?
MATLAB CAPE-OPEN Unit Operation
Moderator: jasper
Re: MATLAB CAPE-OPEN Unit Operation
It is probably the line under it. "Cobalt (III) oxide" is not a valid variable name. Try "Cobalt_III_oxide"?
Re: MATLAB CAPE-OPEN Unit Operation
Can MATLAB CAPE-OPEN Unit Operation calculate ODEs?
Re: MATLAB CAPE-OPEN Unit Operation
Are you looking for a dynamic unit operation (so for a unit operation model that represents evolution w.r.t. time) or are you looking for ODEs for a model along some length or diameter where differential equations need to be integrated?
Re: MATLAB CAPE-OPEN Unit Operation
I have designed a dynamic model for a CSTR as a MATLAB Cape-Open Unit Operation.When I try to solve the ODEs ,it keeps showing the error ," Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.
When I run the same code in MATLAB it runs without errors. How do I rectify that error in MATLAB Cape-Open Unit Operation?
When I run the same code in MATLAB it runs without errors. How do I rectify that error in MATLAB Cape-Open Unit Operation?
Last edited by Vanessa on 12 May 2021, 13:35, edited 1 time in total.
Re: MATLAB CAPE-OPEN Unit Operation
A MATLAB CAPE-OPEN Unit Operation must model a steady-state Unit Operation not a dynamic Unit Operation. COFE is a steady-state process simulator (like PRO/II, PROMAX, Aspen Plus) not a dynamic process simulator like Aspen Dynamics, gPROMS. That does not explain the issue you encounter but your objective won't be met. If you want to model a stand-alone dynamic CSTR in MATLAB, use the MATLAB Thermo Import to reach out for thermodynamic properties. But you should not have expectations to run this dynamic CSTR in a steady-state process simulator. The MATLAB CAPE-OPEN Unit Operation implements the CAPE-OPEN Unit Operation interface specification which is clearly mentioned for steady-state operation.
There is a CAPE-OPEN Dynamic Unit Operation interface specification. But it has been implemented only in INDISSPlus from CORYS. It has not been implemented in Aspen Dynamics or in gPROMS. The CAPE-OPEN Dynamic Unit Operation interface specification builds somehow upon the CAPE-OPEN Unit Operation interface specification. But the additional interfaces to cope with dynamic operation are simply not there in the MATLAB CAPE-OPEN Unit Operation. I don't expect there will be there any time soon considering the small number of dynamic process simulators having implemented these.
There is a CAPE-OPEN Dynamic Unit Operation interface specification. But it has been implemented only in INDISSPlus from CORYS. It has not been implemented in Aspen Dynamics or in gPROMS. The CAPE-OPEN Dynamic Unit Operation interface specification builds somehow upon the CAPE-OPEN Unit Operation interface specification. But the additional interfaces to cope with dynamic operation are simply not there in the MATLAB CAPE-OPEN Unit Operation. I don't expect there will be there any time soon considering the small number of dynamic process simulators having implemented these.
Re: MATLAB CAPE-OPEN Unit Operation
This looks like an error in the script. Perhaps you can narrow it down by using the verbose option and look in the output which is the offending line?
Once you have that, perhaps you can 'disp' the arguments to verify them.
Once you have that, perhaps you can 'disp' the arguments to verify them.