openmodelica - User defined unit conversion and displayUnit in Modelica -
i have been working several non-si medical units on openmodelica , created package contain them. wanted select user defined unit display purposes. done pretty types in modelica library such as
modelica.siunits.pressure p_example(displayunit="bar"); to more specific problem, working 2 different pressure units: cmh2o , mmhg. variables in model in cmh2o, calculations. want plot few of variables in mmhg. have following declarations types:
type pressure = real(final quantity="pressure", final unit="cmh2o"); type pressure_mmhg = real(final quantity="pressure", final unit="mmhg"); as to_mmhg , from_mmhg functions, original modelica library. however, variable trying plot in mmhg still appears in cmh2o.
types.pressure p_lv(displayunit="mmhg"); the following working not fancy don't want define new variable unnecessarily.
types.pressure_mmhg p_lv_in_mmhg = types.to_mmhg(p_lv);
Comments
Post a Comment