You are on page 1of 6

1.Use Program 2.1 to approximate the fixed points (if any) of each function.

Answers should
be accurate to 12 decimal places. Produce a graph of each function and the line y = x that
clearly shows any fixed points.

答:首先依据课本程序2.1编写求解不动点的代码:

然后分别编写不同题目对应的代码求解不动点:
(a) 编写求解该方程代码:

由图像可知共有三个不动点,但是在从不同方向分别对这三个点进行求近似解时,皆
发散,故皆为排斥不动点。
(b) 编写求解该方程代码:

由图像可知共有1个不动点,且程序求解近似值为:
P =0.768169156735896

(c) 编写求解该方程的代码:

由图像可知共有两个不动点,但是由程序求解和求导可知,在两个不动点处,
|g’(P)|>1, 这两个不动点为排斥不动点。

(d) 编写该方程的求解代码:

由图像可知共有两个不动点,由程序求解得其中一个为0.999999999996693,为收敛
不动点;另一个为排斥不动点:

2.Find an approximation (accurate to 10 decimal places) for the interest rate I that will yield
a total annuity value of $500,000 if 240 monthly payments of $300 are made.
答:首先用matlab编写二分法求解程序(参考课本程序2.2) :
寻找利率的初始区间:

得到区间及对应函数值:

编写代码求解利率:
利率 I = 0.157539310288429
2
3.(a) Find the point on the parabola y=x that is closest to the point (3, 1) accurate to 10
decimal places.
(b) Find the point on the graph of y=sin(x-sin(x)) that is closest to the point (2.1, 0.5)
accurate to 10 decimal places.
(c) Find the value of x at which the minimum vertical distance between the graphs of
2
f(x)=x +2 and g(x)=(x/5)-sin(x) occurs accurate to 10 decimal places.
先根据程序2.5,编写牛顿-拉夫森迭代代码:

答:(a)先求出抛物线上的点到点(3,1)距离的函数的一阶导数:

画出函数导数的图像,确定x的取值范围,利用牛顿-拉夫森迭代求解导数的零点,精确到
小数点后10位:
由程序得到:距离点(3,1)最近的点为(1.289623901485061,1.663129807281550)

距离为1.834428395897875

(b)先求出曲线上的点到点(2.1, 0.5)距离的函数的一阶导数:

画出函数导数的图像,确定x的取值范围,利用牛顿-拉夫森迭代求解导数的零点,精确到
小数点后10位:

由程序得到:距离点(3,1)最近的点为:
(1.869372235848085,0.791717797255861)

距离为0.371871535390278

(c) 先求出两条曲线的垂直距离的函数的一阶导数和二阶导数:
画出函数一阶导数的图像,确定x的取值范围,利用牛顿-拉夫森迭代求解导数的零点,精
确到小数点后10位:

由程序得到当x= -0.366749012061120,两条曲线的垂直距离最短
最短距离为1.849272098852754

You might also like