Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

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

3 vues (au cours des 30 derniers jours)
Melissa Berry
Melissa Berry le 8 Août 2016
Clôturé : MATLAB Answer Bot le 20 Août 2021
%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)

Réponses (1)

Walter Roberson
Walter Roberson le 8 Août 2016
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

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by