Write a matlab program segment

Assignment Help MATLAB Programming
Reference no: EM13189528

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.

Reference no: EM13189528

Questions Cloud

Compute the current break-even sales (units). : Currently, the unit selling price of a product is $110, the unit variable cost is $80, and the total fixed costs are $345,000. A proposal is being evaluated to increase the unit selling price to $120.
Text-values and attitudes expressed in ming fiction : According to the text, values and attitudes expressed in Ming fiction and plays began to have an impact on the culture of the literati. How?
Find the volume v of water in the bowl : A bowl is shaped like a hemisphere with diameter 36 cm. A ball with diameter 4 cm is placed in the bowl and water is poured into the bowl to a depth of h centimeters. Find the volume V of water in the bowl. Consider two cases: one in which the bal..
How many acre-feet of water are evapotranspirated : The average amount of evapotranspiration at Beowawe (water vapor being transferred to the atmosphere by evaporation and plant activity) is 51.17 inches per year. How many acre-feet of water are evapotranspirated at Beowawe on the average every yea..
Write a matlab program segment : 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.
Determine what is the gradient amount : A project generates decreasing cash flows, $10,000 one year from now, decreases $1,000 every year and the project at the end of year 6 (6 years from now). At an annual interest rate of 12%.what type of Gradient is this
How much worth per second : The highest average cost of 30-second commercial in October,2002 was $455,700. How much worth per second?
How much alpha energy was absorbed : The efficiency of a scintillation detector is 5.1%. It absorbs alpha radiaion, producing 41,100 photons of average wavelength 4800 angstroms. How much alpha energy was absorbed?
Find first four terms in each of two linearly independent : Find the first four terms in each of two linearly independent solutions of the given differential equation (solve by means of a power series about the given point x0 ).

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Write a curried function to add n

Write a curried function to add N (where N is an integer) to each item of a list.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

  Computes the stiffness matrix for one bilinear element with

write Matlab code that computes the stiffness matrix for one bilinear element with 4 nodes

  Create an output array using input x values 1 through 10

The function is y=(x)/(sqrt(x)), create an output array using input x values 1 through 10. I can't seem to get this to work for some reason...

  Least squares

For homework consider the points (0,0), (1,2), (2,3), (3,9), ( 4,17), (5,24), (6,37). (1) Use Matlab to find the least squares best fit with a line.  Turn in A, y and c and a plot like the one above.  Also (2) use Matlab to find the least square best..

  Calculate the geometric mean of numbers

Write a program to calculate the geometric mean of numbers entered by a user. The program should prompt the user to enter numbers and continue to accept the numbers until the user enters 999.

  Describe how you would access these 4 members

Create a namespace titled global Type that contains four members. The members should be two named constants, n and rate. It should also contain a variable count and the function printResult. Describe how you would access these 4 members in a progr..

  To make things easy, just place the line makeclothes

To make things easy, just place the line makeClothes at the top of your script so you're guaranteed to have the correct acmeClothes array to work with.

  Secant method to tryt to find out the root

create a function that will use the secant method to tryt to find out the root

  Write a script that simulates a casino machine

Write a script that simulates a casino machine. To play a single round on the machine user pays $ 5. Now when the user start the machine, the machine rolls a pair of dice (simulate both dice with help of random number generator) and user only wins..

  Value for the side of the octagonal prism

Value for the side of the octagonal prism, and a scalar value for the height of the octagonal prism. Generate the x,y,z arrays that define the 9 faces of the pyramid (octagonal base and 8 triangles. Use fill3 command to create the faces (faces wit..

  Fourier transform and biosignal analysis

Fourier Transform and Biosignal Analysis - series data into its frequency components for the purpose of signal analysis and processing.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd