bisection, false position
본 자료는 3페이지 의 미리보기를 제공합니다. 이미지를 클릭하여 주세요.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
해당 자료는 3페이지 까지만 미리보기를 제공합니다.
3페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

bisection, false position에 대한 보고서 자료입니다.

목차

1. bisection
2. false position

본문내용

(f(xl) * f(xr) < 0)
xu = xr;
else
xl = xr;
cout << "Iteration number = " << iter << "\n";
cout << "critical depth h= " << xr << "\n";
cout << "F(h) = " << f(xr) << " [tolerance] = " << ea << "\n" << "\n";
}
return;
}
double A(double xr)
{
return 3 * xr + (xr * xr) / 2 ;
}
double B(double xr)
{
return 3 + xr ;
}
double f(double xr)
{
double a, b, y;
a = A(xr);
b = B(xr);
y = 1 - ((20*20* b) / (g * a * a * a )) ;
return y;
}
◆ Problem 5.16
◆ Graph Analysis
A spherical tank holds water. The volume of liquid it can hold can be computed as where V = volume, h = depth, and R = the tank radius. If R = 30 m, to what depth h must the tank be filled so that it holds 30 m3 ? ( R = 3 m )
◎ Results ◎
1. Bisection Methods
2. False-Position Methods
◎ Comments ◎
그래프를 통해 분석해 보면 근의 위치는 1과 1.5 사이에 위치한다. 8에서 9사이에도 근이 존재하지만 R = 3 m 이므로 depth h가 6이상이 될 수는 없다. Bisection Method가 1% 미만으로 들어올 때 까지를 비교해보면 False-Position Method 방법이 월등히 빠르고 정확하게 근에 접근함을 알 수 있다. 결과 값에서 보는 것처럼 Bisection Method는 6번째 오차가 약 0.57% 이지만, False-Position Method의 경우 단 두 번의 연산에서 오차가 1% 미만으로 줄어들고, 그 이후 연산에서도 급격히 줄어들어 거의 정확한 근을 구할 수 있음을 보여준다. 그래프에서 볼 수 있듯이 근이 특별히 initial guess의 어느 한쪽에 치우침이 없어 이러한 경우 False-Position Method가 적절한 알고리즘임을 알 수 있었다.
세 개의 문제를 통해 Bisection Method와 False-Position Method의 장단점을 파악할 수 있다. 그래프를 분석해보고 근이 initial guess의 어느 한쪽으로 치우침이 없다면 False-Position Method이 더 나은 방법이 될 것이고 만약 근이 initial guess 어느 한쪽으로 치우침이 있을 경우에는 Bisection Method를 사용하는 것이 시간을 절약하는데 적절한 방법이 될 것이다.
◆ Programing Source
1. Bisection Method
/*Problem 5.16 by Bisection Method
V=pi*h^2*[3R-h]/3*2
when spherical tank holds 30 m^3, what depth must the tank?
R=3
*/
#include
#include
#define pi 3.14159
double f(double);
void main()
{
double xl, xu, xr, xold, ea ;
int iter=0;
cout << "Problem 5.16 by Bisection Method" << "\n";
xl=1;
xu=1.5;//initial guess
xold = 0;
while (iter <= 6)
{
iter++;
xr = (xl + xu) / 2;
ea = fabs((xr - xold) / xr) * 100;
xold = xr;
if (f(xl) * f(xr) < 0)
xu = xr;
else
xl = xr;
cout << "Iteration number = " << iter << "\n";
cout << "depth h = " << xr << "\n";
cout << "F(h) = " << f(xr) << " [tolerance] = " << ea << "\n" << "\n";
}
return;
}
double f(double xr)
{
double V = pi * xr * xr * (9 - xr) / 3 * 2 - 30;
return V;
}
2. False-Position Method
/*Problem 5.16 False-Position Method
V=pi*h^2*[3R-h]/3*2
when spherical tank holds 30 m^3, what depth must the tank?
R=3
*/
#include
#include
#define pi 3.14159
void main()
{
double xl, xu, xr, xold, ea;
int iter=0;
cout << "Problem 5.16 by False-Position Method" << "\n";
xl=1;
xu=1.5;//initial guess
xold = 0;
while (iter <= 7)
{
iter++;
xr = xu - f(xu) * (xl - xu) / (f(xl) - f(xu));
ea = fabs((xr - xold) / xr * 100);
xold = xr;
if (f(xl) * f(xr) < 0)
xu = xr;
else
xl = xr;
cout << "Iteration number = " << iter << "\n";
cout << "depth h = " << xr << "\n";
cout << "F(h) = " << f(xr) << " [tolerance] = " << ea << "\n" << "\n";
}
return;
}
double f(double xr)
{
double V = pi * xr * xr * (9 - xr) / 3 * 2 - 30;
return V;
}

키워드

  • 가격1,000
  • 페이지수10페이지
  • 등록일2008.06.25
  • 저작시기2008.3
  • 파일형식한글(hwp)
  • 자료번호#471637
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니