MATLAB CAPE-OPEN Unit Operation

Moderator: jasper

MATLAB CAPE-OPEN Unit Operation

Postby Vanessa » 05 May 2021, 12:25

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

Re: MATLAB CAPE-OPEN Unit Operation

Postby jasper » 05 May 2021, 15:04

It is probably the line under it. "Cobalt (III) oxide" is not a valid variable name. Try "Cobalt_III_oxide"?
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: MATLAB CAPE-OPEN Unit Operation

Postby Vanessa » 10 May 2021, 08:52

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

Re: MATLAB CAPE-OPEN Unit Operation

Postby Vanessa » 11 May 2021, 10:07

Can MATLAB CAPE-OPEN Unit Operation calculate ODEs?
Vanessa
 
Posts: 12
Joined: 26 January 2021, 16:22

Re: MATLAB CAPE-OPEN Unit Operation

Postby colancto » 11 May 2021, 17:22

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?
User avatar
colancto
Administrateur
 
Posts: 92
Joined: 23 October 2012, 11:46

Re: MATLAB CAPE-OPEN Unit Operation

Postby Vanessa » 12 May 2021, 07:30

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

Re: MATLAB CAPE-OPEN Unit Operation

Postby colancto » 12 May 2021, 12:21

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
colancto
Administrateur
 
Posts: 92
Joined: 23 October 2012, 11:46

Re: MATLAB CAPE-OPEN Unit Operation

Postby jasper » 12 May 2021, 16:29

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 16978 times


Once you have that, perhaps you can 'disp' the arguments to verify them.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain


Return to MATLAB Unit Operation (AmsterCHEM)

Who is online

Users browsing this forum: No registered users and 1 guest

cron