© 2024 Jasper van Baten, AmsterCHEM

Matlab CAPE-OPEN Thermo Import

This Matlab package allows for importing CAPE-OPEN version 1.1 thermodynamic and physical Property Packages into Matlab. A command driven package allows for selecting a CAPE-OPEN Property Package, and then perform thermodynamic and physical property calculations as well as thermodynamic equilibrium calculations inside Matlab.

The package defines the interfaces to communicate with CAPE-OPEN thermodynamic and physical Property Packages; it does not implement the thermodynamic engine itself. To use this package, you will need to have Matlab (version 7.7 or higher) as well as a CAPE-OPEN version 1.1 compliant thermo system installed (for example, TEA which is shipped with the freely available CAPE-OPEN simulation environment COCO Simulator).

To get started with the Matlab CAPE-OPEN thermo import, type help capeOpen in Matlab after installation.

An example:

» handle=capeOpenGetPackage('TEA (CAPE-OPEN 1.1)','C1_C2'); » %let's calculate and plot the phase envelope at 1 atm for this system » frac=0:0.05:1; » X=[frac' 1-frac'] X = 0 1.0000 0.0500 0.9500 0.1000 0.9000 0.1500 0.8500 0.2000 0.8000 0.2500 0.7500 0.3000 0.7000 0.3500 0.6500 0.4000 0.6000 0.4500 0.5500 0.5000 0.5000 0.5500 0.4500 0.6000 0.4000 0.6500 0.3500 0.7000 0.3000 0.7500 0.2500 0.8000 0.2000 0.8500 0.1500 0.9000 0.1000 0.9500 0.0500 1.0000 0 » P=101325; » tbub=capeOpenEquilibriumProp(handle,'temperature',X,'pressure',P,'vaporFraction',0); » tdew=capeOpenEquilibriumProp(handle,'temperature',X,'pressure',P,'vaporFraction',1); » plot(frac,[tdew tbub])
graph

Requirements

Matlab CAPE-OPEN Thermo Import will function with CAPE-OPEN version 1.1 compliant thermodynamic Property Package Managers and stand-alone Property Packages. Note that the ThermoSystemAdapter can be used to convert CAPE-OPEN version 1.0 compliant Thermo Systems to CAPE-OPEN version 1.1.

Matlab version 7.7 or higher, must be installed and running at your system. Matlab CAPE-OPEN Thermo Import has been tested with Matlab versions 7.7, 7.8, 7.9, 7.10, 7.11, 7.12, 7.13, 7.14, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 9.10, 9.11, 9.12, 9.13, 9.14, 23.2 and 24.1.

COCO/CAPE-OPEN Compliant
CAPE-OPEN/COCO
Compliant

More information

Availability

The Matlab CAPE-OPEN Thermo Import installer is available from the Downloads Page.

Matlab CAPE-OPEN Thermo Import is free of charge for personal and academic use.

For commercial use, a license fee must be paid. Licensing is on a per-person basis (and can be used on multiple computers). Commercial license fee for a perpetual license is € 400,- (if you are outside the European union or inside Spain, VAT of 21% is applicable).

For other forms of licenses, please contact info@amsterchem.com.

Please see the Downloads page for downloading the Matlab CAPE-OPEN Thermo Import installer.

Notes on the Matlab path

The RegisterWithMatlab.exe utility will - if invoked for an All Users installation - add the appropriate statements to the Matlab pathdef.m file for the CAPE-OPEN Thermo Import libraries to be loaded properly. This utility will modify C:\Program Files\Matlab\<version>\toolbox\local\pathdef.m file by default. To this it will add the C:\Program Files\Matlab CAPE-OPEN Thermo Import\.

For Windows Vista and later, a virtual store copy of pathdef.m may exist, e.g. C:\Users\<myname>\AppData\Local\VirtualStore\Program Files\MATLAB\<version>\toolbox\local\pathdef.m. In this case, the modifications made to the system copy will not affect Matlab's path and it will appear as if the path registration has failed. This situation will only occur on systems on which the user has edited the pathdef.m file.

To resolve this situation, please manually copy the added lines from the system copy of pathdef.m to the user copy.

For a Current User installation, the matlab path modification needs to be done manually. The easiest solution is to add a startup.m file to the userpath folder (type userpath in Matlab to see which folder this is). In this file, an addpath statements needs to appear which adds the Matlab CAPE-OPEN Thermo Import installation folder. The RegisterWithMatlab.exe utility will identify this folder, but will not make the changes.

Notes on x86 thermo servers

Matlab 8.6 (2015b) is the last matlab to support the win32/x86 platform; after this, only x64 is supported for Windows. The x64 version of Matlab CAPE-OPEN Thermo Import will support loading x86 thermodynamic servers. However, this cannot be done in-process and will come with a performance penalty.

If you are working with thermodynamic servers that are not (yet) available for x64 windows, perhaps consider keeping a copy of an x86 Matlab installed on your machine, if performance of your application is of importance.

Change log

Version 1.0.3

Version 1.0.4

Version 1.0.5

Version 1.0.6

Version 1.0.7

Version 1.0.8

Version 1.0.9

Version 1.0.10

Version 1.0.11

Version 1.0.12

Version 1.0.13

Version 2.0.0.0

Version 2.0.0.1

Version 2.0.0.2

Version 2.0.0.3

Version 2.0.0.4

Version 2.0.0.5

Version 2.0.0.6

Version 2.0.0.7