Package Modelica.​SIunits.​Conversions
Conversion functions to/from non SI units and type definitions of non SI units

Information

This package provides conversion functions from the non SI Units defined in package Modelica.SIunits.Conversions.NonSIunits to the corresponding SI Units defined in package Modelica.SIunits and vice versa. It is recommended to use these functions in the following way (note, that all functions have one Real input and one Real output argument):

  import SI = Modelica.SIunits;
  import Modelica.SIunits.Conversions.*;
     ...
  parameter SI.Temperature     T   = from_degC(25);   // convert 25 degree Celsius to Kelvin
  parameter SI.Angle           phi = from_deg(180);   // convert 180 degree to radian
  parameter SI.AngularVelocity w   = from_rpm(3600);  // convert 3600 revolutions per minutes
                                                      // to radian per seconds

Extends from Modelica.​Icons.​Package (Icon for standard packages).

Package Contents

NameDescription
ConversionIconThis icon will be removed in future Modelica versions.
from_AhConvert from Ampere hours to Coulomb
from_barConvert from bar to Pascal
from_cm2Convert from square centimetre to square metre
from_dayConvert from day to second
from_degConvert from degree to radian
from_degCConvert from degCelsius to Kelvin
from_degFConvert from degFahrenheit to Kelvin
from_degRkConvert from degRankine to Kelvin
from_gpsConvert from gram per second to kilogram per second
from_hourConvert from hour to second
from_HzConvert from Hz to rad/s
from_kmhConvert from kilometre per hour to metre per second
from_kWhConvert from kilo Watt hour to Joule
from_litreConvert from litre to cubic metre
from_minuteConvert from minute to second
from_rpmConvert from revolutions per minute to radian per second
from_WhConvert from Watt hour to Joule
NonSIunitsType definitions of non SI units
to_AhConvert from Coulomb to Ampere hours
to_barConvert from Pascal to bar
to_cm2Convert from square metre to square centimetre
to_dayConvert from second to day
to_degConvert from radian to degree
to_degCConvert from Kelvin to degCelsius
to_degFConvert from Kelvin to degFahrenheit
to_degRkConvert from Kelvin to degRankine
to_gpsConvert from kilogram per second to gram per second
to_hourConvert from second to hour
to_HzConvert from rad/s to Hz
to_kmhConvert from metre per second to kilometre per hour
to_kWhConvert from Joule to kilo Watt hour
to_litreConvert from cubic metre to litre
to_minuteConvert from second to minute
to_rpmConvert from radian per second to revolutions per minute
to_unit1Change the unit of a Real number to unit="1"
to_WhConvert from Joule to Watt hour

Function Modelica.​SIunits.​Conversions.​to_unit1
Change the unit of a Real number to unit="1"

Information

Syntax

SIunits.Conversions.to_unit1(r);

Description

The function call "Conversions.to_unit1(r)" returns r with unit="1".

Example

  Modelica.SIunits.Velocity v = {3,2,1};
  Real direction[3](unit="1") = to_unit1(v);   // Automatically vectorized call of to_unit1

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
RealrReal number

Outputs

TypeNameDescription
RealresultReal number r with unit="1"

Function Modelica.​SIunits.​Conversions.​to_degC
Convert from Kelvin to degCelsius

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
TemperatureKelvinKelvin value

Outputs

TypeNameDescription
Temperature_degCCelsiusCelsius value

Function Modelica.​SIunits.​Conversions.​from_degC
Convert from degCelsius to Kelvin

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Temperature_degCCelsiusCelsius value

Outputs

TypeNameDescription
TemperatureKelvinKelvin value

Function Modelica.​SIunits.​Conversions.​to_degF
Convert from Kelvin to degFahrenheit

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
TemperatureKelvinKelvin value

Outputs

TypeNameDescription
Temperature_degFFahrenheitFahrenheit value

Function Modelica.​SIunits.​Conversions.​from_degF
Convert from degFahrenheit to Kelvin

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Temperature_degFFahrenheitFahrenheit value

Outputs

TypeNameDescription
TemperatureKelvinKelvin value

Function Modelica.​SIunits.​Conversions.​to_degRk
Convert from Kelvin to degRankine

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
TemperatureKelvinKelvin value

Outputs

TypeNameDescription
Temperature_degRkRankineRankine value

Function Modelica.​SIunits.​Conversions.​from_degRk
Convert from degRankine to Kelvin

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Temperature_degRkRankineRankine value

Outputs

TypeNameDescription
TemperatureKelvinKelvin value

Function Modelica.​SIunits.​Conversions.​to_deg
Convert from radian to degree

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Angleradianradian value

Outputs

TypeNameDescription
Angle_degdegreedegree value

Function Modelica.​SIunits.​Conversions.​from_deg
Convert from degree to radian

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Angle_degdegreedegree value

Outputs

TypeNameDescription
Angleradianradian value

Function Modelica.​SIunits.​Conversions.​to_rpm
Convert from radian per second to revolutions per minute

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
AngularVelocityrsradian per second value

Outputs

TypeNameDescription
AngularVelocity_rpmrpmrevolutions per minute value

Function Modelica.​SIunits.​Conversions.​from_rpm
Convert from revolutions per minute to radian per second

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
AngularVelocity_rpmrpmrevolutions per minute value

Outputs

TypeNameDescription
AngularVelocityrsradian per second value

