Fill This Form To Receive Instant Help
Homework answers / question archive / 1) The Chebyshev polynomials of the first kind can be derived from the recurrence relation T0(x) = 1, T1(x) = x, Tn+1(x) = 2xTn(x) – Tn-1(x) Where n = 1, 2,
1) The Chebyshev polynomials of the first kind can be derived from the recurrence relation
T0(x) = 1, T1(x) = x, Tn+1(x) = 2xTn(x) – Tn-1(x)
Where n = 1, 2, ..., N. Create a MATLAB file to create and plot the above equations.
(a) Using a MATLAB script file, create a vector x of 100 equidistant points on the interval [—1,1].
(b) Let N = 8, initialize a matrix T of size 30-by-10 whose all elements are zero. The column refers to the Tn(x), while row refers to the corresponding xi components.
(c) Use nested for loop to evaluate all the polynomials at each point of x and Store the results in matrix T.
(d) Use command subplot to plot the first 5 Chebyshev polynomials in the same figure panel and plot the last 5 polynomials in another panel below the first panel, as illustrated in an example below. Label the axes and include the appropriate legends.
2. Devise and implement in MATLAB fixed-point iterative methods for the solution of the nonlinear equation
Log(x) – 1/x-1 = 0 (*).
(a) Produce a figure to illustrate that this equation has two positive roots in the interval (0,3). Use red circle markers to locate the roots on the figure.
(b) Create a MATLAB function myFixedPoint(g, x0, tol, maxiter) implementing a fixed iteration of the type xn+1 = g(xn). The MATLAB function should take as arguments the mathematical function to be iterated g, the initial guess x0, the required tolerance tol and a parameter specifying the maximum number of iterations allowed. The function should return a list [xn, errn] of two lists containing all values of the iterates {xn, n = 0,...} and the error measured {en = |xn – xn-1], n = 0,...}, respectively, computed at each iteration step. In the loop, display the number of iteration, the xn and the error measured, and make sure to produce the output in the following format,
lteration x(n) |x(n+1) - x(n)|
1 2.50000 Inf
2 : :
: : :
where both xn and |xn+1 - xn| are diplayed up to 5 and 7 decimal digits, respectively. You are not allowed to use MATLAB function fzero to solve this problem.
(c) Provide comments in the above MATLAB function to describe what each line does.
(d) Consider the iterative scheme (x) = ex-1/1 the interval (0,1). Create another MATLAB script file for the following,
(i) Call your function in 3(b) and produce figures of the iterates and the error measured in this case if accuracy of 6 decimal digits is required. Label the axes accordingly.
(ii) Provide the value of the root.
(e) Consider the iterative scheme (x) = ex-1/1 the interval (2, 3). Create another MATLAB script file for the following,
(i) Call your function in 3(b) and produce figures of the iterates and the error measured with an initial guess arbitrary close to the solution (which you may identify from the figure in (a)).
(ii) Can you find the root? If not, propose a new iterative scheme (x) and find the root of the nonlinear equation (*) on the interval (2, 3).