solver discrete or continuos in simscape?

2 views (last 30 days)
Tony Castillo
Tony Castillo on 9 Nov 2016
Commented: Devraj Dutt on 14 Nov 2016
Hi, I'm doing some changes to my model (an installation for solar harvesting) in order to improve its performance and reduce the simulation time which is too long since I integrate the DC-DC converter to the whole system (speed up and keep a reasonable accuracy). These were the changes:
1-Change solver from variable-step (no continuos step) to variable-step (ode23tb)
2-Powergui from Discrete (TBE with a sample time 0.01) to continuos (ideal switching)
3-In order to break an algebraic loop, I first used a Delay Block, but now I use a Transfer Fcn (with initial outputs).
I have to pinpoint that in discrete mode my system takes 27 hours to simulate 24 hours of energy production. However, in continous mode, it now takes around a week to simulate 24 hours of solar generation.
It is important to note that this model is composed of both Simulink blocks and Simscape blocks.

Answers (1)

Devraj Dutt
Devraj Dutt on 9 Nov 2016
ode23tb is the best solver I've used for power electronics simulations.
Option 1: For point 2, also try changing each switch in your model to ideal via its properties.
For point 3, try using a memory block instead (https://www.mathworks.com/help/simulink/slref/memory.html)
Option 2: For point 2, run it back on TBE.
For point 3, try using a memory block instead (https://www.mathworks.com/help/simulink/slref/memory.html)
  2 Comments
Tony Castillo
Tony Castillo on 10 Nov 2016
Hello my dear friend,
I really appreciate your effort in trying to help me. I have carefully read your advice, but I found two main problems when trying to apply them in my simulation:
1-The input (voltage) of my memory block is dynamic. This means that is constantly changing during the simulation. The link to Matlab info that you sent me was really useful. However, it states that:
*Tip Avoid using the Memory block when both these conditions are true:
a-Your model uses the variable-step solver ode15s or ode113.
b-The input to the block changes during simulation.
In my case is the b condition, so I can't apply it.
2-Aditionally, I got this answer from Mathworks team stating that:
"Memory or delay blocks are used to break algebraic loops in regular Simulink models, but Simscape negates the need to do this as it models the differential algebraic equations directly. Actually, in Simscape it is harmful to use delay blocks as it makes it very, very hard for the solver to find an equilibrium"
The answer from the MathWorks team is in conflict with your recommendation, but i have to pinpoint that matlab recomendation does not improve my system. So again, I cannot apply it.
In any case, thank you very much for your help.
Devraj Dutt
Devraj Dutt on 14 Nov 2016
Have you tried the memory block, though? The physical effect of the memory block is that it delays the signal by one time-step. Do you think it would matter a lot (really depends on the resolution of your voltage measurement and also how quickly the voltage can change in your system - is it more than 100 Hz)? I have tried using memory to solve issues even in circuits with upto 20000 Hz switching (simscape with powergui), provided that the timestep is lesser than that by at least a factor of 10-100, it may not be a big issue. Ofcourse, if you'd like to go ahead with mathworks advice, I cannot contradict that.

Sign in to comment.

Categories

Find more on Electrical Sensors in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!