[공학기술]trapezodal rule 과Simpsons rule.을 이용한 수치해석 적분
- 최초 등록일
- 2007.06.22
- 최종 저작일
- 2007.01
- 3페이지/ 한컴오피스
- 가격 1,000원
소개글
trapezodal rule 과Simpsons rule.을 이용한 수치해석 적분을 해보자.
이용 프로그램: matla
목차
1. Apply trapezodal rule 4, 8, 16, 32, 64 times.
2. Evalute the numerical error and see the ratios of the errors. How do they vary?
3. Do the same thing as was done in problem 1 with Simpsons rule.
4. How dothe errors ratio vary?
5. Apply Gauss-Quadrature with 4 roots and check the error. Comment on it.
본문내용
Lets try to carry out numerical evaluation of the following integral and compare it with exact solution
1. Apply trapezodal rule 4, 8, 16, 32, 64 times.
sol)
function I=trapezoidal(n)
x0=0;, xn=pi;
h=(xn-x0)/n;
x=x0:h:xn;
f=exp(x).*cos(4*x);
I=h/2.*(f(1)+2*sum(f([2:n]))+f(n+1));
>> format long
>> trapezoidal(4)
ans =
3.24905049448466
>> trapezoidal(8)
ans =
1.*************3
>> trapezoidal(16)
ans =
1.*************9
>> trapezoidal(32)
ans =
1.*************2
>> trapezoidal(64)
ans =
1.30684788549749
참고 자료
수치해석(권순홍)