Effacer les filtres
Effacer les filtres

I have this problem Exiting fzero: aborting search for an interval containing a sign change because no sign change is detected during search. Function may not have a root.

6 vues (au cours des 30 derniers jours)
V3=fzero(@Pr3,0.7);
V3
function y=Pr3(V)
Pr=4;
R=0.08206;
T=450;
Tc=405.5;
Pc=111.3;
P=Pr*Pc;
a=0.42747*((R^2)*Tc^(5/2)/Pc);
b=0.08664*(R*Tc/Pc);
y=((R*T)/(V-b))-(a/(V*(V+b)*T^(1/2)))-P;
end

Réponses (1)

Walter Roberson
Walter Roberson le 26 Fév 2024
syms V
Q = @(v) sym(v);
Pr = Q(4);
R = Q(08206) / Q(10)^5;
T = Q(450);
Tc = Q(405.5);
Pc = Q(1113) / Q(10)^1;
P = Pr*Pc;
a = Q(42747) / Q(10)^5 * ((R^2)*Tc^(5/2)/Pc);
b = Q(08664) / Q(10)^5 * (R*Tc/Pc);
y = ((R*T)/(V-b))-(a/(V*(V+b)*T^(1/2)))-P;
y
y = 
sol = solve(y, 'maxdegree', 3)
sol = 
vpa(sol)
ans = 
  1 commentaire
Walter Roberson
Walter Roberson le 26 Fév 2024
format long g
V3=fzero(@Pr3,0.05);
V3
V3 =
0.050876353674731
function y=Pr3(V)
Pr=4;
R=0.08206;
T=450;
Tc=405.5;
Pc=111.3;
P=Pr*Pc;
a=0.42747*((R^2)*Tc^(5/2)/Pc);
b=0.08664*(R*Tc/Pc);
y=((R*T)/(V-b))-(a/(V*(V+b)*T^(1/2)))-P;
end

Connectez-vous pour commenter.

Catégories

En savoir plus sur Function Creation dans Help Center et File Exchange

Produits


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by