AnalysisPoint fails when using multiple connect commands
显示 更早的评论
I am attempting to connect multiple control subsystems (G1, G2) using the connect command. Each subsystem has analysis points connected to internal signals. I get an error when I connect the subsystems and attempt to keep the analysis points. The issue seems to be related to using multiple instances of the connect command. My current workaround is to use the connect command once. However, for building up large systems with multiple transfer functions this seems unwieldy.
Example code showing the problem is given below. I want to have access to analysis points "InnerError" and "OuterError" in the full model.
G1 = tf([1],[1 0]);
G1.u = 'OuterError';
G1.y = 'InnerCmd';
G2 = tf([1], [1 1]);
G2.u = 'InnerError';
G2.y = 'ActuatorCmd';
SumOuter = sumblk('OuterError = OuterCmd - Outer');
SumInner = sumblk('InnerError = InnerCmd - Inner');
disp('Connect everything at once. This works.')
Sys1 = connect(G1,G2,SumOuter,SumInner,{'OuterCmd','Outer','Inner'},'ActuatorCmd', {'InnerError','OuterError'})
disp('Connect things in series. This does not work with AnalysisPoints.')
P1 = connect(G1,SumOuter,{'OuterCmd','Outer'},'InnerCmd','OuterError');
P2 = connect(G2,SumInner,{'InnerCmd','Inner'},'ActuatorCmd','InnerError');
Sys2 = connect(P1,P2,{'OuterCmd','Outer','Inner'},'ActuatorCmd', {'InnerError','OuterError'});
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Setup for Tuning MATLAB Models 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!