IS_A

From ASCEND
Jump to: navigation, search

The IS_A statement is used to declare a new variable or sub-MODEL in your MODEL.

x IS_A distance; (* this is an 'atomic' variable: just
    a single numerical value that can be solved for *)
v IS_A vec3; (* vec3 is a sub-model containing x,y,z components *)
v.x = x; (* once variables are declared, you can use them
    in relations involving other variables, possibly from your
    sum-models *)

IS_A can also be used to declare arrays and sets.

IS_A can also be used in parametric models to define constants that will be provided during the declaration, for example:

MODEL hxbase (
 hotfluid, coldfluid, flowtype IS_A symbol_constant; (* this may have
to be separated. *)
) WHERE (
  flowtype IN ['counterflow','coflow']; (* == TRUE; may be needed, i forget *)
);

(*...declaration for a specialisation of hxbase with water as the fluid... *)
MODEL hxwater (
 flowtype IS_A symbol_constant;
) REFINES hxbase  (
  hotfluid :=='water';
  coldfluid:=='water';
);

(*...then later...*)
  a IS_A hxwater('coflow');

See also WILL_BE, IS_REFINED_TO, ALIASES, ARE_THE_SAME.