[수치해석] 수치해석 뉴톤 메소드 newtons's method
본 자료는 3페이지 의 미리보기를 제공합니다. 이미지를 클릭하여 주세요.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
해당 자료는 3페이지 까지만 미리보기를 제공합니다.
3페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

[수치해석] 수치해석 뉴톤 메소드 newtons's method에 대한 보고서 자료입니다.

목차

1. Source code
2. result

본문내용

%f\n",p2);
while(absol(p2-p1)>=TOL)
{
p1 = p2;
p2 = p1 - f(p1)/fp(p1);
n++;
printf("n= %d Pn= %f f(Pn)= %f \n",n,p2,f(p2));
}
printf("Solution is %f\n\n",p2);
return 0;
}
(2)Result
HW#7
2.4-9
(1) Source code
/*
I sketched the graph of f(x)=x^2 -3 and I concluded that
I will start the Newton's method at p=2
for the value of x with x= sqrt(3)
*/
#include
#include
#define TOL 0.0001
double f(double x);
double fp(double x);
double absol(double x);
double newton(double p2);
main()
{
newton(2);
return 0;
}
double f(double x)
{
return x*x - 3;
}
double fp(double x)
{
return 2*x;
}
double absol(double x)
{
if(x>=0)return x;
else return (-1) * x;
}
double newton(double p2)
{
int n;
double p1;
p1 = -1;
n = 0;
printf("Now we are doing Newton's method at %f\n",p2);
while(absol(p2-p1)>=TOL)
{
p1 = p2;
p2 = p1 - f(p1)/fp(p1);
n++;
printf("n= %d Pn= %f f(Pn)= %f \n",n,p2,f(p2));
}
printf("Solution is %f\n\n",p2);
return 0;
}
(2)Result
(3)Compare to 2.2-9 and 2.3-9
( Bisection method )
( Secant method )
I used the Bisection method for excercise 2.2-9, and
I used the Secant method for excercise 2.3-9.
I used the Newton's method for excercise 2.3-9.
The number of iteration was different one another.
- n -
Bisection method : 14 times
Secant method : 5 times
Newton's method : 3 times
Therefore, Newton's method is more efficient than any other methods.
HW#8
2.5-2
a.
(1) Source code
/*
I will start the Newton's method in [0,1]
for the value of x with x^2-2*x*e^(-x)+e^(-2*x)=0
using Aitken's delta^2 method.
Iterate until |qn - qn-1|<10^(-4)
*/
#include
#include
#define TOL 0.0001
double f(double x);
double fp(double x);
double absol(double x);
main()
{
int n;
double p0,p1,p2,q1,q2;
p0 = p1 = p2 = q1 = 0;
q2 = 1;
n = 0;
while(absol(q2-q1)>=TOL)
{
q1 = q2;
p0 = p1;
p1 = p2;
p2 = p1 - f(p1)/fp(p1);
q2 = p0 - (p1 - p0)*(p1 - p0)/(p2 - 2*p1 + p0);
n++;
printf("n= %d Pn= %f qn = %f \n",n,p2,q2);
}
printf("Solution is %f\n\n",q2);
return 0;
}
double f(double x)
{
return x*x-2*x*exp(-x)+exp(-2*x);
}
double fp(double x)
{
return 2*x+(2*x-2)*exp(-1*x)-2*exp(-2*x);
}
double absol(double x)
{
if(x>=0)return x;
else return (-1) * x;
}
(2)Result
b.
(1) Source code
/*
I will start the Newton's method in [-2,-1]
for the value of x with cos(x+2^(1/2))+x*(1/2*x+2^(1/2))=0
using Aitken's delta^2 method.
Iterate until |qn - qn-1|<10^(-4)
*/
#include
#include
#define TOL 0.0001
double f(double x);
double fp(double x);
double absol(double x);
main()
{
int n;
double p0,p1,p2,q1,q2;
p0 = p1 = p2 = q1 = -1;
q2 = -2;
n = 0;
while(absol(q2-q1)>=TOL)
{
q1 = q2;
p0 = p1;
p1 = p2;
p2 = p1 - f(p1)/fp(p1);
q2 = p0 - (p1 - p0)*(p1 - p0)/(p2 - 2*p1 + p0);
n++;
printf("n= %d Pn= %f qn = %f \n",n,p2,q2);
}
printf("Solution is %f\n\n",q2);
return 0;
}
double f(double x)
{
return cos(x+sqrt(2))+x*(x/2+sqrt(2));
}
double fp(double x)
{
return x+sqrt(2)-sin(x+sqrt(2));
}
double absol(double x)
{
if(x>=0)return x;
else return (-1) * x;
}
(2)Result

키워드

수치해석,   뉴톤,   newton,   newon's,   method,   newtons,   뉴턴,   뉴턴법
  • 가격800
  • 페이지수10페이지
  • 등록일2006.06.01
  • 저작시기2005.5
  • 파일형식한글(hwp)
  • 자료번호#352499
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니