How to simulate a complex-valued space state system in simulink or by command?

I have a complex-valued discrete space-state LTI system, where A belongs to C^n space and B,C,D to the R^n space, I need to simulate its response and I have tried to use lsim to do it, but it says it has problems with complex values as well as in simulink.
Someone has asked this question before and he has been recommended to use ltitr command, I have tried to use but inmediatly it says that "Matrix dimensions must agree". My matrices are,
I have a closed loop matrix (phi_clamp) which I construct by using a controller which is [XOUT 0]; and then I construct my space-state system which I need to simulate (sys_clamp).
phi_clamp=phiamp+gammaamp*[XOUT 0];
sys_clamp=ss(phi_clamp,gammaamp,Cc,Dd,h);% needs to be simulated
sys_clamp =
a =
x1 x2 x3
x1 0.364-0.0489i 0.771+0.0254i 0.00995
x2 -1.28-0.0988i 0.538+0.0514i 0.01
x3 -1.3-0.0998i -0.467+0.0519i 0
b =
u1
x1 0.49
x2 0.99
x3 1
c =
x1 x2 x3
y1 1 0 0
d =
u1
y1 0
Sample time: 1 seconds
Discrete-time state-space model.
By other hand to simulate with ltitr command what I have done is:
Xsim=ltitr(phi_clamp,gammaamp,U);
and I have use an U which is
t=0:h:50;
U=0.5*square(t/10,50)
because it says that it should be ltitr(A,B,U), but it says that "Matrix dimensions must agree". So what is wrong?
To simulate via simulink I have used a discrete space-state block with phiamp, gammaamp, C and D and my controller as a gain, it shows problems inside the block because of the complex values, the question here is should I change a parameter of the block or a simulation parameter, or what?

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 1월 14일
편집: Azzi Abdelmalek 2014년 1월 14일
a=[ 0.364-0.0489i 0.771+0.0254i 0.00995
-1.28-0.0988i 0.538+0.0514i 0.01
-1.3-0.0998i -0.467+0.0519i 0]
b=[0.49;0.99;1]
c=[1 0 0]
d=0
t=0:h:50;
U=0.5*square(t/10,50)'
xsim=ltitr(a,b,U)
U should be a column vector
Or, you can also use lsim
system1=ss(a,b,c,d,1)
[output,time,state2]=lsim(system1,U,t)

댓글 수: 3

Thanks for your answer that was the problem. I was taking the vector U as a row vector like in lsim. In the case of simulink what should I do?, is the most important for me.
Can you please tell the how could I realize a complex statespace system in Simulink?

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Time and Frequency Domain Analysis에 대해 자세히 알아보기

태그

질문:

2014년 1월 14일

댓글:

2020년 6월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by