Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Define a LaTex/HTML formatted text as a symbol for a variable

Define a LaTex/HTML formatted text as a symbol for a variable

Hello,

Does anyone know if there is a way to define a symbol for a variable using LaTex or HTML formatted text along with the name, unit and description of a variable? I need it for posprocessing of the OpenModelica _res.mat output files in Python matplotlib package.

I personally would have thought something like the following would work but not sure about that, and apparantly the annotations are not saved anywhere in the  _res.mat or _init.xml files.

Code:


parameter SI.HeatFlowRate Q_ST = 5 "Heat transfer rate" annotation(Symbol="Q\textsubscript{ST}");

I would appreciate it if someone could help with this.

Thanks,
Ali

Re: Define a LaTex/HTML formatted text as a symbol for a variable

You know that Modelica supports quoted variables, maybe you can use those. Of course, this would make the model not so pretty to look at so a solution like you propose would work better but it needs to be implemented.

Code:


parameter SI.HeatFlowRate 'Q\textsubscript{ST}' = 5 "Heat transfer rate";

There are 0 guests and 0 other users also viewing this topic
You are here: