Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use the result values from previous simulation result as guess values for next simulation in Dymola

Initialization could be very cumbersome and easily lead to divergence. A simple strategy is to run the simulation when building a part of the whole system and use the simulation results to modify guess values. Here is what I got in the PPT from Francesco Casella and the book from Daniel Bouskela.

enter image description here

enter image description here

I found that I could use an option in Dymola as follows, but instead of using the initialization result, I wanna use the result when reaching a steady state. So I'd like to use a python script to extract the result from the .mat result file, then modify the iteration variables automatically. But the key problem is that I don't know when I add more components in my model, the iteration variable set of existing components would change, I don't know what kind of effect would this causes. Anyone got opinion on this issue, welcome to answer this question.

So my question is where should I find the python

enter image description here

enter image description here

like image 736
Jack Avatar asked Dec 08 '19 14:12

Jack


2 Answers

You can use the end values (= steady state) of the simulation result in order to create a new initialization (Dymola Manual 1, section 2.5.12) . If the component names are the same in the sub system model and the total model, you can run the script created in the subsystem model on the larger system model as well. But you have to check if your models have initial equations that hinder an initialization from the outside (see section 4.2 in https://2012.international.conference.modelica.org/proceedings/html/pdf/ecp12076927_KruegerMehlhaseSchmitz.pdf)

like image 167
Imke Krueger Avatar answered Sep 19 '22 01:09

Imke Krueger


It should also be possible to initialize it steady state. Instead of providing initial values for a state x and fixing it, you can provide initial equations for the derivatives such as der(x) = 0;

With that setup activate Save Initial Results and you should be good to go.

like image 37
kabdelhak Avatar answered Sep 22 '22 01:09

kabdelhak