State-space feedback system using simulink

6 次查看(过去 30 天)
So, I wanted to make a Simulink model for a closed-loop system using Matlab Function block to describe the plant in a state-space form.
I have further simplified the controller (from PID to P) from the original design because the y(output) is failing to track the reference at all, as you can see below.
And here is the code for the Matlab Function that inputs x and u and outputs xdot and y. (simplest linear model for the time being)
function [xdot,y] = fcn(x,u)
%xdot = [0;0];
xdot = [0 1; -1 0]*x + [ 0; 1]* u;
y = x(1);
end
It is very unclear to me what I have done wrong. Why 'error' isn't exactly the difference between the ouput and the reference is hard to understand because there is nothing special about the sum block: it just adds, substracts, simple. I have defined the dimension of x in the integral block, which is set as [2 1].
Any insights or help would very much be appreciated! Thank you.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Time and Frequency Domain Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by