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!



