[수치해석] 수치해석 뉴톤 메소드 newtons's method
- 최초 등록일
- 2004.10.02
- 최종 저작일
- 2004.09
- 11페이지/ 한컴오피스
- 가격 1,000원
소개글
newton's method 를 사용해 함수의 근을 구하는 프로그램입니다. 많은 예제를 통해 프로그램 구현 과정을 쉽게 알 수 있습니다. 수치해석 프로그래밍에 많은 도움이 되길 바랍니다.
컴파일 실행환경
LGIBM XNOTE 노트북
1.3GHz MOBILE CPU
60GByte HDD
512 DDR RAM
목차
1. Source code
2. result
본문내용
/*
I sketched the graph of y=4*x*cos(2*x)-(x-2)^2 and I concluded that
I will start the Newton's method at p = 2,3,6,7
*/
#include<stdio.h>
#include<math.h>
#define TOL 0.00001
double f(double x);
double fp(double x);
double absol(double x);
double newton(double p2);
main()
{
newton(2);
newton(3);
newton(6);
newton(7);
return 0;
}
double f(double x)
{
return 4*x*cos(2*x)-(x-2)*(x-2);
}
double fp(double x)
{
return 4*cos(2*x)-8*x*sin(2*x)-2*x+4;
}
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);
참고 자료
없음