﻿# FMI display units: reverse the declared affine or reciprocal mapping before a write

Separate FMI Unit and DisplayUnit values, and verify conversion direction, offset and reciprocal mappings before a dashboard writes a displayed value to the model.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/simulation-fmi-display-unit-affine-inverse-conversion/
Language: en

## A correct display can still have incorrect writeback

A thermal-twin panel renders a temperature correctly in the operator’s preferred unit. The operator edits the displayed number, and the application passes it unchanged to the FMU. Read-side correctness has hidden a write-side unit error. Treat presentation and raw model exchange as separate value domains. Every editable view needs a defined reverse mapping, with the submitted display value and converted raw value available for inspection when a surprising trajectory follows.

## Read the conversion direction explicitly

The [unit specification](https://fmi-standard.org/docs/3.0.2/) defines conversion from a value in Unit to its DisplayUnit. For the ordinary case, multiply the raw value by factor and add offset. The [unit schema](https://raw.githubusercontent.com/modelica/fmi-standard/v3.0.2/schema/fmi3Unit.xsd) stores these display attributes separately from BaseUnit attributes. Do not reverse the equation by intuition or apply the base-unit conversion a second time. Keep the selected variable unit, display definition and conversion direction together in the importer’s presentation record.

## A reciprocal display is not another multiplier

With inverse enabled, the displayed value is factor divided by the raw value. The specification permits that case only with a zero offset. Reversing the mapping requires dividing factor by the displayed value, subject to an explicitly handled domain. Do not implement every unit as multiplication by a cached coefficient. Define how undefined or unsuitable values are reported; replacing division by a silently clamped denominator invents a different measurement convention.

## Scope the display name to its owning unit

Display-unit names are unique within their owning Unit, not necessarily throughout the whole description. Resolve a display choice through the variable’s unit definition rather than a global dictionary keyed only by its label. A name collision must not select another variable’s conversion. Also preserve whether a quantity is absolute or relative when applying relevant base-unit offsets; a temperature difference and an absolute temperature cannot be treated as interchangeable simply because the screen uses familiar unit text.

## Propose round-trip checks with distinct mappings

A proposed fixture should include a nonzero-offset display and a reciprocal display, then compare raw-to-display-to-raw round trips under a declared numeric tolerance. Add a domain-error case and identically named display definitions under different units. Retain both intermediate values so applying a wrong mapping twice cannot accidentally hide the defect. No FMU or dashboard experiment was run here. These checks establish conversion behavior rather than measured sensor accuracy or a universal precision threshold.

## Keep conversion correctness separate from calibration

The [OpenUSD unit guide](/journal/fg2-openusd-stage-units-assembly-corrective-transform/) covers a different physical-scale boundary; [stack reproducibility](/journal/software-stack-reproducibility/) supports retaining unit metadata with the model. Here acceptance establishes that displayed edits become the intended raw values. It does not establish instrument calibration, sensible operating limits or safe control settings. Those need separate domain evidence after presentation no longer changes the requested physical quantity through a reversed or incomplete conversion.
