離散時間伝達関数の作成

9 views (last 30 days)
貴弘
貴弘 on 21 Mar 2024
Commented: 貴弘 on 5 Apr 2024 at 7:26
1/(1-z^-1)のような離散時間伝達関数を作成する際に,下記のようなコマンドで作成すると,分子の1番目に0が入ってしまいます。
D = tf(1,[1 -1],Ts)
D.num=[0 1]
D.den=[1 -1]
Ts = 0.01(サンプリング時間)
これを回避することはできないのでしょうか?

Answers (1)

Atsushi Ueno
Atsushi Ueno on 21 Mar 2024
仕様なので仕方ないです。欲しいのは配列の最終要素なので end 要素を指定すれば良いですね。
D = tf(1,[1,2,3,4,5],-1);
D.num
ans = 1×1 cell array
{[0 0 0 0 1]}
D.num{1}(end)
ans = 1
  4 Comments
Atsushi Ueno
Atsushi Ueno on 22 Mar 2024
上記は Simulink の Transfer Fcn ブロックの説明からの抜粋です。離散ではありませんが、s(z)のn 乗項の係数が順に並ぶ意味では同じで、少ない方をゼロで埋めて分子と分母の数を合わせる仕様になっています。
>伝達関数を作成した後に,分子や分母の要素(cell配列)を書き換える方法はないのでしょうか?
⇒書き換える事は出来ますが、分子と分母の数が一致する様にゼロ埋めされる仕様は変わりません
D = tf([7,0,9],[1,2,3,4,5,6],-1);
D.den % 分母
ans = 1x1 cell array
{[1 2 3 4 5 6]}
D.num % 分子
ans = 1x1 cell array
{[0 0 0 7 0 9]}
D.num{1}(end-1) = 8; % 分子の要素を書き換える
D.num % 値は変わるけど位置関係は変わらない
ans = 1x1 cell array
{[0 0 0 7 8 9]}
D.num = {[10 11 12]}; % 分子全体を書き換える
D.num % 値は変わるけど分母との位置関係は変わらない
ans = 1x1 cell array
{[0 0 0 10 11 12]}
D.den = {[1 2]}; % 分母全体を書き換える
D.den % 今度は分母の頭にゼロがついた
ans = 1x1 cell array
{[0 1 2]}
D.num % 分子の数の方が多いので頭のゼロがなくなった
ans = 1x1 cell array
{[10 11 12]}
貴弘
貴弘 on 5 Apr 2024 at 7:26
ありがとうございます。現状考えているのは分母の方が次数が多くなる場合を考えているので,分母と分子の次数の差の数の0を分子の行列の後ろに加えることで,実現したい伝達関数を構成できそうなことがわかりました。

Sign in to comment.

Categories

Find more on 動的システム モデル in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!