منبع : عمران
Fixed point interation method
#include
#include
#include
double F (double x) {return 1.14-(2.0*log((e/d)+(9.55/r*sqrt(x))))-(1/sqrt(x)) ;}
double G (double x) {return (۱٫۲۹۹۶*x*x) +4*x*x*log((e/d)+(9.55/(r*sqrt(x))) *log((e/d)+(9.55/(r*sqrt(x))))- (4.56*x*x*log((e/d)+(9.55/(r*sqrt(x)))) ;}
main()
{ clrscr();
double eps,x0,x,e,d,r;
int n;
cout<<”Enter x0,,eps,e,d,r”<
cin>>x0>>eps>>e>>d>>r;
n=1;
x=G(x0);
while(fabs(x-x0)>=eps)
{x0=x;
x=G(x0);
n++;}
cout<<”Root=”<
cout<<”n=”<
getch();
}
بازگشت به صفحه اصلی وبلاگ مهندسی عمران راه و ساختمان(مهندس حسن فراهانی)
مهندسی عمران راه و ساختمان