Find Bode Phase of Uncertainty models

12 次查看(过去 30 天)
How can I find the phase programatically, of an Uncertainty plot like this one? This transfer function is build using the Robust Controls toolbox.
Eg I'd like to read at what frequency range, the phase drops to (say) -45 degrees.
If this was a normal bode of a single SISO model, it'd be easy: do a bodeplot() and read out phase and magnitude data, and/or use margin().
But this is an uncertain model range. I don't know how to read out the phase data, much less its bounds.
Does anyone know how to get phase data of Uncertain models?
% Transfer function (with uncertainty) example
a = ureal('a', 1, 'percent', 50);
s = tf('s');
res = 1 / (s + a);
bode(res);

采纳的回答

Paul
Paul 2022-1-28
I don't know if there is much control over what bode() does with a uss input, but you can get at the data in the plot after the fact. Kind of kludgy though. Disappointing that bode() with return arguments doesn't return the mag and phase of all of the curves.
% Transfer function (with uncertainty) example
a = ureal('a', 1, 'percent', 50);
s = tf('s');
res = 1 / (s + a);
bode(res);
hax = get(gcf,'Children');
hg = get(hax(2),'Children')
hg =
2×1 graphics array: Group (res) Line
get(hg(1))
Annotation: [1×1 matlab.graphics.eventdata.Annotation] BeingDeleted: off BusyAction: 'queue' ButtonDownFcn: '' Children: [21×1 Line] ContextMenu: [0×0 GraphicsPlaceholder] CreateFcn: '' DeleteFcn: '' DisplayName: 'res' HandleVisibility: 'on' HitTest: on Interruptible: on Parent: [1×1 Axes] PickableParts: 'visible' ScribeContextMenu: [] Selected: off SelectionHighlight: on Tag: '' Type: 'hggroup' UserData: [] Visible: on
So hg(1).Children is an hggroup that contains 21 Lines, for which the XData and YData are accessible. For example, replot one of the phase curves.
semilogx(hg(1).Children(1).XData,hg(1).Children(1).YData);
xlim([.02 100])
If the line data is accessible, it can be processed after pulling it all out of the plots.
  1 个评论
John
John 2022-1-31
Thank you -- I will try this out as a starting point.
(If it looks like it leads to where I'm trying to go, I'll mark it as an accepted answer)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with Control System Toolbox 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by