Convert a function into a matrix
2 次查看(过去 30 天)
显示 更早的评论
I want (h(t)) to be in form of matrix, how to do it?
Parameters= {'R0','R1','C1','Qr','bo','b1','SOC','Vrc','Voc'};
R0=0.000605797;
Qr=147964.8608;
R1=0.000856205;
C1=0.049823238;
% X=[SOC;Vrc];
A=[0 0;0 -1/R1*C1];
B=[1/Qr;1/C1];
C=[1 1];
D= R0;
% u=Il;
sys= ss(A,B,C,D);
tfsys = tf(sys);
n = tfsys.Numerator;
d = tfsys.Denominator;
syms s t
H(s) = poly2sym(n,s) / poly2sym(d,s)
H = vpa(H, 5);
h(t) = ilaplace(H)
h = vpa(h, 5)
figure
fplot(h)
grid
axis([0 0.1 0 20])
0 个评论
回答(1 个)
Chunru
2022-6-24
Parameters= {'R0','R1','C1','Qr','bo','b1','SOC','Vrc','Voc'};
R0=0.000605797;
Qr=147964.8608;
R1=0.000856205;
C1=0.049823238;
% X=[SOC;Vrc];
A=[0 0;0 -1/R1*C1];
B=[1/Qr;1/C1];
C=[1 1];
D= R0;
% u=Il;
sys= ss(A,B,C,D);
tfsys = tf(sys);
n = tfsys.Numerator;
d = tfsys.Denominator;
syms s t
H(s) = poly2sym(n,s) / poly2sym(d,s)
H = vpa(H, 5);
h(t) = ilaplace(H)
% h = vpa(h, 5)
figure
fplot(h)
grid
axis([0 0.1 0 20])
t1=linspace(0, 0.1, 21)
h1 = double(h(t1))
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Numbers and Precision 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!