Help with root finding methods?
이전 댓글 표시
The sum of two numbers a and b is 21.2. If each number is added to its own square root (i.e. a + √ a), the product of the two sums is 170.73. Using either Newton’s method or the secant method, determine the two numbers using a tolerance of 10−4 Consider x0 = 0 and/or x1 = 1 as starting values. Hint: Set up as a system of two equations and two unknowns and reduce to one equation with one unknown.
I tried using this code but it gave me the same answer each time and one that doesn't fit the formula. Any suggestions? Thanks!
ff1=@(x) ((21.2-x)+sqrt(21.2-x)).*(x+sqrt(x))-170.73;
secantmethod(ff1,0,1,10.^(-4))
ff2=@(x) (x+sqrt(x)).*((21.2-x)+sqrt(21.2-x))-170.73;
secantmethod(ff2,0,1,10.^(-4))
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Linear Algebra에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
