Why is my iteration not working. ? ( the solution array has all the same value from first iteration )
Afficher commentaires plus anciens
%function F = Gaddis(x)
for (i = 1:40)
vol(1) = 5*10^(-6); % volumetric gas flow rate
sig = 0.0728;
do = 6*(10^(-3));
den = 998;
g = 9.81;
mu = 8.9*10^(-4);
s = (6*do*sig/(den*g));
L = (81*mu*vol(i)/(pi*g*den));
T = (135*(vol(i)^2)/(4*(pi^2)*g));
F = (x^3) - s - (L/x) - (T/(x^2));
vol(i+1) = vol(i) + 10^(-6);
end
end
I used fsolve solver to solve this function . '
As my volume changes , i am supposed to get new values of diametre , but it shows the same value for all the 40 iterations.
command code xsol(i) = fsolve(@(x) Gaddis(x), 0.0001);
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Systems of Nonlinear Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!