plotting transfer function / time domain version

조회 수: 16 (최근 30일)
Miller
Miller 2023년 4월 17일
답변: Sam Chak 2023년 4월 17일
Hi guys,
I am trying to plot a Laplace domain function I have, however when I use fplot or step() the graph shows nothing at all. How do I fix this?
Code Below:
clear
clc
P = [8.925*10^-20 11.925*10^-15 17.995*10^-10 6.625 10^5];
poles = roots(P);
poles = poles';
Q = [2.25*10^-20 5.25*10^-15 1.5*10^-5 3*10^-5];
zeros = roots(Q);
zeros = zeros';
FT = tf(zeros,poles);
syms s t z
snum = poly2sym(zeros,s);
sden = poly2sym(poles,s);
step(FT);
FT_time_domain = ilaplace(snum/sden);
FT_time_domain = simplify(FT_time_domain,'Steps',10);
FT_time_domain = collect(FT_time_domain, exp(-t))

답변 (2개)

Star Strider
Star Strider 2023년 4월 17일
편집: Star Strider 2023년 4월 17일
I’m assuming here that ‘Q’ is the numerator polynomial and ‘P’ is the denominator poplynomial. (If that is not correct, it is easy to switch them.)
Try something like this —
P = [8.925*10^-20 11.925*10^-15 17.995*10^-10 6.625 10^5];
poles = roots(P);
poles = poles';
Q = [2.25*10^-20 5.25*10^-15 1.5*10^-5 3*10^-5];
zeros = roots(Q);
zeros = zeros';
FT = tf(Q,P)
FT = 2.25e-20 s^3 + 5.25e-15 s^2 + 1.5e-05 s + 3e-05 -------------------------------------------------------------- 8.925e-20 s^4 + 1.193e-14 s^3 + 1.8e-09 s^2 + 6.625 s + 100000 Continuous-time transfer function.
syms s t z
snum = poly2sym(Q,s);
sden = poly2sym(P,s);
FTsym = vpa(snum / sden, 5)
FTsym = 
step(FT);
FT_time_domain = ilaplace(snum/(sden*s)); % Step Response Requires: snum/sden*(1/s)
FT_time_domain = simplify(FT_time_domain,'Steps',10);
FT_time_domain = collect(FT_time_domain, exp(-t))
FT_time_domain = 
figure
fplot(FT_time_domain, [0 1.5E-5])
xlabel('Time (s)')
ylabel('Amplitude (units)')
The system appears to be unstable.
EDIT — (17 Apr 2023 at 13:02)
Initially forgot the multiplication to produce a step response in the symbolic code. Now added, with comment.
.

Sam Chak
Sam Chak 2023년 4월 17일
If you want to use the step(sys) function, then the sys must be a SISO or MIMO Linear System Model.
In your case, it can descibed by a transfer function model in the s-domain.
Q = [2.250e-20 5.250e-15 1.500e-5 3e-5];
P = [8.925e-20 11.925e-15 17.995e-10 6.625 10^5];
G = tf(Q, P)
G = 2.25e-20 s^3 + 5.25e-15 s^2 + 1.5e-05 s + 3e-05 -------------------------------------------------------------- 8.925e-20 s^4 + 1.193e-14 s^3 + 1.8e-09 s^2 + 6.625 s + 100000 Continuous-time transfer function.
step(G)
p = pole(G) % two of the poles have positive real parts, thus the system is unstable.
p =
1.0e+06 * -4.2411 + 0.0000i 2.0613 + 3.6406i 2.0613 - 3.6406i -0.0151 + 0.0000i

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by