Generating transfer function is extremely slow
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I'm currently trying to optimize the control gains of a cascaded control structure. To do so, I want to iterate over a certain range of control parameters where for each combination of control gains, I want to calculate the step response and some other characteristics of the resulting system. This means that I require the closed loop transfer function of the resulting system, which I have as an analytical expression written in my code.
The problem is now, that the generation of the transfer function is extremely slow. It takes approx. 0.6 s to generate the transfer function, which I do like this:
% Initialize
s = tf('s');
K = [5 7 10]; % Control gains to iterate through
Ti = 7;
% some more code
for j=1:length(K) % Iterate over K
% Generating Gref takes 0.6 s
Gref = 1/(1+s*Ti*K(j));
% Some more code
This is a major problem since I have to iterate over a large set of different parameters (some 100k points) and most of the computation time is lost here. The required time seems not to change with the length of the expresseion for Gref. Is it possible to speed this up? Is there some better solutions for this? Providing the coefficients as numerical array directly did not really change computation time. I also tried whether the generations of a state space model instead of a transfer function would help, but the required time is approximately the same.
0 comentarios
Respuestas (1)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!