-
Notifications
You must be signed in to change notification settings - Fork 25
Quick Tips
Scott G edited this page Aug 14, 2020
·
12 revisions
- If large Dymola models are bogging you down, try putting
Hidden.CachedImagePaint=true
in the command line.
- Relevant reference: https://github.com/RWTH-EBC/AixLib/wiki/How-to:-Dymola-Python-Interface
- In Explorer, go to your Anaconda path.
- e.g.,
C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\Lib\site-packages
- AppData is a "hidden" folder and can be seen by going to
View
and checkingHidden Items
- e.g.,
- Create a text file and rename to a reasonable name
- e.g.,
dymola-python-interface.pth
- When changing the text file extension you should see
.txt
. If that is not visible go toView
and checkFile name extensions
.
- e.g.,
- Open up
dymola-python-interface.pth
and add the path to thedymola.egg
file. Save and close.- e.g.,
C:\Program Files\Dymola 2021\Modelica\Library\python_interface\dymola.egg
- e.g.,
- Open a new anaconda tool (e.g., jupyter notebook, terminal, or spyder) and
dymola
should not be able to be loaded.import dymola
d={.2,.4,.6,.8};
openModel("TRANSFORM.Blocks.Examples.EasingRamp_Test");
for i in 1:4 loop
easingRamp.duration = d[i];
translateModel("TRANSFORM.Blocks.Examples.EasingRamp_Test");
simulate();
//simulateExtendedModel("TRANSFORM.Blocks.Examples.EasingRamp_Test",initialNames={"easingRamp.duration"},initialValues={d[i]},finalNames={"easingRamp.y"});
system("copy dsres.mat results"+String(i) +".mat");
end for;