Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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=1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started