MATLAB CAPE-OPEN Unit Operation

Moderator: jasper

Post Reply
Vanessa
Posts: 12
Joined: 26 January 2021, 16:22

MATLAB CAPE-OPEN Unit Operation

Post by Vanessa »

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?
User avatar
jasper
Posts: 1129
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: MATLAB CAPE-OPEN Unit Operation

Post by jasper »

It is probably the line under it. "Cobalt (III) oxide" is not a valid variable name. Try "Cobalt_III_oxide"?
Vanessa
Posts: 12
Joined: 26 January 2021, 16:22

Re: MATLAB CAPE-OPEN Unit Operation

Post by Vanessa »

Thank you!
Vanessa
Posts: 12
Joined: 26 January 2021, 16:22

Re: MATLAB CAPE-OPEN Unit Operation

Post by Vanessa »

Can MATLAB CAPE-OPEN Unit Operation calculate ODEs?
User avatar
colancto
Administrateur
Posts: 92
Joined: 23 October 2012, 11:46
Contact:

Re: MATLAB CAPE-OPEN Unit Operation

Post by colancto »

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?
Vanessa
Posts: 12
Joined: 26 January 2021, 16:22

Re: MATLAB CAPE-OPEN Unit Operation

Post by Vanessa »

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?
Last edited by Vanessa on 12 May 2021, 13:35, edited 1 time in total.
User avatar
colancto
Administrateur
Posts: 92
Joined: 23 October 2012, 11:46
Contact:

Re: MATLAB CAPE-OPEN Unit Operation

Post by colancto »

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.
User avatar
jasper
Posts: 1129
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: MATLAB CAPE-OPEN Unit Operation

Post by jasper »

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?
Screenshot 2021-05-12 183931.png
Screenshot 2021-05-12 183931.png (7.5 KiB) Viewed 25690 times
Once you have that, perhaps you can 'disp' the arguments to verify them.
Post Reply

Return to “MATLAB Unit Operation (AmsterCHEM)”