Skip to content

Getting started with NeqSim in Matlab

Even Solbraa edited this page May 16, 2019 · 25 revisions

The following steps describes how to set up NeqSim Matlab fo first use:

1. Update the pathstring variable in pathNeqSim file The pathNeqSim.m file needs to be set up with the correct path to the installation. The pathstring variable has to be set to the base directory where neqsimmatlab is on the local disk.

  1. Set up the database connection (change only needed if external database will be used) By default neqsimmatlab uses the embedded parameter database (Derby database). If an alternative external database should be used, the connection string to the database need to be set:

neqsim.util.database.NeqSimDataBase.setDataBaseType("Derby"); neqsim.util.database.NeqSimDataBase.setConnectionString("jdbc:derby:classpath:data/neqsimthermodatabase");

  1. Run the pathNeqSim.m script in Matlab

  2. Enter the following script to check that neqsimmatlab works correctly:

fluid1 = thermo('srk');

fluid1 .addComponent('methane', 10.0);

fluid1 .addComponent('propane', 1.0);

fluid1 .addComponent('n-hexane', 1.0);

fluid1 .addComponent('water', 1.0);

fluid1 .createDatabase(1);

fluid1 .setMixingRule(2);

fluid1 .setMultiPhaseCheck(1);

TPflash(fluid1,0);

fluid1

  1. See more examples of Matlab calculations
Clone this wiki locally