How to simulate a SS model with parametric sampling time?

2 ビュー (過去 30 日間)
Hasan Ghorbani
Hasan Ghorbani 2015 年 5 月 13 日
編集済み: Sebastian Castro 2015 年 5 月 14 日
Hi,
As it has been stated in the title, I have been given a state space model as:
And I have been asked to discretize it with a ' proper ' sampling time. Obviously the term ' proper ' is something which relates to the other parts of my task but for now, I want to know is there any tool in Matlab that I could ,perhaps, see the changes of system response to different values of Ts (sampling time)?
Regards
  3 件のコメント
Hasan Ghorbani
Hasan Ghorbani 2015 年 5 月 14 日
No. Assuming I have a SS model in continuous time domain, I something like pretty much what c2d command does in Matlab but c2d requires some sampling time as one of its arguments. What I was wondering about is to pass the sampling time as a parameter to c2m and see the impact of different sampling time on system response.
Sebastian Castro
Sebastian Castro 2015 年 5 月 14 日
Well... you could use c2d multiple times and then plot the step response or Bode plots of all your systems. This should let you visually inspect what a "good" sampling rate should look like.
See my answer below these comments.

サインインしてコメントする。

回答 (1 件)

Sebastian Castro
Sebastian Castro 2015 年 5 月 13 日
編集済み: Sebastian Castro 2015 年 5 月 14 日
Assuming you have Control System Toolbox and you already made your matrices A, B, C, D, you can package them up into a state-space container:
sys = ss(A,B,C,D)
Then, you can discretize them with the | c2d | function, using different sample times and methods:
sysD1 = c2d(sys,0.1);
Ts = 0.01;
sysD2 = c2d(sys,Ts);
sysD3 = c2d(sys,Ts,'tustin')
I'd look at the documentation for c2d for more info on those discretization methods.
Then, you can plot all the systems together (in time or frequency domain) to determine how the results compare to the "real" continuous system:
step(sys,sysD1,sysD2,sysD3);
bode(sys,sysD1,sysD2,sysD3);
- Sebastian

カテゴリ

Help Center および File ExchangeGet Started with Control System Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by