24 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
BW am 26 Jun. 2024 um 12:08
Kommentiert: Paul am 27 Jun. 2024 um 16:38
Akzeptierte Antwort: Paul
- demo_model_tf.slx
I am trying to learn to use the simulink model linearizer to obtain a transfer function from the following simplified model in MATLAB 2020b:
If I understand the manual correctly, in order to obtain the closed-loop transfer function of the full loop PI/(1+PI*Feedback), the complementary sensitivity analysis point should be applied here:
When applying this at the model output and running the linearizer, the following tf is obtained:
However, the result differs from my own calculations.
When I apply the open-loop input and output however to the loop as follows:
This seems to give me the correct result:
Using these is not always possible in my other complex model however, without ripping it apart. The way I understand the manual, both approaches should be identical. Where am I wrong, what does the complementary sensitivity yield here and what would be the correct way of obtaining the closed loop tf?
Edit: Also, is it possible to obtain a tf with gain parameters held as undefined variables instead of numerical values from such a model?
My sincere thanks for helping me out with this one...
0 Kommentare -2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden
-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden
Melden Sie sich an, um zu kommentieren.
Melden Sie sich an, um diese Frage zu beantworten.
Akzeptierte Antwort
Paul am 27 Jun. 2024 um 0:26
In MATLAB Online öffnen
Hi BW,
Define PI and F
s = zpk('s');
PI = 1 + 2/s;
F = 6;
In the first case, the linerarizer computes the transfer function from the input arrow to the output arrow.
The forward path gain is -F*PI and the loop gain is also -F*PI. Using the standard transfer function formula we get
H = -F*PI/(1 - (-F*PI))
H = -0.85714 s (s+2) ---------------- s (s+1.714) Continuous-time zero/pole/gain model.
which is the result produced by the linearizer (keeping in mind that s in the numerator cancels with s in the denominator.
Fo the second case, the transfer function is from the input arrow to the output arrow, which is the result you expect:
H = feedback(PI,F) % better way to compute PI/(1 + F*PI)
H = 0.14286 (s+2) ------------- (s+1.714) Continuous-time zero/pole/gain model.
and what the linearizer produces.
The correct way to get the closed loop transfer fucntion from r to y is the second approach.
Not sure why the second approach would require "ripping apart" the model. Just place the linear anlaysis points where they need to be, exactly as you did.
No, one can't obtain the TF from simulink in terms of unevaluated, or symbolic parameters. You can specify a grid of parameters and get a grid of linearizations. Search the doc for "Batch Linearize Model for Parameter Variations"
2 Kommentare Keine anzeigenKeine ausblenden
Keine anzeigenKeine ausblenden
BW am 27 Jun. 2024 um 11:54
Direkter Link zu diesem Kommentar
https://de.mathworks.com/matlabcentral/answers/2132186-why-do-these-methods-to-obtain-the-simulink-model-transfer-functions-return-different-results#comment_3196981
Bearbeitet: BW am 27 Jun. 2024 um 11:56
Thank you Paul for taking the time and giving me this comprehensive and most helpful answer - that helped me to understand the difference. In the provided example from the manual without feedback gain, the tf are identical and since it just spoke about 'the closed loop transfer function' I went to conclusions too fast.
With 'ripping apart' largely I meant the need to place a gain of 1 following the closed loop, and place the open-loop output behind this, so the feedback is not opened by the linearizer. Or would placing the open-loop output behind the sum of the PI yield the same result as in the second example above?
As a side note, I think the feature of just building a model with variable parameters and obtaining an analytical transfer function for further calculations etc. might be a huge time saver especially for students or beginners who are not that versed with the symbolic math toolbox.
Paul am 27 Jun. 2024 um 16:38
Direkter Link zu diesem Kommentar
https://de.mathworks.com/matlabcentral/answers/2132186-why-do-these-methods-to-obtain-the-simulink-model-transfer-functions-return-different-results#comment_3197276
In MATLAB Online öffnen
You're quite welcome.
For this problem there is no need to use open-loop input and open-loop output analysis points. Instead, use the input perturbation and the output measurement analysis points. The former goes on the output of the Constant block, like you already have, and the latter would go at the output of the PI sum block. This way there is no need for the additional gain block at the input to the scope.
The open-loop analysis points are useful when you want to get the TF for only a portion of the model. For example, if you want the TF of only the PI you could put an open-loop input on the output of the sum block that forms the error signal and an open-loop output at the output of the PI sum block.
Unfortunately, neither Simulink, Simulink Control Design, nor the Control System toolbox offer any facility for analytical, rather than numeric, analysis. The closest they come is being able to represent parameterized models, but the parameterization is always for specific numerical values. You can submit an enhancement request to MathWorks if you feel strongly about it.
The Symbolic Math Toolbox isn't that hard to learn and use for basic problems such as this. Sometimes it takes a bit of effort to wrangle results into simpler forms. Let's assume your feedback gain is K_f
syms s K_f
PI(s) = 1 + 2/s;
F = K_f
F=
H(s) = PI/(1 + F*PI)
H(s)=
[num,den] = numden(H(s))
num=
den=
H(s) = num/den
H(s)=
For our specific case
H(s) = subs(H(s),K_f,6)
H(s)=
I've often wondered how hard it would be to build a toolbox that provides basic control system analysis functionality for commands like feedback, et. al. and other basic functions for symbolic representations of linear systems. Maybe there's something out there already on the File Exchange. I know that there are threads on this forum that show how to convert symbolic objects, like H(s), into lti objects for use with Control System Toolbox.
Melden Sie sich an, um zu kommentieren.
Weitere Antworten (0)
Melden Sie sich an, um diese Frage zu beantworten.
Siehe auch
Kategorien
Control SystemsSimulink Control DesignControl System Design and TuningClassical Control Design
Mehr zu Classical Control Design finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Es ist ein Fehler aufgetreten
Da Änderungen an der Seite vorgenommen wurden, kann diese Aktion nicht abgeschlossen werden. Laden Sie die Seite neu, um sie im aktualisierten Zustand anzuzeigen.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- Deutsch
- English
- Français
- United Kingdom(English)
Asien-Pazifik
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)
Kontakt zu Ihrer lokalen Niederlassung