Code for equation with ln
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
How can i Code it?
u=0.23 y=0.3 v=0.00001
u/u’=5*log(u’*y/v)-3.05
u’=?
I need to find the value of u’.
![](/matlabcentral/answers/uploaded_files/137360/NP.png)
0 Commenti
Risposte (1)
Star Strider
il 21 Ott 2018
Try this:
u=0.23;
y=0.3;
v=0.00001;
fcn = @(ustar,u,y,nu) 5*log(ustar.*y/nu)- 3.05 - u/ustar;
ustar = fsolve(@(ustar)fcn(ustar,u,y,v), 1)
ustar =
0.00918407730971717
2 Commenti
Star Strider
il 21 Ott 2018
I already posted all the code that is needed to solve this problem.
You need to have the Optimization Toolbox installed to use fsolve.
You will have fminsearch regardless, so try using fminsearch on the norm of ‘fcn’:
ustar = fminsearch(@(ustar)norm(fcn(ustar,u,y,v)), 1)
ustar =
0.00918426513671787
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!