Help for PC MATLAB and Simulink

MATLAB and Simulink are Trademarks of MathWorks, Inc.

PC MATLAB session

Thermo Utilities, for PC MATLAB comes with 70 PC MATLAB functions. In order to reach these functions, perform the following:

  1. Start PC MATLAB!
  2. Change the working directory to where you installed Thermo Utilities:

    cd c:\thermoml

  3. Type "tuhelp" to see the list of help functions.
  4. Type "steam" to see the list of functions for steam/water properties
  5. Type "air" to see the list of functions for dry/humid air and flue gas properties
  6. Type "lk" to see the list of functions for Lee-Kesler method

A number of demo functions are also available.

demo0 works in MATLAB Command Window:

demo1: saturation temperature of steam at different pressures

demo2: gas constant and molecular mass of humid air

demo3: saturation temperature of different fluids

demo4: fluid properties database for use with Lee-Kesler method

Creating a library for Simulink

This is a brief description on how to generate a Simulink library of blocks for Thermo Utilities:

  1. Start a Simulink session!
  2. Copy a subsytem block from Connections' folder to main folder of Simulink!
  3. Select Create Mask under Edit menu!
  4. Write the following command within Drawing commands edit box:

    fprintf('Thermo Utilities v3.0')

  5. Close Create Mask dialog box!
  6. Change the caption of the library from "subsytem" to "User Defined Blocks"!

Now Simulink's main folder is as below.

The next step is creating blocks for different functions. Here is the description for generating a block for stmpt.m. This function calculates the properties of superheated steam or under-cooled water. Inputs are p, pressure and t, temperature. Outputs are h, specific enthalpy, s, specific entropy and Error.

  1. Double click on the library "Thermo Utilities v3.0" to open it!
  2. Copy a "subsytem" block from Connections' folder to this folder!
  3. Change the caption of the block from "subsytem" to "SteamPT"!
  4. Double click the block "SteamPT" to open it!
  5. Copy 2 In, 4 Out, 1 Mux and 1 Demux to the SteamPT's folder!
  6. Copy 1 MATLAB Fcn from nonlinear folder to the SteamPT's folder!
  7. Change the number of inputs of the Mux to 2!
  8. Change the number of outputs of the Demux to 4!
  9. Connect the blocks as in the figure below!

  10. Change the caption of inputs and output!
  11. Double click the block MATLAB Fcn!
  12. Edit the box under MATLAB function to:


  13. Change the number of outputs to 4! Press apply and close it!

  14. Close the block "SteamPT"!

SteamPT is now a block inside the library "User Defined Blocks".

This is an example which uses the block "SteamPT" to generate an h-s diagram.

Copyright © 2000 Taftan Data. All Rights Reserved