필터 지우기
필터 지우기

(Need Help) How to generate state-space model in Matlab?

조회 수: 4 (최근 30일)
Changwoo Lee
Changwoo Lee 2021년 10월 31일
댓글: Paul 2021년 10월 31일
I have a below state-space equation.
--- eq. (1)
where A,B,C,D is coefficient, x is control variable, u is control input, and y is control output.
I want to generate the state-space model from the above equation (1).
For this reason, I tried to convert the equation (1) to state-space model using the matlab command ('ss').
However, It seems that the matlab command ('ss') can be only applied the following form.
--- eq. (2)
(The coefficient A to D in Eqs. (1) and (2) are different values. It was just used for the explanation)
How to generate state-space model of Eq. (1)?

채택된 답변

Paul
Paul 2021년 10월 31일
The output in eq (2) should be:
y = C*x + D*u
i.e., D multiplies the input. It's not a constant in the output.
To your question, the short answer is, no you can't, at least with the built-in functionality of the Control System Toolbox. The system as shown is (in general) not LTI, which is a key property of systems that toolbox is intended to be used for.
However, is it possible a term is missing from eq (1)? That is, should C multiply another input vector, maybe something like:
xdot = A*x + B*u + C*w ?
  댓글 수: 2
Changwoo Lee
Changwoo Lee 2021년 10월 31일
편집: Changwoo Lee 2021년 10월 31일
First of all, thank you for your reply.
1) In Eq. (2), as like your answer, the corret form is y=C*x+D*u. It was my mistake.
2) In Eq. (1), C is constant matrix, and the form (xdot=A*x+B*u+C) is corret.
Refeclting your valuable comment, if assume that w=1, the equation (xdot=A*x+B*u+C*w) might be equal to (xdot=A*x+B*u+C), but I'm not sure that this procedure is corret.
With w=1 and your comment (xdot=A*x+B*u+C*w), could I generate the LTI (lineary time invariant) model in Matlab? It seems that the matlab command ('ss') not provide the disturbance term (w).
If there is no proper command in Control System Toolbox, how to generate the user-defined model manually?
Paul
Paul 2021년 10월 31일
It really depends on what you're going to do with your model. You could do something like this:
sys = ss(A,[B C],D,0);
which creates a new input vector unew = [u ; w] where u is the "real" input that can be anything and w is ficitious input that is always w = ones(size(C,2),1). Depending on what the use case is, you might be able always account for the fact that w is always fixed in all of your analysis. I guess it depends on what you're going to do with sys.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by