试位法的matlab程序步骤,常州大学数值分析第六章习题解答

化专012 闵建中12102914

1.解:

(1):

x = -2:0.1:0;

y1 = 3*x.^3-2*x+2;

y2 = 0;

plot(x,y1,'b-',x,y2,'r-')

7576a8d28983e6d288ca6db9d231c943.png

由图可以看出,方程的有根区间为[-1.2,-1]

2.解:

(1) 使用二分法求满足精度要求的解:

a=-1.2;b=-1;delta=0.01;

f=@(x) ( 3*x.^3-2*x+2);

[c]=bisect(f,a,b,delta)

有结果如下:

c = -1.1187

(2)(3)小题同上!

3.试位法的matlab实现:

function [c,k]=fapo(f,a,b,epsilon,max1)

% Use false position to find the root of function

% Input : f = the function

% a,b = left and right brackets of root

% epsilon = the tolerance for the value of f at the zero

% max1 = the maximum number of iterations

% Output : c = estimate of the root

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值