Function Modelica.​SIunits.​Conversions.​to_kmh
Convert from metre per second to kilometre per hour

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Velocitymsmetre per second value

Outputs

TypeNameDescription
Velocity_kmhkmhkilometre per hour value

Function Modelica.​SIunits.​Conversions.​from_kmh
Convert from kilometre per hour to metre per second

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Velocity_kmhkmhkilometre per hour value

Outputs

TypeNameDescription
Velocitymsmetre per second value

Function Modelica.​SIunits.​Conversions.​to_day
Convert from second to day

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Timessecond value

Outputs

TypeNameDescription
Time_daydayday value

Function Modelica.​SIunits.​Conversions.​from_day
Convert from day to second

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Time_daydayday value

Outputs

TypeNameDescription
Timessecond value

Function Modelica.​SIunits.​Conversions.​to_hour
Convert from second to hour

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Timessecond value

Outputs

TypeNameDescription
Time_hourhourhour value

Function Modelica.​SIunits.​Conversions.​from_hour
Convert from hour to second

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Time_hourhourhour value

Outputs

TypeNameDescription
Timessecond value

Function Modelica.​SIunits.​Conversions.​to_minute
Convert from second to minute

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Timessecond value

Outputs

TypeNameDescription
Time_minuteminuteminute value

Function Modelica.​SIunits.​Conversions.​from_minute
Convert from minute to second

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Time_minuteminuteminute value

Outputs

TypeNameDescription
Timessecond value

Function Modelica.​SIunits.​Conversions.​to_litre
Convert from cubic metre to litre

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Volumem3cubic metre value

Outputs

TypeNameDescription
Volume_litrelitrelitre value

Function Modelica.​SIunits.​Conversions.​from_litre
Convert from litre to cubic metre

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Volume_litrelitrelitre value

Outputs

TypeNameDescription
Volumem3cubic metre value

Function Modelica.​SIunits.​Conversions.​from_Ah
Convert from Ampere hours to Coulomb

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
ElectricCharge_AhAmpereHourAmpere hours

Outputs

TypeNameDescription
ElectricChargeCoulombCoulomb

Function Modelica.​SIunits.​Conversions.​to_Ah
Convert from Coulomb to Ampere hours

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
ElectricChargeCoulombCoulomb

Outputs

TypeNameDescription
ElectricCharge_AhAmpereHourAmpere hours

Function Modelica.​SIunits.​Conversions.​from_Wh
Convert from Watt hour to Joule

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Energy_WhWattHourWatt hour

Outputs

TypeNameDescription
EnergyJouleJoule

Function Modelica.​SIunits.​Conversions.​to_Wh
Convert from Joule to Watt hour

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
EnergyJouleJoule

Outputs

TypeNameDescription
Energy_WhWattHourWatt hour

Function Modelica.​SIunits.​Conversions.​to_kWh
Convert from Joule to kilo Watt hour

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
EnergyJJoule value

Outputs

TypeNameDescription
Energy_kWhkWhkWh value

Function Modelica.​SIunits.​Conversions.​from_kWh
Convert from kilo Watt hour to Joule

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Energy_kWhkWhkWh value

Outputs

TypeNameDescription
EnergyJJoule value

Function Modelica.​SIunits.​Conversions.​to_bar
Convert from Pascal to bar

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
PressurePaPascal value

Outputs

TypeNameDescription
Pressure_barbarbar value

Function Modelica.​SIunits.​Conversions.​from_bar
Convert from bar to Pascal

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Pressure_barbarbar value

Outputs

TypeNameDescription
PressurePaPascal value

Function Modelica.​SIunits.​Conversions.​to_gps
Convert from kilogram per second to gram per second

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
MassFlowRatekgpskg/s value

Outputs

TypeNameDescription
MassFlowRate_gpsgpsg/s value

Function Modelica.​SIunits.​Conversions.​from_gps
Convert from gram per second to kilogram per second

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
MassFlowRate_gpsgpsg/s value

Outputs

TypeNameDescription
MassFlowRatekgpskg/s value

Function Modelica.​SIunits.​Conversions.​from_Hz
Convert from Hz to rad/s

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Frequencyffrequency

Outputs

TypeNameDescription
AngularVelocitywangular velocity

Function Modelica.​SIunits.​Conversions.​to_Hz
Convert from rad/s to Hz

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
AngularVelocitywangular velocity

Outputs

TypeNameDescription
Frequencyffrequency

Function Modelica.​SIunits.​Conversions.​to_cm2
Convert from square metre to square centimetre

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Aream2square metre value

Outputs

TypeNameDescription
Area_cmcm2square centimetre value

Function Modelica.​SIunits.​Conversions.​from_cm2
Convert from square centimetre to square metre

Extends from Modelica.​SIunits.​Icons.​Conversion (Base icon for conversion functions).

Inputs

TypeNameDescription
Area_cmcm2square centimetre value

Outputs

TypeNameDescription
Aream2square metre value

Partial Function Modelica.​SIunits.​Conversions.​ConversionIcon
This icon will be removed in future Modelica versions.

Information

This icon of a conversion symbol will be removed in future versions of the library. Instead the icon Modelica.SIunits.Icons.Conversion shall be used.

Extends from Modelica.​Icons.​ObsoleteModel (Icon for classes that are obsolete and will be removed in later versions).