- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Bode plot
Bode plot
Bode plot
Hello all,
I am a newbe in OpenModelica and I hope you can help me with my problem.
I would like to have a plot depicting the frequency response of a linear system, a bode plot. In the standard libraries I found the Modelica_LinearSystems2 that would be able to give me such a plot. So I started with the documentation of this library. First you have to import the needed functions. I tried this in OMShell with
>>> import Modelica_LinearSystems2.Math.Complex
Error occurred building AST
Syntax Error
[<interactive>:1:0-1:6:writable] Error: Parser error: Unexpected token near: import (IMPORT)
So, it seems that I am not allowed to directly import this functions. In order to get a bode plot, I hope someone can help me how I can import the Modelica_LinearSystems2 library and use it ? Is this the best way, or should I do this differently?
Thanks in advance
Bas
- bjdekruif
- 18 Posts
Re: Bode plot
Hi,
I had a look inside the library and this library will never work with any other tool but Dymola.
Is full of special Dymola annotations and Dymola API calls which are not standardized.
I downloaded this one: https://github.com/modelica/Modelica_LinearSystems2
Had to rename the directory inside from Modelica_LinearSystems 2.3.1 to Modelica_LinearSystems2 2.3.1
but the loading went fine after that.
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
Re: Bode plot
Hi,
I now added a ticket:
https://trac.openmodelica.org/OpenModelica/ticket/2670
so that we can investigate if is even possible to support
this library sometime in the future.
We do have most of the functionality used in the library
but is different (the API is different, the plotting is different, etc).
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
Re: Bode plot
Hello,
Thanks for your help.
I found how I could linearize the system and then read it in Matlab. Still, I didn't find my happy work flow to get a bode plot. I see several routes to get there:
i) use 'linearize(model)' in OMShell, and read the result in Matlab. --> I don't understand the format of the matrices. 'name' and 'description' give 64 items, but my data matrices are 18x2 and 27x502. With these dimensions I find it difficult to go to a state space system.
ii) use the commands available in OMShell. This would be my preferred approach, but don't know how to do this. Can this be done?
iii) use exportDAEtoMatlab / dumpXMLDEA and work from there. The output of these files are not clear to me.
What would be the 'best' approach? Could someone point me to some manuals to understand this better? (I've read the user manual and some of the tutorials and could find it there. Also in the book of Peter Fritzson I couldn't find this)
Thanks for all help!
Bas de Kruif
- bjdekruif
- 18 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Bode plot