I have a simulation that is very slow at certain times (in my example shown below at time=358.65). In the eventlog.txt
and dslog.txt
there are no entries for this time. As a next step I set GenerateTimers and GenerateBlockTimers to true, but I had to stop the simulation and it seems in this case the Timer results cannot be viewed!?
After 8E4 seconds (22h) of CPUtime I stopped the simulation.
At simulation time 358.65 no events occured, but a lot of warnings related to negative temperatures and negatives pressures, so I assume the nonlinear solver is going in the wrong direction somehow!? So, I would like to identify the system of equations that is so difficult to solve at time=358.65.
First question: This is strange, for me after stopping a simulation I can open both, dslog.txt
and eventlog.txt
and they are containing the respective information.
Second question: There are a couple of ways to investigate the performance of a model. I assume you used some of them, but I'll nevertheless list them for completeness, going from simple to more advanced ones (anybody feel free to extend if I forgot something):
OutputCPUtime = true;
from the command line.le = true
and continue the simulation by entering c
. The output should indicate if events occur quickly. If many events occur and time does not advance the problem is likely "chattering".Advanced.GenerateTimers=true
Advanced.Define.PrecisionTiming=true
Advanced.DymosimRealTimePriority=true
plotTiming.mos
in your working directory. This will define a matrix which can be plotted by typingRunScript("plotTiming.mos",true)
createPlot(grid=true, leftTitle="Execution time for step", bottomTitle="Simulation time");
plotArray(times[:,1],times[:,2],-1);
Advanced.GenerateTimers=true
Advanced.GenerateBlockTimers=true
dsmodel.c
should help (if you have the license to create source files from your model). The c-file contains links to the sections mentioned in the log's output.For your specific case I think the points 1-4 should help. For 5 and 6 you should have more information in Dymola Manual Section 5.7.5.