how to define the range with variable
조회 수: 3 (최근 30일)
이전 댓글 표시
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
채택된 답변
KSSV
2022년 6월 1일
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)
추가 답변 (1개)
Torsten
2022년 6월 1일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Vector Fields에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
