Modelica.Units.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.Units.NonSI to the corresponding SI Units defined in package Modelica.Units.SI 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 Modelica.Units.SI;
import Modelica.Units.Conversions.{from_degC, from_deg, from_rpm};
   ...
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 Content

Name Description
Modelica.Units.Conversions.to_unit1 to_unit1 Change the unit of a Real number to unit="1"
Modelica.Units.Conversions.to_degC to_degC Convert from kelvin to degree Celsius
Modelica.Units.Conversions.from_degC from_degC Convert from degree Celsius to kelvin
Modelica.Units.Conversions.to_degF to_degF Convert from kelvin to degree Fahrenheit
Modelica.Units.Conversions.from_degF from_degF Convert from degree Fahrenheit to kelvin
Modelica.Units.Conversions.to_degRk to_degRk Convert from kelvin to degree Rankine
Modelica.Units.Conversions.from_degRk from_degRk Convert from degree Rankine to kelvin
Modelica.Units.Conversions.to_deg to_deg Convert from radian to degree
Modelica.Units.Conversions.from_deg from_deg Convert from degree to radian
Modelica.Units.Conversions.to_rpm to_rpm Convert from radian per second to revolutions per minute
Modelica.Units.Conversions.from_rpm from_rpm Convert from revolutions per minute to radian per second
Modelica.Units.Conversions.to_kmh to_kmh Convert from metre per second to kilometre per hour
Modelica.Units.Conversions.from_kmh from_kmh Convert from kilometre per hour to metre per second
Modelica.Units.Conversions.to_day to_day Convert from second to day
Modelica.Units.Conversions.from_day from_day Convert from day to second
Modelica.Units.Conversions.to_hour to_hour Convert from second to hour
Modelica.Units.Conversions.from_hour from_hour Convert from hour to second
Modelica.Units.Conversions.to_minute to_minute Convert from second to minute
Modelica.Units.Conversions.from_minute from_minute Convert from minute to second
Modelica.Units.Conversions.to_litre to_litre Convert from cubic metre to litre
Modelica.Units.Conversions.from_litre from_litre Convert from litre to cubic metre
Modelica.Units.Conversions.from_Ah from_Ah Convert from Ampere hours to Coulomb
Modelica.Units.Conversions.to_Ah to_Ah Convert from Coulomb to Ampere hours
Modelica.Units.Conversions.from_Wh from_Wh Convert from watt hour to joule
Modelica.Units.Conversions.to_Wh to_Wh Convert from joule to watt hour
Modelica.Units.Conversions.to_kWh to_kWh Convert from joule to kilo watt hour
Modelica.Units.Conversions.from_kWh from_kWh Convert from kilo watt hour to joule
Modelica.Units.Conversions.to_bar to_bar Convert from Pascal to bar
Modelica.Units.Conversions.from_bar from_bar Convert from bar to Pascal
Modelica.Units.Conversions.to_gps to_gps Convert from kilogram per second to gram per second
Modelica.Units.Conversions.from_gps from_gps Convert from gram per second to kilogram per second
Modelica.Units.Conversions.from_Hz from_Hz Convert from Hz to rad/s
Modelica.Units.Conversions.to_Hz to_Hz Convert from rad/s to Hz
Modelica.Units.Conversions.to_cm2 to_cm2 Convert from square metre to square centimetre
Modelica.Units.Conversions.from_cm2 from_cm2 Convert from square centimetre to square metre

Modelica.Units.Conversions.to_unit1 Modelica.Units.Conversions.to_unit1

Change the unit of a Real number to unit="1"

Information

Syntax

Modelica.Units.Conversions.to_unit1(r);

Description

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

Example

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

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

Inputs

NameDescription
rReal number

Outputs

NameDescription
resultReal number r with unit="1" [1]

Modelica.Units.Conversions.to_degC Modelica.Units.Conversions.to_degC

Convert from kelvin to degree Celsius

Information

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

Inputs

NameDescription
KelvinValue in kelvin [K]

Outputs

NameDescription
CelsiusValue in degree Celsius [degC]

Modelica.Units.Conversions.from_degC Modelica.Units.Conversions.from_degC

Convert from degree Celsius to kelvin

Information

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

Inputs

NameDescription
CelsiusValue in degree Celsius [degC]

Outputs

