- Using Accelerator or Rapid-Accelerator Mode of Simulation if the accuracy is not to be reduced.
- If there are more simulations, they could be simulated parallelly using "parsim" function.
- If a reduction in accuracy of the simulation is acceptable "modred" function can be used to convert the transfer function to state-space model by removing negligible states.
Speeding up Simulation with Higher Order Transfer Function
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 13 Ott 2022
Modificato: MathWorks Support Team
il 28 Ott 2022
For a Higher Order Transfer Function the simulation is very slow due to small step sizes taken by the solver. How can we speed up the simulation in Simulink R2021a?
Risposta accettata
MathWorks Support Team
il 28 Ott 2022
Modificato: MathWorks Support Team
il 28 Ott 2022
The simulation runs in the order of e-8 seconds for a model containing a transfer function of 7th order in Simulink R2021a. If the simulation step-size is increased manually the simulation fails due to singularity in the transfer function.
In the case of Higher Order Transfer Functions, the solver will choose a small step-size to properly capture the high-frequency dynamics resulting from Higher Order Transfer Function. By setting the step-size manually it is prone to error because of the large variation between two successive steps.
These are the possible workarounds if simulation speed needs to be increased-
The following code snippet provides an example of converting the transfer function to state-space model.
num = [ 3 0 ];
den = [ 2e-34 14e-25 1e-16 2e-09 0.0023 39.1 2.05e07];
sys = tf(num,den) % transfer function of 7th order
[sys,g] = balreal(sys) % Compute balanced realization
elim = (g<1e-8) % Small entries of g are negligible states
%rsys is a state space object
rsys = modred(sys,elim) % Remove negligible states
For more information on the functions used in the above code snippet please refer to the following documentation links
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su PID Controller Tuning in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!