Substitute s for jw in a transfer function

250 ビュー (過去 30 日間)
Inés Bodoque
Inés Bodoque 2021 年 1 月 11 日
コメント済み: Inés Bodoque 2021 年 1 月 11 日
Hi, I have a transfer function define by
G = ([1 2],[3 4 5]) (as an example)
I want to change the 's' for 'jw'. Does anyone know how to do it?
I've tried subs(G,{s},{1j*omega}) but it didn't work.

採用された回答

Jon
Jon 2021 年 1 月 11 日
Hi,
I think you mean that you define your transfer function using (you forgot the tf() in your example)
G = tf([1 2],[3 4 5]) %(as an example))
Then if you want to evaluate it at a particular frequency, that is a specific value of jw, you can use
w = 3; % for example 3 radians/sec
val = evalfr(G,j*w)
You can also use the freqresp function to evaluate it for multiple values along the jw axis
  2 件のコメント
Jon
Jon 2021 年 1 月 11 日
If as Pat suggest you don't have the Control System Toolbox, you can do this a little more neatly using
num = [1,2]
den = [3,4,5]
w = 3; % for example 3 rad/s
val = polyval(num,j*w)/polyval(den,j*w)
You can also use i*w MATLAB defines by default i and j as sqrt(-1)
Inés Bodoque
Inés Bodoque 2021 年 1 月 11 日
It worked! Thank you very much

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

その他の回答 (1 件)

Pat Gipper
Pat Gipper 2021 年 1 月 11 日
Matlab uses the reserved constant "i" which is set equal to sqrt(-1). Using your transfer function as defined try the following which will result in the variable "G" which will be a complex number.
num=1*i*w+2;den=3*(i*w)^2+4*i*w+5;G=num/den;
  2 件のコメント
Pat Gipper
Pat Gipper 2021 年 1 月 11 日
編集済み: Pat Gipper 2021 年 1 月 11 日
Based on some of your other questions it looks like you don't have access to the Control Systems Toolbox. So you need to do this arithmetic explicitly.
Inés Bodoque
Inés Bodoque 2021 年 1 月 11 日
Thank you for your answer! I need this for a project from one of my subjects and I am not allowed to use the Control Systems Toolbox, that's why I have to do it this way

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

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by