ConstantsAndExpressions model

Requirements.Examples.Elementary.Sources.ConstantsAndExpressions  ยท source

Icon of ConstantsAndExpressions

Examples for XXXConstant and XXXExpressions

Extends Modelica.Icons.Example

Demonstrates the constant and expression sources of package Sources. The expression blocks output a time-varying value defined by a modifier of their output y: expr1 the Real expression time/2, expr2 the Integer expression integer(time) and expr3 the Boolean expression that is true on [1, 3) s. The constant blocks output the value of their parameter c: 1.234 (const1), false (const2), 123 (const3) and Undecided (const4). Plot the outputs over the simulation time of 4 s to see the signals.

Components and variables

NameTypeDescription
expr1Requirements.Sources.RealExpressionReal expression time/2
expr2Requirements.Sources.IntegerExpressionInteger expression integer(time)
expr3Requirements.Sources.BooleanExpressionBoolean expression, true on [1, 3) s
const1Requirements.Sources.RealConstantReal constant 1.234
const2Requirements.Sources.BooleanConstantBoolean constant false
const3Requirements.Sources.IntegerConstantInteger constant 123
const4Requirements.Sources.PropertyConstantProperty constant Undecided