NameDescription
KelvinValue in kelvin [K]

Modelica.Units.Conversions.to_degF Modelica.Units.Conversions.to_degF

Convert from kelvin to degree Fahrenheit

Information

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

Inputs

NameDescription
KelvinValue in kelvin [K]

Outputs

NameDescription
FahrenheitValue in degree Fahrenheit [degF]

Modelica.Units.Conversions.from_degF Modelica.Units.Conversions.from_degF

Convert from degree Fahrenheit to kelvin

Information

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

Inputs

NameDescription
FahrenheitValue in degree Fahrenheit [degF]

Outputs

NameDescription
KelvinValue in kelvin [K]

Modelica.Units.Conversions.to_degRk Modelica.Units.Conversions.to_degRk

Convert from kelvin to degree Rankine

Information

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

Inputs

NameDescription
KelvinValue in kelvin [K]

Outputs

NameDescription
RankineValue in degree Rankine [degRk]

Modelica.Units.Conversions.from_degRk Modelica.Units.Conversions.from_degRk

Convert from degree Rankine to kelvin

Information

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

Inputs

NameDescription
RankineValue in degree Rankine [degRk]

Outputs

NameDescription
KelvinValue in kelvin [K]

Modelica.Units.Conversions.to_deg Modelica.Units.Conversions.to_deg

Convert from radian to degree

Information

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

Inputs

NameDescription
radianValue in radian [rad]

Outputs

NameDescription
degreeValue in degree [deg]

Modelica.Units.Conversions.from_deg Modelica.Units.Conversions.from_deg

Convert from degree to radian

Information

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

Inputs

NameDescription
degreeValue in degree [deg]

Outputs

NameDescription
radianValue in radian [rad]

Modelica.Units.Conversions.to_rpm Modelica.Units.Conversions.to_rpm

Convert from radian per second to revolutions per minute

Information

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

Inputs

NameDescription
rsValue in radian per second [rad/s]

Outputs

NameDescription
rpmValue in revolutions per minute [rev/min]

Modelica.Units.Conversions.from_rpm Modelica.Units.Conversions.from_rpm

Convert from revolutions per minute to radian per second

Information

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

Inputs

NameDescription
rpmValue in revolutions per minute [rev/min]

Outputs

NameDescription
rsValue in radian per second [rad/s]

Modelica.Units.Conversions.to_kmh Modelica.Units.Conversions.to_kmh

Convert from metre per second to kilometre per hour

Information

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

Inputs

NameDescription
msValue in metre per second [m/s]

Outputs

NameDescription
kmhValue in kilometre per hour [km/h]

Modelica.Units.Conversions.from_kmh Modelica.Units.Conversions.from_kmh

Convert from kilometre per hour to metre per second

Information

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

Inputs

NameDescription
kmhValue in kilometre per hour [km/h]

Outputs

NameDescription
msValue in metre per second [m/s]

Modelica.Units.Conversions.to_day Modelica.Units.Conversions.to_day

Convert from second to day

Information

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

Inputs

NameDescription
sValue in second [s]

Outputs

NameDescription
dayValue in day [d]

Modelica.Units.Conversions.from_day Modelica.Units.Conversions.from_day

Convert from day to second

Information

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

Inputs

NameDescription
dayValue in day [d]

Outputs

NameDescription
sValue in second [s]

Modelica.Units.Conversions.to_hour Modelica.Units.Conversions.to_hour

Convert from second to hour

Information

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

Inputs

NameDescription
sValue in second [s]

Outputs

NameDescription
hourValue in hour [h]

Modelica.Units.Conversions.from_hour Modelica.Units.Conversions.from_hour

Convert from hour to second

Information

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

Inputs

NameDescription
hourValue in hour [h]

Outputs

NameDescription
sValue in second [s]

Modelica.Units.Conversions.to_minute Modelica.Units.Conversions.to_minute

Convert from second to minute

Information

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

Inputs

NameDescription
sValue in second [s]

Outputs

NameDescription
minuteValue in minute [min]

Modelica.Units.Conversions.from_minute Modelica.Units.Conversions.from_minute

Convert from minute to second

Information

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

Inputs

NameDescription
minuteValue in minute [min]

Outputs

NameDescription
sValue in second [s]

Modelica.Units.Conversions.to_litre Modelica.Units.Conversions.to_litre

