T.O.C. Index Bug Report ASCEND IV Home

library_example_files The ASCEND predefined collection of models

Chapter 19 The ASCEND predefined collection of models


The ASCEND system has two subdirectories containing models we and others have previously defined. We have labeled the first subdirectory libraries and the second examples. In the libraries subdirectory are several different files, each containing a number of useful type definitions which we can use to construct larger models in ASCEND. The examples subdirectory contains a number of complete ASCEND models ready for us to execute. One can examine and execute these examples when learning how to model in ASCEND.

system.a4l
The file called system.a4l in the libraries subdirectory must always be loaded first in the ASCEND system. It is automatically loaded when one starts the ASCEND system. However, the delete all types command will delete all type definitions including the ones in this file. If you have deleted all types, always reload this file first using the Read instruction in the Library tool set.

atoms.a4l
The simplest collection of previously defined types are those which define the kinds of constants, parameters and variables we are likely to use in constructing an engineering or scientific model. A file called atoms.a4l located in the libraries subdirectory has over 125 types of constants, parameters and variables. Following are three of the definitions it contains.

	CONSTANT critical_compressibility REFINES
real_constant DIMENSIONLESS;
 
	UNIVERSAL CONSTANT speed_of_light 
	REFINES real_constant :== 1{LIGHT_C};

	ATOM volume REFINES solver_var 
		DIMENSION L^3 
		DEFAULT 100.0{ft^3};
		lower_bound := 0.0{ft^3};
		upper_bound := 1e50{ft^3};
		nominal := 100.0{ft^3};  
	END volume;
Note that the first and third include a statement of the dimensionality of the item being defined. For example critical compressibility is dimensionless while the dimensions for volume are L3 (i.e., length cubed). The ASCEND system supports nine basic dimensions as defined for the standards defining the SI system of units. Dimensions differ from units in that length is a dimension while feet is a set of units one may use to express a length. Dimensions in ASCEND are L (length: typical units being ft, m), M (mass: kg, lbm), T (time: s, yr), E (electric current: amp), Q (quantity: mole), TMP (temperature: K, R), LUM (luminous intensity: candela), P (plane angle: radian) and S (solid angle: steradian). We have also included the tenth dimension C (currency: USdollar) so one can express cost. If you wish to express cost in a variety of different currencies (e.g., USdollars, UKpounds), you will have to define the conversion rates.

(See the manual entitled (****hyperlink to the document entitled **** The ASCEND Language Syntax and Semantics for more information on dimensionality and units.)

Typical use of library files
One will typically create models in the ASCEND system by including one or more of the library files available. Almost certainly the file atoms.a4l will become a part of any engineering or scientific model.

It would be useful for you to view this and a few of the other library files using a text editor such as xemacs to see what libraries we do have available.

Examples and scripts
The examples subdirectory in ASCEND has a number of complete ASCEND models. Each model is in two parts: the .a4c file containing the model definition and the .a4s file containing a script which one can use to execute the model. An example is the model simple_fs.a4c along with its script simple_fs.a4s.

Each of the example files indicates which of the library files one must load and the order in which to load them before loading the example file. If you fail to load a library file, you will experience a large number of diagnostic messages indicating there are missing type definitions.


Last Modified: 02:36pm EDT, September 30, 1997
9/26/97 Release 0.8 authors T.O.C. Index Bug Report ASCEND IV Home