Implicit Functions and Iterative Processes in Hydraulics
이전 댓글 표시
In hydraulics you can use the Colebrook Equation to find friction factor. This is an implicit function.
How does MATLAB handle implicit functions? This method is used in an iterative approach. How would I start picking this equation apart to write a code for an implicit function?
Thank you
답변 (2개)
Andrew Newell
2011년 12월 29일
MATLAB handles implicit functions by changing f(x)=g(x) into f(x)-g(x)=0 and solving for x. Here is an example inspired by your link:
A = 0.1; B = 1;
fcn = @(x) 1./x+2.*log10(A + B./x);
xp = 1:.1:10; yp = fcn(xp); plot(xp,yp)
sqrtf = fzero(fcn,2);
f = sqrtf^2;
disp(['f = ',num2str(f)])
I have used an anonymous function, but you can also define functions in a variety of other ways (see Types of functions).
Sean de Wolski
2011년 12월 29일
0 개 추천
Some recommended reading:
Number 32 (33 in the actual HTML)
카테고리
도움말 센터 및 File Exchange에서 Fluid Dynamics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!