Convert from cubic metre to litre

Information

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

Inputs

NameDescription
m3Value in cubic metre [m3]

Outputs

NameDescription
litreValue in litre [l]

Modelica.Units.Conversions.from_litre Modelica.Units.Conversions.from_litre

Convert from litre to cubic metre

Information

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

Inputs

NameDescription
litreValue in litre [l]

Outputs

NameDescription
m3Value in cubic metre [m3]

Modelica.Units.Conversions.from_Ah Modelica.Units.Conversions.from_Ah

Convert from Ampere hours to Coulomb

Information

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

Inputs

NameDescription
AmpereHourValue in ampere hours [A.h]

Outputs

NameDescription
CoulombValue in coulomb [C]

Modelica.Units.Conversions.to_Ah Modelica.Units.Conversions.to_Ah

Convert from Coulomb to Ampere hours

Information

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

Inputs

NameDescription
CoulombValue in coulomb [C]

Outputs

NameDescription
AmpereHourValue in ampere hours [A.h]

Modelica.Units.Conversions.from_Wh Modelica.Units.Conversions.from_Wh

Convert from watt hour to joule

Information

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

Inputs

NameDescription
WattHourValue in watt hour [W.h]

Outputs

NameDescription
JouleValue in joule [J]

Modelica.Units.Conversions.to_Wh Modelica.Units.Conversions.to_Wh

Convert from joule to watt hour

Information

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

Inputs

NameDescription
JouleValue in joule [J]

Outputs

NameDescription
WattHourValue in watt hour [W.h]

Modelica.Units.Conversions.to_kWh Modelica.Units.Conversions.to_kWh

Convert from joule to kilo watt hour

Information

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

Inputs

NameDescription
JValue in joule [J]

Outputs

NameDescription
kWhValue in kWh [kW.h]

Modelica.Units.Conversions.from_kWh Modelica.Units.Conversions.from_kWh

Convert from kilo watt hour to joule

Information

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

Inputs

NameDescription
kWhValue in kWh [kW.h]

Outputs

NameDescription
JValue in joule [J]

Modelica.Units.Conversions.to_bar Modelica.Units.Conversions.to_bar

Convert from Pascal to bar

Information

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

Inputs

NameDescription
PaValue in Pascal [Pa]

Outputs

NameDescription
barValue in bar [bar]

Modelica.Units.Conversions.from_bar Modelica.Units.Conversions.from_bar

Convert from bar to Pascal

Information

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

Inputs

NameDescription
barValue in bar [bar]

Outputs

NameDescription
PaValue in Pascal [Pa]

Modelica.Units.Conversions.to_gps Modelica.Units.Conversions.to_gps

Convert from kilogram per second to gram per second

Information

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

Inputs

NameDescription
kgpsValue in kg/s [kg/s]

Outputs

NameDescription
gpsValue in g/s [g/s]

Modelica.Units.Conversions.from_gps Modelica.Units.Conversions.from_gps

Convert from gram per second to kilogram per second

Information

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

Inputs

NameDescription
gpsValue in g/s [g/s]

Outputs

NameDescription
kgpsValue in kg/s [kg/s]

Modelica.Units.Conversions.from_Hz Modelica.Units.Conversions.from_Hz

Convert from Hz to rad/s

Information

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

Inputs

NameDescription
fValue in hertz [Hz]

Outputs

NameDescription
wValue in radian per second [rad/s]

Modelica.Units.Conversions.to_Hz Modelica.Units.Conversions.to_Hz

Convert from rad/s to Hz

Information

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

Inputs

NameDescription
wValue in radian per second [rad/s]

Outputs

NameDescription
fValue in hertz [Hz]

Modelica.Units.Conversions.to_cm2 Modelica.Units.Conversions.to_cm2

Convert from square metre to square centimetre

Information

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

Inputs

NameDescription
m2Value in square metre [m2]

Outputs

NameDescription
cm2Value in square centimetre [cm2]

Modelica.Units.Conversions.from_cm2 Modelica.Units.Conversions.from_cm2

Convert from square centimetre to square metre

Information

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

Inputs

NameDescription
cm2Value in square centimetre [cm2]

Outputs

NameDescription
m2Value in square metre [m2]
Automatically generated Thu Oct 1 16:08:18 2020.