DATA

From ASCEND
Jump to: navigation, search

DATA instances are used to pass 'additional parameters' to external relations. This can be used for example to define constants that are required for calculation of the external relation, but which do not vary over the duration of a simulation.

DATA instances are used for example in FPROPS to specify the fluid being used:


MODEL ammoniadata;
	component IS_A symbol_constant;
	component :== 'ammonia';

END ammoniadata;

MODEL example;

	(* variables that will be calculated (or specified, in some cases *)
	p IS_A pressure;

	T IS_A temperature;
	rho IS_A mass_density;
	h IS_A specific_enthalpy;

	(* this is the 'DATA' instance that will be passed to the external relation *)
	propsdata IS_A ammoniadata;

	(* declare the external relation, together with the variables and DATA that it uses *)
	props1: helmholtz_p(

		T, rho : INPUT;
		p : OUTPUT;

		propsdata : DATA
	);
END example;

See also External_libraries#DATA_instance.