how to define the range with variable
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
h_H2 = 0;
h_O2 = 0;
h_H2O = -241827;
s_H2 = 130.59;
s_O2 = 205.14;
s_H2O = 188.83;
T_ref = 298;
T = 293:1173;
n = 2;
F = 96487;
S = -163.25;
delH = (h_H2O + (143.05-58.04*(T.^0.25)+8.2751*(T.^0.5)-0.036989*T)*(T-T_ref)) - (1/2)*(h_H2 + (56.505-22222.6*(T.^(-0.75))+116500*(T.^(-1))-560700*(T.^(-1.5)))*(T-T_ref)) - (1/2)*(h_O2+(37.432+2.0102*(10.^(-5))*(T.^1.5)-178570*(T.^(-1.5))+2368800*(T.^(-2)))*(T-T_ref));
plot(T,delH)
it works if I use a value for T, but if I want to use the range of the T, it gives me error.
0 commentaires
Réponse acceptée
KSSV
le 1 Juin 2022
You need to use elelement by element (.*) multiplication as well .
h_H2 = 0;
h_O2 = 0;
h_H2O = -241827;
s_H2 = 130.59;
s_O2 = 205.14;
s_H2O = 188.83;
T_ref = 298;
T = 293:1173;
n = 2;
F = 96487;
S = -163.25;
delH = (h_H2O + (143.05-58.04*(T.^0.25)+8.2751*(T.^0.5)-0.036989*T).*(T-T_ref)) .....
- (1/2)*(h_H2 + (56.505-22222.6*(T.^(-0.75))+116500*(T.^(-1))-560700.*(T.^(-1.5))).*(T-T_ref)) .....
- (1/2)*(h_O2+(37.432+2.0102*(10.^(-5)).*(T.^1.5)-178570.*(T.^(-1.5))+2368800.*(T.^(-2))).*(T-T_ref));
plot(T,delH)
Plus de réponses (1)
Torsten
le 1 Juin 2022
h_H2 = 0;
h_O2 = 0;
h_H2O = -241827;
s_H2 = 130.59;
s_O2 = 205.14;
s_H2O = 188.83;
T_ref = 298;
T = 293:1173;
n = 2;
F = 96487;
S = -163.25;
delH = (h_H2O + (143.05-58.04*(T.^0.25)+8.2751*(T.^0.5)-0.036989*T).*(T-T_ref)) - (1/2)*(h_H2 + (56.505-22222.6*(T.^(-0.75))+116500*(T.^(-1))-560700*(T.^(-1.5))).*(T-T_ref)) - (1/2)*(h_O2+(37.432+2.0102*(10.^(-5))*(T.^1.5)-178570*(T.^(-1.5))+2368800*(T.^(-2))).*(T-T_ref));
plot(T,delH)
0 commentaires
Voir également
Catégories
En savoir plus sur Vector Fields 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!
