in numerical integration and in many other cases


In numerical integration and in many other cases, we need a polynomial named Legendre polynomial. Often the zeros i.e. the roots of the polynomial are also needed. The sixth order Legendre polynomial is given by the following equation:

P6(x) = 693x6 - 945x4 + 315x2 - 15

There are six roots of the P6(x) = 0 equation. Note that all the zeros of Legendre polynomial have magnitude less than one i.e. the roots are between -1 and 1. Also, note that for a polynomial of even order, the zeros are symmetrical about the origin. Therefore, for each root x, -x is also a root. If you find the three roots between 0 and 1, the other roots are negative of them.

Now write a MATLAB program that does the following:

a) Plot the given function in MATLAB for x ranging from -1 to 1. Put a proper title of the plot, also label the axes appropriately.

b) Use MATLAB's roots function to obtain the six roots of the equation. Display the roots and plot them with different colors and symbols on the same chart where you plotted the function.

c) Write a MATLAB program segment that will implement the root finding algorithm by Newton-Raphson method. Newton-Raphson method needs one initial value to run each time. You program segment will be executed with different initial values that you get from
d).

d) Use a loop in your program to execute the Newton-Raphson program segment for each initial value between -1 to 1 with an interval 0.1. Plot the initial values on the x-axis with the color that you used in b) to plot the root obtained from this initial value; these plots will be on the same chart. For example, if you start from 0.1 and obtain the first root that you plotted by using color red in b), then plot (0.1, 0) with color red.

e) In the plot, you will see one root is obtained from an initial value that is close to another root. Can you explain by observing the plot why that is happening.

Request for Solution File

Ask an Expert for Answer!!
Applications of MATLAB: in numerical integration and in many other cases
Reference No:- TGS0501447

Expected delivery within 24 Hours