CSL Model Structure
The CSL language is, in essence, a list of equations. Each equation typically consists of a variable on the left side of a "equals" (=) sign, and a mathematical expression on the right side:
C = C1*exp(-k1*t) + C2*exp(-k2*t)
The CSL language provides numerous mathematical functions and operators for use in the construction of models: elementary mathematical operators, trigonometric and other transcendental functions, signal (waveform) generators, ODE integration operators, etc. The language also provides statements for declaring the datatype and dimension of variables or constants, and for indicating when specific equations should be evaluated. A very simple model follows:
model pk2
initial
C = 0.0
end
dynamic
cinterval cint = 0.2
constant C1 = 100.0, C2 = 10.0
constant k1 = 1, k2 = 0.1
derivative
C = C1*exp(-k1*t) + C2*exp(-k2*t)
end
constant tstop = 24.0
termt(t >= tstop, 'Time limit')
end
end
Though simple, this model contains many of the constructs used to build much more complicated models. The following sections will explain the elements of this model in more detail, and provide an overview of additional structural elements of the CSL language.