Question: Please answer the question 1 and 2 in Matlab code 1. Write a code that computes Cn and the absolute error, n=Cn2, as a function

 Please answer the question 1 and 2 in Matlab code 1.Write a code that computes Cn and the absolute error, n=Cn2, as

Please answer the question 1 and 2 in Matlab code

1. Write a code that computes Cn and the absolute error, n=Cn2, as a function of n=1,2,,30. Plot the absolute error on a semi-logarithmic plot (your vertical axis should have logarithmic scale). 2. Note that equation (1) can alternatively be written as sn=2+4sn12sn1. Compute and plot the absolute error n again, except that this time use equation (2) to compute sn. Consider the problem of approximating by inscribing an equilateral polygon inside a unit circle, as discussed in class (see figure 1). Recall that the number of edges are given by en=32n, so that for n=1 we obtain a hexagon, for n=2 a 12-gon, and so on. Also recall that the edge length of the polygon is given by the recursive formula, sn=24sn12, where s1=1 and n2. As a result, the circumference of the polygon is given by Cn=ensn. As n tends to infinity, this circumference converges to the circle's circumference, 2. In other words, limnCn=2. Figure 1: An equilateral hexagon inscribed in a unit circle. We have n=1,en=6 and sn=1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!