How to close a feedback loop in parallel models with arrays as inputs/outputs?
1 次查看(过去 30 天)
显示 更早的评论
Hello everyone,
I'm trying to adapt this example https://www.mathworks.com/help/control/ug/kalman-filtering.html to my system with a kalman filter.
In the example, a system 'sys' is created by combining in parallel the subsystem 'P' and an kalman filter 'kalmf' previously constructed.
sys = parallel(P,kalmf,1,1,[],[]);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/504083/image.png)
The goal is to send the 2nd output 'yv' to the 4th input 'yv' in 'sys', by doing
SimModel = feedback(sys,1,4,2,1); % Close loop around input #4 and output #2
I searched for the documentation of feedback function and I found examples with sys1 and sys2 in the two first arguments of feedback function. So, my first doubt is:
What the 2nd argument '1' means to the feedback function? And the 5th argument?
Secondly, in my system, the inputs and outputs are vectors:
Inputs Outputs
1-88: w(88x1) 1-2: y(2x1)
89-90: v(2x1) 3-4: yv(2x1)
91-134: u(44x1) 5-6: ye(2x1)
135-136: yv(2x1)
Thus, I thought that the arguments feedin '4' and feedout '2' should be replaced by 135:136 and 3:4, like so
SimModel = feedback(sys,1,135:136,3:4,1); % Close loop around input #4 and output #2
But it gives me the error message:
In the "feedback(SYS1,SYS2,FEEDIN,FEEDOUT,...)" command, FEEDIN must have as many entries as outputs in SYS2.
and I don't understand whats going on, since there's no SYS2 in the function.
So, how should I proceed to correctly feedback yv as an input?
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!