How to get the value of an extra variable with fsolve
Afficher commentaires plus anciens
As an example, we have the following approach to find f:
%% Known data
D=0.1;%m
V=10;%m/s
nu=8.94e-7;%m^2/s
epsilon=4.6e-5;%m
%% Calculation of f
f_est=0.02;
f=fsolve(@f_Col,f_est,[],V,nu,D,epsilon);
%% Functions
function [F]=f_Col(f_est,V,nu,D,epsilon)
% function that calculates the friction factor with the Colebrook equation
% for a specific V, D and epsilon
Re=D.*V/nu;
rr=epsilon/D;
F=1./sqrt(f_est)+2*log10(rr/3.7+2.51./(Re.*sqrt(f_est)));
F=F';
end
Is there a way to receive the rr and Re values when using the fsolve? In this case these two values do not depend on the value of f that solves the equation, but just as an example, is there a way to do it?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur ActiveX 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!