フィルターのクリア

matlab question response question

2 ビュー (過去 30 日間)
johnaly7
johnaly7 2014 年 3 月 13 日
編集済み: johnaly7 2014 年 7 月 21 日
I have a control system with a PID controller, and im trying to simulate a system response, i need to plot the values first in a graph and then add the transfer function?
this is what i have found and im doing:
dt = 0.1; t = 0:dt:50; u = zeros(1,numel(t)); u(t<=20) = 45; u(t> 20 & t<=40) = -45; u(t> 40) = 0;
obviously with the lsim command
Is there a better way ?
Thanks in advance

採用された回答

Mischa Kim
Mischa Kim 2014 年 3 月 14 日
編集済み: Mischa Kim 2014 年 3 月 14 日
John, you just need to build the signal (no need for plotting), e.g.,
dt = 0.1; % adjust as necessary
t = 0:dt:50;
u = zeros(1,numel(t));
u(t<=20) = 45; % you probably want to use rad instead of deg
u(t> 20 & t<=40) = -45;
u(t> 40) = 0;
and feed it as an input to the system.
  1 件のコメント
Mischa Kim
Mischa Kim 2014 年 3 月 14 日
編集済み: Mischa Kim 2014 年 3 月 14 日
Correct,
lsim(sys,u,t)
or similar. You might have/want to specify initial conditions x0 for the system, in which case you'll have an additional parameter.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePID Controller Tuning についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by