- 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
조회 수: 8 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2022년 10월 13일
편집: MathWorks Support Team
2022년 10월 28일
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?
채택된 답변
MathWorks Support Team
2022년 10월 28일
편집: MathWorks Support Team
2022년 10월 28일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 PID Controller Tuning에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!