Example PGM Files
|Simple Examples||Subroutines Examples||Dynamic Examples||Steady State Overall Mass Balance||Array and Matrix Examples|
|Multi-Step Trigger||Checking |
|Belt Filter |
|Example User Defined Classes|
|Set Species Splits|| Agitator |
|Aq Feed Conc|
|Optimise Controllers |
for sensitive PIDs
|Relaxed Cross Page Connector|
Latest SysCAD Version: 15 November 2023 - SysCAD 9.3 Build 139.34246
Related Links: PGMs
The above tables contain some quick access links for examples listed below. For more information and full example lists, please see below:
Simple Example PGM Files
- PGM Examples - Check Version, Error and Convergence
- Example PGM Files - Using Counter, While and Random functions
Example Model Procedure files
MP Example Files:
PGM Files using Class and Functions
Using Array and Matrix
- Table lookup using Array and Matrix
- Set A Table of Values Using Matrix Class
- Solving a tridiagonal system of equations
Quick Mass balance
The Predefined Class: TagSelect can be used to generate some quick mass balance for the project:
- Example overall mass balance at the end of project solve
- Example species mass balance at the end of project solve
- Example elemental mass balance at the end of project solve
The following PGM examples can be used to check species at the end of project solve, so that we can generate Species Lists based on "With Flow" and "No Flow".
NOTE that in Build139 or later, user can get the used/unused species list directly from Plant Model - Species tab.
- How to generate a list of Species with Flow, useful for stream table reports
- How to check if a species is not used in the project (has no flow anywhere)
- How to compare two lists of string variables
User Defined Class and Functions
Class and Function/Subroutine can be written as part of the main PGM file OR separately in its own file. If the Class or function/subroutine can be used by multiple PGM or projects, it is best to store the code in a separate file, so it can be re-used easily. Please see Sharing Classes between Projects for more information.
In the following examples, the Class definition is stored in a separate pgm file, the class pgm file is inserted using the include file syntax when it is required.
- Example Class to Set Species Splits
- Example Class to calculate Agitator Power
- Example Class to Find a user specified Reaction in a Reaction Block
In the following examples, the Class is written as part of the PGM code. User may copy the class definition into its own file if required.
- Example Class to set Aqueous Feeder based on concentration
- Example Class to set Evaporation based on user defined correlation
- Example Class to calculate Alumina properties
- Example Class - Check Elemental Balance of a Process Unit Operation
- Example Class - using Enum Drop list and Drop List in a class
- Example Class - variable gain to assist with solving sensitive PID control loops
- Example Class - Relaxed Cross Page Connector - example class to allow a graduate transfer of data across the cross-page connection. Useful for breaking sensitive loops, allowing a slower and smoother change between sections of the plant.