Info

この質問は閉じられています。 編集または回答するには再度開いてください。

This keeps returning that there are no solutions. Is there anyway I can solve an equation equal to an array?

3 ビュー (過去 30 日間)
Melissa Berry
Melissa Berry 2016 年 8 月 8 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
%T1 step value
T1 = linspace(460,580);
%cp values
A = 6.713;
B = .02609e-2;
C = .03540e-5;
D =-.08052e-9;
Cp = A + B*T1 + C*T1.^2 + D*T1.^3;
%calculation for first enthalpy
h1 = 0.2396*T1 - 0.3467;
%calculation for Pr
Pr = .0082391667*T1 - 2.99871667;
%calculation for h2
T2S = 9.9.*21.64.*Pr+680.42;
h2S = .248725.*(T2S)-7.17;
h2a = (h2S-h1+(.865.*h1))./(.865);
%calcalculation for T2
H = h2a - h1;
z = H.*28.978 + (T1.*A+B/2*T1.^2+T1/3*460.^3+D/4*T1.^4);
eqn = T2.*A+B/2*T2.^2+C/3*T2.^3+D/4*T2.^4 == z;
solT2 = solve(eqn,T2)

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 8 月 8 日
You do not show your definition for T2.
You would need to use
T2 = sym('T2', size(T1));
This is because MATLAB treats resolved symbolic variables as being scalars, so if you had used
syms T2
then you would be asking to find a single value that satisfied all of the equations simultaneously, instead of looking for different values corresponding to each T1 element

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by