from_gpkg function

Requirements.Units.Conversions.from_gpkg  ยท source

Icon of from_gpkg

Convert from gram per kilogram to kilogram per kilogram

Extends Modelica.Units.Icons.Conversion

Convert from gram per kilogram to kilogram per kilogram: kgpkg := (1/1000)*gpkg. The input gpkg is the value in gram per kilogram (type NonSI.MassFraction_gpkg), the output kgpkg the value in kilogram per kilogram (type Modelica.Media.Interfaces.Types.MassFraction). The inverse is to_gpkg.

The conversion is a multiplication by a constant factor, without offset, so it converts differences and rates alike; it is exact up to floating-point rounding and has no limits on the input. The function is inlined. A check model uses it to write a value of a requirement in the unit in which the requirement states it, from_gpkg(<value as written>), so that the model reads like the statement; see Conversions. Examples.Elementary.Units.Conversions asserts its factor and the round trip to_gpkg(from_gpkg(7)).

Copyright © 2026 Model Based Innovation LLC. All rights reserved.

Inputs

NameTypeDescription
gpkg inputNonSI.MassFraction_gpkgValue in gram per kilogram

Outputs

NameTypeDescription
kgpkg outputModelica.Media.Interfaces.Types.MassFractionValue in kilogram per kilogram