Computational-Economics-0923
numerical analysis 0923
写在前面:本周练习题组织得十分巧妙,最终实现的动态效果也十分直观明了。
question 1: Plot $f(x)=sin(x)+cos(x)$, for $x$ between $[-2,2]$ using symbolic expression
1 | %matlab code: |
question 2: Conduct second-order approximation for $f(x)=sin(x)+cos(x)$ at point $x=0$, using symbolic expression
1 | %matlab code: |
question 3: Plot $f(x)=sin(x)+cos(x)$ and its second_order approximation in a single graph
1 | %we have got f_value in E1, and the format of SOA in E2, just calculate SOA and plot them. |
question 4: Apply Newton-Raphson method to find a local maximum for $f(x)=sin(x)+cos(x)$
1 | %matlab code: |
question 5: Plot the whole iteration process with initial guess $x=0$, untill finding the local maximum for $f$.
1 | %we now know how to get SOA at certain point in E2, and have already got the series of maximizers, at which we should conduct the SOA. so we just go through the xk(i) and draw the picture. |