Some variables in 20-sim have a predefined value. These variables do not have to be declared in the variables section of a model.
The variable time is equal to the simulated time. It can for example be used in functions such as:
u = sin(time*f*2*3.1415);
The variable sampletime is equal to the sampletime. It is only meaningful when it is used in an equation model that is part of a discrete loop in your model. 20-sim will automatically detect, which loop the model belongs to and assign the proper value to the variable sampletime.
The variable random will yield a random variable uniformly distributed in the interval [-1,1]. E.g.:
u = random;
The variable true will return the boolean value true.
The variable false will return the boolean value false.
Some integration algorithms, will perform model calculations at one or more intermediate points before calculating the next output value. To prevent equations being calculated, at these intermediate steps, you can use the variable major. This variable will return the boolean false when calculations are performed for an intermediate step and will return true when calculations are performed for the output values.
....
if major then
sim_steps = sim_steps + 1; // this equation is not evaluated at intermediate points
end;
....