![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1810683/image.png)
How could I make a script for this ecuation where i can solve for f?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1810678/image.png)
5 commentaires
Walter Roberson
le 20 Nov 2024
Modifié(e) : Walter Roberson
le 20 Nov 2024
rng(655321)
epsilon = rand
D = rand
Re = rand
eqn = @(x) x + 2*log10(epsilon/D/3.7+2.51*x/Re);
X = fzero(eqn, [0 1e5])
Réponses (1)
Walter Roberson
le 20 Nov 2024
Modifié(e) : Walter Roberson
le 20 Nov 2024
syms f epsilon D Re
Q = @(v) sym(v);
eqn = 1/sqrt(f) == -Q(2.0) * log(epsilon/D/Q(3.7) + Q(2.51)/(Re*sqrt(f)))
F = solve(eqn, f)
disp(char(F))
wrightOmega is a function in the Symbolic Toolbox
rng(655321)
epsilon = rand
D = rand
Re = rand
f = subs(F)
disp(char(vpa(f)))
subs(eqn)
disp(char(vpa(ans)))
0 commentaires
Voir également
Catégories
En savoir plus sur Calculus dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!