用牛顿切线法求方程f(x)=2x+sinx-4.18=0在区间[0,5]上的近似实根r,迭代初值自选,精确到0.0001
来源:学生作业帮 编辑:灵鹊做题网作业帮 分类:数学作业 时间:2024/05/01 15:51:13
用牛顿切线法求方程f(x)=2x+sinx-4.18=0在区间[0,5]上的近似实根r,迭代初值自选,精确到0.0001.
C++
C++
#include
#include
void main()
{
void function1();//搜索法
void function2();//二分法
void function4();//牛顿法
int choice;
printf("请选择求解的方法:\n\t1.搜索法\n\t2.二分法\n\t3.牛顿法\n:");
switch(1)
{
case 1:function1();
case 2:function2();
case 4:function4();
}
}
void function1()//搜索法计算非线性方程的解
{
double expression1(double);
double lpoint=1.0,rpoint=2.0,step=0.0001;
while(expression1(lpoint)0.00001)
{
mpoint=(lpoint+rpoint)/2;
if(expression1(lpoint)*expression1(mpoint)0.00001)
{
x=x-expression1(x)/expression2(x);
}
printf("运用牛顿法所求结果:%f\n",x);
}
double expression1(double x)
{
double result;
result=x*x*x-x*x-1;
return result;
}
double expression2(double x)
{
double result;
result=3*x*x-2*x;
return result;
}
#include
void main()
{
void function1();//搜索法
void function2();//二分法
void function4();//牛顿法
int choice;
printf("请选择求解的方法:\n\t1.搜索法\n\t2.二分法\n\t3.牛顿法\n:");
switch(1)
{
case 1:function1();
case 2:function2();
case 4:function4();
}
}
void function1()//搜索法计算非线性方程的解
{
double expression1(double);
double lpoint=1.0,rpoint=2.0,step=0.0001;
while(expression1(lpoint)0.00001)
{
mpoint=(lpoint+rpoint)/2;
if(expression1(lpoint)*expression1(mpoint)0.00001)
{
x=x-expression1(x)/expression2(x);
}
printf("运用牛顿法所求结果:%f\n",x);
}
double expression1(double x)
{
double result;
result=x*x*x-x*x-1;
return result;
}
double expression2(double x)
{
double result;
result=3*x*x-2*x;
return result;
}
用牛顿切线法求方程f(x)=2x+sinx-4.18=0在区间[0,5]上的近似实根r,迭代初值自选,精确到0.0001
用VB牛顿切线编写程序,用牛顿切线法求方程f(x)=x+lnx-1.7=0的近似实根r迭代初值自选,精确带0.0001.
编写程序,用牛顿切线法求方程f(x)= x+lnx-1.7=0的近似实根r,迭代初值自选,精确到0.0001.〔提示:计
编写程序,用牛顿切线法求方程f(x)=x^3+2x+10=0的近似实根r,迭代初值为-1,精确到0.0001.
用普通迭代法求方程f(x)=x+lnx-1.56=0的近似实根r(其中ln为自然对数),迭代初值为2,精确到0.0001
VB编写程序,用牛顿切线法求方程f(x)= x^2-x-8=0(其中^表示 幂运算)在区间[3,4]上的近似实根r,迭代
用vb编写程序,用普通迭代法求方程f(x)=x+lgx-2.5=0的近似实根r,迭代初值为1.5,精确到0.0001
编写程序,用普通迭代法求方程f(x)=x+lnx-1.56=0的近似实根r(其中ln为自然对数),迭代初值为2,精确到0
编写程序,用普通迭代法求方程f(x)=x+lnx-1.7=0的近似实根r,迭代初值为1.5,精确到0.0001.〔提示:
编写程序,用牛顿切线法求方程f(x)= x^2-x-8=0(其中^表示 幂运算)在区间[3,4]上的近似实根r,迭代初
1 20 编写程序,用普通迭代法求方程f(x)=x+lgx-3.18=0的近似实根r,迭代初值为2.5,要求结果保留4位
用牛顿迭代法求方程f(x)=x^6-x-1=0在区间【1,2】内的实根,要求|f(x(k))|