求方程f(x)=x3-sinx-12x+1的全部实根,ε=10-6.
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/11/08 17:35:04
求方程f(x)=x3-sinx-12x+1的全部实根,ε=10-6.
用MATLAB编程,
用MATLAB编程,
用导数知识分析其有根区间为:(-4,-2),(-2,2),(2,6).(分析略,可参看下图)在matlab中保存为:bisection.mfunction rtn=bisection(fx,xa,xb,n,delta)% 二分法解方程% fx是由方程转化的关于x的函数,有fx=0.% xa 解区间上限% xb 解区间下限%解区间人为判断输入% n 最多循环步数,防止死循环.%delta 为允许误差x=xa;fa=eval(fx);x=xb;fb=eval(fx); disp(' [ n xa xb xc fc ]');for i=1:n xc=(xa+xb)/2;x=xc;fc=eval(fx); X=[i,xa,xb,xc,fc]; disp(X), if fc*fa<0 xb=xc; else xa=xc; end if (xb-xa)<delta,break,endend一、在区间(-4,-2)上的>> y='x.^3-sin(x)-12*x+1';>> bisection(y,-4,-2,1000,10^-6) [ n xa xb xc fc ] 1.00000000000000 -4.00000000000000 -2.00000000000000 -3.00000000000000 10.14112000805987 2.00000000000000 -4.00000000000000 -3.00000000000000 -3.50000000000000 -0.22578322768962 3.00000000000000 -3.50000000000000 -3.00000000000000 -3.25000000000000 5.56367986546989 4.00000000000000 -3.50000000000000 -3.25000000000000 -3.37500000000000 2.82534681259798 5.00000000000000 -3.50000000000000 -3.37500000000000 -3.43750000000000 1.33949563431115 6.00000000000000 -3.50000000000000 -3.43750000000000 -3.46875000000000 0.56686165921837 7.00000000000000 -3.50000000000000 -3.46875000000000 -3.48437500000000 0.17305022015525 8.00000000000000 -3.50000000000000 -3.48437500000000 -3.49218750000000 -0.02573754654618 9.00000000000000 -3.49218750000000 -3.48437500000000 -3.48828125000000 0.07381342529514 10.00000000000000 -3.49218750000000 -3.48828125000000 -3.49023437500000 0.02407723034585 11.00000000000000 -3.49218750000000 -3.49023437500000 -3.49121093750000 -0.00082033300097 12.00000000000000 -3.49121093750000 -3.49023437500000 -3.49072265625000 0.01163090465268 13.00000000000000 -3.49121093750000 -3.49072265625000 -3.49096679687500 0.00540589985774 14.00000000000000 -3.49121093750000 -3.49096679687500 -3.49108886718750 0.00229293694096 15.00000000000000 -3.49121093750000 -3.49108886718750 -3.49114990234375 0.00073634034872 16.00000000000000 -3.49121093750000 -3.49114990234375 -3.49118041992188 -0.00004198673138 17.00000000000000 -3.49118041992188 -3.49114990234375 -3.49116516113281 0.00034717920735 18.00000000000000 -3.49118041992188 -3.49116516113281 -3.49117279052734 0.00015259683766 19.00000000000000 -3.49118041992188 -3.49117279052734 -3.49117660522461 0.00005530520306 20.00000000000000 -3.49118041992188 -3.49117660522461 -3.49117851257324 0.00000665927332 21.00000000000000 -3.49118041992188 -3.49117851257324 -3.49117946624756 -0.00001766371965由结果可知:x1=-3.49117946624756 ;二、在区间(-2,2)上的>> bisection(y,-2,2,1000,10^-6) [ n xa xb xc fc ] 1 -2 2 0 1 2.00000000000000 0 2.00000000000000 1.00000000000000 -10.84147098480790 3.00000000000000 0 1.00000000000000 0.50000000000000 -5.35442553860420 4.00000000000000 0 0.50000000000000 0.25000000000000 -2.23177895925452 5.00000000000000 0 0.25000000000000 0.12500000000000 -0.62272160838523 6.00000000000000 0 0.12500000000000 0.06250000000000 0.18778482278262 7.00000000000000 0.06250000000000 0.12500000000000 0.09375000000000 -0.21778875662614 8.00000000000000 0.06250000000000 0.09375000000000 0.07812500000000 -0.01506871423176 9.00000000000000 0.06250000000000 0.07812500000000 0.07031250000000 0.08634303568347 10.00000000000000 0.07031250000000 0.07812500000000 0.07421875000000 0.03563319753740 11.00000000000000 0.07421875000000 0.07812500000000 0.07617187500000 0.01028122478907 12.00000000000000 0.07617187500000 0.07812500000000 0.07714843750000 -0.00239400219556 13.00000000000000 0.07617187500000 0.07714843750000 0.07666015625000 0.00394354733549 14.00000000000000 0.07666015625000 0.07714843750000 0.07690429687500 0.00077475652874 15.00000000000000 0.07690429687500 0.07714843750000 0.07702636718750 -0.00080962685008 16.00000000000000 0.07690429687500 0.07702636718750 0.07696533203125 -0.00001743616404 17.00000000000000 0.07690429687500 0.07696533203125 0.07693481445313 0.00037865993160 18.00000000000000 0.07693481445313 0.07696533203125 0.07695007324219 0.00018061182108 19.00000000000000 0.07695007324219 0.07696533203125 0.07695770263672 0.00008158781284 20.00000000000000 0.07695770263672 0.07696533203125 0.07696151733398 0.00003207582048 21.00000000000000 0.07696151733398 0.07696533203125 0.07696342468262 0.00000731982724 22.00000000000000 0.07696342468262 0.07696533203125 0.07696437835693 -0.00000505816865由结果可知:x2=0.07696437835693;三、在区间(2,6)上的>> bisection(y,2,6,1000,10^-6) [ n xa xb xc fc ] 1.00000000000000 2.00000000000000 6.00000000000000 4.00000000000000 17.75680249530792 2.00000000000000 2.00000000000000 4.00000000000000 3.00000000000000 -8.14112000805987 3.00000000000000 3.00000000000000 4.00000000000000 3.50000000000000 2.22578322768962 4.00000000000000 3.00000000000000 3.50000000000000 3.25000000000000 -3.56367986546989 5.00000000000000 3.25000000000000 3.50000000000000 3.37500000000000 -0.82534681259798 6.00000000000000 3.37500000000000 3.50000000000000 3.43750000000000 0.66050436568885 7.00000000000000 3.37500000000000 3.43750000000000 3.40625000000000 -0.09227275798887 8.00000000000000 3.40625000000000 3.43750000000000 3.42187500000000 0.28164331500236 9.00000000000000 3.40625000000000 3.42187500000000 3.41406250000000 0.09406835756613 10.00000000000000 3.40625000000000 3.41406250000000 3.41015625000000 0.00074371965680 11.00000000000000 3.40625000000000 3.41015625000000 3.40820312500000 -0.04580302043948 12.00000000000000 3.40820312500000 3.41015625000000 3.40917968750000 -0.02253927805449 13.00000000000000 3.40917968750000 3.41015625000000 3.40966796875000 -0.01090018640774 14.00000000000000 3.40966796875000 3.41015625000000 3.40991210937500 -0.00507883521433 15.00000000000000 3.40991210937500 3.41015625000000 3.41003417968750 -0.00216770824306 16.00000000000000 3.41003417968750 3.41015625000000 3.41009521484375 -0.00071203190978 17.00000000000000 3.41009521484375 3.41015625000000 3.41012573242188 0.00001583446928 18.00000000000000 3.41009521484375 3.41012573242188 3.41011047363281 -0.00034810107130 19.00000000000000 3.41011047363281 3.41012573242188 3.41011810302734 -0.00016613388878 20.00000000000000 3.41011810302734 3.41012573242188 3.41012191772461 -0.00007514985669 21.00000000000000 3.41012191772461 3.41012573242188 3.41012382507324 -0.00002965773044 22.00000000000000 3.41012382507324 3.41012573242188 3.41012477874756 -0.00000691163977由结果可知:x3=3.41012477874756 .
求方程f(x)=x3-sinx-12x+1的全部实根,ε=10-6.
求方程f(x)=x3-sinx-12x+1的全部实根,ε=10-6.牛顿法
求方程f(x)=x3-sinx-12x+1的全部实根,ε=10-6方案3 用牛顿法求解
急需MATLAB二分法求方程求求方程f(x)=x^3-sin(x)-12*x+1的全部实根,ε=10^-6程序
用二分法求方程x3-x-1=0在[1,1.5]的一个实根精确到0.1
方程x-sinx=0的实根个数()
证明:方程sinx+x+1=0 只有一个实根.
用二分法求方程解用二分法求方程f(x) = x3 – x – 1 = 0在区间[1.0,1.5]内的一个实根,要求准确到
方程x3-6x2+9x-10=0的实根个数是( )
已知函数f(x)=x+1x,x>0x3+9,x≤0,若关于x的方程f(x2+2x)=a(a∈R)有六个不同的实根,则a的
f(x)在x=0的领域内有二阶导数,又x→0时lim((sinx+xf(x))\x3)=1/2,求f(0),f'(0),
证明方程x3-3x+sinx在区间(1,2)上至少有一个实根.