Solve for two equation with two unknown variables
Afficher commentaires plus anciens
clc
clear
a=436*10^-6;
rho=2.2*10^-5;
k=2.6;
Z=a^2/(rho*k);
Tcevre=-5+273;
ZTcevre=Z*Tcevre;
Ts=408.15;
Tsy=Ts/Tcevre;
h1=106.6575;
A1=0.04*0.04;
h2=53.3320;
A2=37*10^-4;
Nh=(h1*A1)/(0.9*h2*A2);
syms x y
for Nk=0.1:0.1:1
for Rr=1:0.1:2
Eq1= Nh*(Tsy-x)==(((ZTcevre*(x-y)*x)/(Rr+1))-((ZTcevre*(x-y)^2)/(2*(Rr+1)^2))+(x-y));
Eq2=(y-1)/Nk ==(((ZTcevre*(x-y)*y)/(Rr+1))-((ZTcevre*(x-y)^2)/(2*(Rr+1)^2))+(x-y));
[X,Y]=solve(Eq1,Eq2,x,y)
pretty(X)
% eqns = [Eq1,Eq2];
% S=solve(eqns, [x y]);
% S.x
% S.y
end
end
I have 4 unknowns and I'm converting two equations with two for loop to two. Then I used [X, Y] = solve (Eq1, Eq2, x, y) to solve these two, but when I wanted to find a numeric value, the terms root and Z ^ 3 came up. What command can I use or provide a code to be a numeric value? Could you help?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Code Performance dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!