multiplication to produce a step response in the symbolic code. Now added, with comment. plotting transfer function / time domain version
조회 수: 16 (최근 30일)
이전 댓글 표시
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))
댓글 수: 0
답변 (2개)
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)
syms s t z
snum = poly2sym(Q,s);
sden = poly2sym(P,s);
FTsym = vpa(snum / sden, 5)
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))
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.
multiplication to produce a step response in the symbolic code. Now added, with comment. .
댓글 수: 0
Sam Chak
2023년 4월 17일
Hi @Miller
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)
step(G)
p = pole(G) % two of the poles have positive real parts, thus the system is unstable.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



