d2c adding additional states to LTI

조회 수: 3 (최근 30일)
Bobby Bowes
Bobby Bowes 2023년 3월 29일
댓글: Bobby Bowes 2023년 3월 30일
I have a code that generates LTI models from discrete data, but I want to convert these models to continuous time, find the poles, and graph them. However, it seems that sometimes the d2c command adds additional states to my LTI model, as sometimes 5 poles are plotted. For example, for input data:
A_d=
1e+02 *
[0.110718619719143 -0.000737035149479 0.005729905388717 0.002429002265981;
4.276449431807656 -0.061071995313254 0.224664623811597 0.129453363954370;
-0.538137374064281 -0.006447736970600 -0.024323793240258 -0.004926156054745;
-1.082215587707828 0.011554930600797 -0.061260060208437 -0.020742803197906]
B_d=
[-0.013197318263078 -0.010662300061863;
-0.084279695692959 -0.125748471071436;
0.255309963036999 0.234028132342303;
-0.053037841835195 -0.122322843312343]
C_d =
1e+03 *
[0.809135901283113 0.016146667001697 0.066876783330997 0.026997790334984;
2.652006224816887 0.025394720425434 0.144074070140717 0.030699906773961]
, with D = zeros(2) and Ts = 1/34, d2c works as expected and outputs a LTI model with the same dimension as the input model. However, with input data:
A_d =
1e+02 *
[0.014256036806390 0.000450223367637 0.000576376517480 -0.000181827888041;
0.713615194260463 -0.003988872955590 0.031668241792225 0.024244473762646;
-1.230825050245824 -0.011325109710390 -0.044114258586243 -0.014074597764196;
0.624575354854199 -0.003751802624661 0.026340578460956 0.022458741153831]
B_d =
[0.000427078629755 0.002174440442580;
-0.043995584274625 -0.135390100744158;
0.048071594697139 0.056047678621764;
-0.134685120049440 -0.228138013688793]
C_d =
1e+03 *
[-0.253446150811753 0.106308785638307 0.018042545849229 -0.076419675803371;
1.940732966317529 0.222293334310487 0.084558057040129 -0.160651458161224]
and the same inputs for D and Ts, d2c outputs a LTI model with a 5x5 A matrix, which doesn't work for eigenvalue comparison as it has an additional pole. I am not sure if this is an issue with d2c, but I am sure I am not inputting values correctly as I input them the same way for all models.

채택된 답변

Paul
Paul 2023년 3월 30일
Hi Bobby,
d2c using either the zoh or foh methods has a constraint that the eigenvalues of the A matrix can't be on the negative real axis (or at the origin). This is the case for the second example
A_d = ...
1e+02 * ...
[0.014256036806390 0.000450223367637 0.000576376517480 -0.000181827888041;
0.713615194260463 -0.003988872955590 0.031668241792225 0.024244473762646;
-1.230825050245824 -0.011325109710390 -0.044114258586243 -0.014074597764196;
0.624575354854199 -0.003751802624661 0.026340578460956 0.022458741153831];
B_d = ...
[0.000427078629755 0.002174440442580;
-0.043995584274625 -0.135390100744158;
0.048071594697139 0.056047678621764;
-0.134685120049440 -0.228138013688793];
C_d = ...
1e+03 * ...
[-0.253446150811753 0.106308785638307 0.018042545849229 -0.076419675803371;
1.940732966317529 0.222293334310487 0.084558057040129 -0.160651458161224];
format long e
eig(A_d)
ans =
-9.365895055815976e-01 + 0.000000000000000e+00i -4.302069323674218e-01 + 8.441578690590781e-01i -4.302069323674218e-01 - 8.441578690590781e-01i 6.581680121552396e-01 + 0.000000000000000e+00i
The first eigenvalue is the offender.
When we run d2c we actually see a warning to this effect
Ts = 1/34;
sys2d = ss(A_d,B_d,C_d,0,Ts);
sys2c = d2c(sys2d);
Warning: The model order was increased to handle real negative poles.
When d2c (using zoh or foh) encounters a pole on the negative real axis (and the A,B,C matrices are real as in the typical case), it replaces it with a conjugate pair of very nearby complex poles and a very nearby single real zero. If you can envision that, this zero/conjugate pole pair is approximately equivalent to the original real pole, at least in a frequency domain sense.
The reason for this behavior is that the d2c with zoh or foh uses logm and the eigenvalues of the input to logm include the eigenvalues of the A matrix. As seen on that doc page, logm has issues with inputs that have eigenvalues on the negative real axis. Hence, d2c does what it does.
I ran this example in the debugger and bypassed this logic. The resulting Bode plot comparison between sys2d and sys2c was not too good.
  댓글 수: 1
Bobby Bowes
Bobby Bowes 2023년 3월 30일
Thanks Paul! I’ll be sure to keep that in mind when using d2c in the future

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dynamic System Models에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by