Convert a function into a matrix
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Chunru
le 24 Juin 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 commentaires
Voir également
Catégories
En savoir plus sur Numbers and Precision dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!