blockRateConversion
Converts a rate given per time base A to a rate per time base B
Extends from Icons.Converter (Icon for converter elements).
Information
This information is part of the Business Simulation Library (BSL). Please support this work and ► donate.
The output y is derived from converting the input u assumed to be given as a rate in units of timeBaseA to a rate given in units of timeBaseB.
Notes
- The best way to work with time in Modelica is to use the SI unit [
s] for all internal representations and calculations, while making use ofdisplayUnitto convert input and output to and from another unit of time preferred by the modeler. That way models and components will be compatible with each other. - Nevertheless, there may be use cases where internally working with other timeBases is required. This converter allows to convert rates from one time base to another.
- The numerical conversion will only relate to the units of time and modelers must be aware that any other unit will typically be represented by its base unit. For example, entering a rate of
7 km/wk, using a constant converter, and converting it from time base "seconds" to the time base "days" will provide an output of1000 [m/d]. - Not all Modelica tools allow non-SI units of time to appear in models. So far, the function has only been tested with Wolfram System Modeler 14.
See also
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Structural Parameters | |||
| TimeBases | timeBaseA | modelSettings.modelDisplayTimeBase | TimeBase to convert from |
| TimeBases | timeBaseB | TimeBases.seconds | TimeBase to convert to (default = seconds) |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Interfaces.Connectors.RealInput | u | ||
| Interfaces.Connectors.RealOutput | y |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| ModelSettings | modelSettings |
Revisions
- Slightly modified in v2.0.0 to pass unit checking.