OpenModelica icon indicating copy to clipboard operation
OpenModelica copied to clipboard

Linearize should be available from the OMEdit GUI

Open OpenModelica-TracImporter opened this issue 5 years ago • 2 comments

https://trac.openmodelica.org/OpenModelica/ticket/5626

@adeas31, it's really time we implement this for good, every year I teach a course at TU Delft where I need it, and I need to go through the CLI thing, which is ugly. We need also some kind of choice between Modelica, Matlab, or Python output, which is set by the --linearizationDumpLanguage flag.

Thanks!

casella avatar Feb 10 '25 14:02 casella

Looks like the linearize API have same interface as simulate. So it makes sense to kind of integrate it in the existing simulation GUI interface.

I will investigate more how linearize is working and how we can integrate in a better way. Do you have any thing in mind how the GUI interface should be?

adeas31 avatar Feb 19 '25 11:02 adeas31

Basically, linearize() does a regular simulation and then computes the A,B,C,D matrices of the linearize system at the end of the simulation, using the final state values to compute the jacobians"

Interface setup:

  • Add an extra button after Simulate with Animation, call it Linearize, add a 2x2 matrix on the icon
  • Also add a Linearize checkbox at the bottom of the General Tab of the Simulation window
  • Add a drop-down menu right above C/C++ Compiler Flags (Optional), with the options of --linearizationDumpLanguage flag. We can skip "none" which is not very useful. Default Modelica.
  • The output is some generated file. The output text of the linearize function should be displayed in the Message window, it contains the exact location of the file

Test model: Modelica.Blocks.Continuous.Integrator

casella avatar Apr 03 '25 15:04 casella

@adeas31 can this make it for 1.26.0?

casella avatar Nov 17 '25 16:11 casella