libcosim icon indicating copy to clipboard operation
libcosim copied to clipboard

Variable range mapping

Open ljamt opened this issue 6 years ago • 4 comments

Shall cse-core include features for mapping variable ranges like 1-5 kW -> 0-100% ?

ljamt avatar Nov 01 '19 11:11 ljamt

Isn't this mostly a GUI thing?

kyllingstad avatar Nov 01 '19 11:11 kyllingstad

Possibly relevant: In an FMI 2.0 model description you can specify the display units for variables, which may be different from the actual variable value units. Look for <DisplayUnit> in the spec.

kyllingstad avatar Nov 01 '19 11:11 kyllingstad

I think this relates to connections, as a special case of unit conversion. IE connecting two variables where one gives a value in %, and the other expects the value in kW.

eidekrist avatar Nov 01 '19 11:11 eidekrist

The variable modifiers will support linear transforms (offset + factor) in an upcoming PR, though I suppose this request concerns simulation-level conversions that are not necessarily tied to our concept of scenarios or manipulators. Still, any unit conversion could be implemented through an existing manipulator transform, and if controlled from GUI I think it will suffice.

Adding simulation level support for unit conversions also means we should verify that connection integrity is maintained; i.e. checking that given variables v1 and v2, the connection v1 === v2 still holds with the user-defined conversions.

restenb avatar Nov 04 '19 14:11 restenb