Code for equation with ln

조회 수: 1 (최근 30일)
Sayeed
Sayeed 2018년 10월 21일
댓글: Star Strider 2018년 10월 21일

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’.

답변 (1개)

Star Strider
Star Strider 2018년 10월 21일
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
Sayeed
Sayeed 2018년 10월 21일
It is somehow not working to my matlab. Can you please send me the code file with attachment?
Star Strider
Star Strider 2018년 10월 21일
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

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Newton-Raphson Method에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by