Convert a function into a matrix
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Chunru
on 24 Jun 2022
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))
7 Comments
See Also
Categories
Find more on Numbers and Precision in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!