Develop a quadrature method for computing

Assignment Help MATLAB Programming
Reference no: EM132210171

In this assignment, we develop a quadrature method for computing -11 g(x) √(1 - x2)dx for a given g : [-1, 1] → R. You can use the built-in routines to compare your results and compute errors for use in §B.

A1. Show that p0(x) = 1 and p1(x) = 2x . By using a trigonometric identity, show that

pn(x) = 2xpn-1(x) - pn-2(x), n = 2, 3, .....

Hence, show that pn(x) is a polynomial of degree n and that p0,......, pn form a basis for pn.

A2. Let x1, ......., xn denote the roots of pn(x) . Show that the matrix

1810_Matrix.jpg

is non-singular. Hence, show that there exist w1, ..... wn, such that

147_figure.jpg

HINT: Suppose that there exists a c 2 Rn such that c TJn = 0 .

A3. By making a substitution, show that

-11 pn(x)pm(x)√(1 - x2)dx = 0, n ≠ m

A4. By using the basis {p0, .....}, for pn for pn and A3, prove that

-11 p(x)√(1 - x2)dx = Σi=1n p(xi)wi,  ∀p∈pn,

for the xi and wi defined above.

Now show that the relationship also holds for p∈p2n-1 to show the quadrature rule has degree of precision at least 2n - 1 and hence is a Gaussian quadrature rule.

A5. Let q0(x) := 1 and qn(x) := 2ndet(xl - An) for n = 1, 2, : : : , where An is the n × n matrix

237_Matrix.jpg

Show that qn = pn for n = 1, 2, : : : .

Hence, show that eigenvalues of An equal the quadrature nodes xi.

A6. Denote the ith column of Jn (from A2) by

vi = [p0(xi), p1(xi),........pn-1(xi)]T , i = 1.....n

Show that vi is an eigenvector of An corresponding to the eigenvalue xi. Hence, show that the quadrature weight

wi = A.(1/||vi||2) (vi1)2 , A :=  -11√(1 - x2)dx = 1/2Π

where v1i  is the first component of the ith eigenvector vi.

B Computing

B1. Write a MATLAB code to compute the quadrature nodes x1, ....... , xn and weights w1, ....., wn for the quadrature rule developed in §A.

Fill in
function [x,w]=getquad(n)%
% Return a vector of quadrature nodes x and weights w,
% of dimension n.
% ....

B2. Write a routine to evaluate the quadrature for a given function g . Fill in function out=myquad(g,x,w)%
% Evaluate sum_{i=1,...,n} w_i g(x_i)
assert (length(x)==length(w)) % error checking
%...
%...
out= % give return value

It should run with the call
myquad(@(x) x,x,w)
to evaluate -11x√(1 - x2)dx. Verify the degree of precision is 2n - 1 for n = 10 (using MATLAB).

B3. Use the built-in MATLAB routines to find reference values for

-11g(x)√(1 - x2)dx

in the case g1(x) = exp(x) and g2(x) = x sin(x) . We use these values in the next question to evaluate error. Note down the number of function evaluations, when using quad.

B4. Using the quadrature method developed in B2., evaluate

-11gi(x)√(1 - x2)dx,  for  i = 1,2

Give a plot of the error against n , taking care to use an appropriate range of n and plot (e.g., loglog vs plot vs semilogx etc).

Compare the number of function evaluations used by the MATLAB routine quad and the method of B2.

Reference no: EM132210171

Questions Cloud

Build and run your program on lauchpad : On Timer 1 interrupt, sample data from PD0, then output the same data to DAC through SSI0 (through which to the DAC chip).
What was dettwyler interaction like with agnes : Discuss the practice of female circumcision in Mali. What was Dettwyler's interaction like with Agnes? What are some of the reasons given for the practice.
How bullying experienced by one adolescent may change : Post a scenario that illustrates how bullying experienced by one adolescent may change the experience of another who witnesses it.
Define personal and professional social work values : Heterosexism is defined as "the discrimination or prejudice by heterosexuals against homosexuals" (merriam-webster.com) and is predicated on the belief.
Develop a quadrature method for computing : Develop a quadrature method for computing -1?1 g(x) v(1 - x2)dx for a given g : [-1, 1] ? R. You can use the built-in routines to compare your results
How a professional can proactively approach career changes : Explain how professional etiquette impacts workplace relationships. Explain how a professional can proactively approach career changes.
Discuss about the dysfunctional behaviors : Identify and discuss two to three dysfunctional behaviors that can result from intergenerational abuse. Keeping in mind the need to protect the welfare.
Discuss how social media has impacted your identity : According to the film, "the consumer is now the marketer". What does this mean? Please provide some examples. Is this a change from how advertising.
Write a program that estimates the temperature in a freezer : Write a program that estimates the temperature in a freezer in C degrees given the elapse time in hours since a power failure.

Reviews

Write a Review

MATLAB Programming Questions & Answers

  The concentration of medication in the blood declines

After a dose, the concentration of medication in the blood declines due to metabolic processes. The half-life of a medication is the time required after an initial dosage for the concentration to be reduced by one-half.

  Write a matlab program to plot the probability mass function

EECS 3300- Write a MATLAB program to plot the Probability Mass Function (PMF) of the following discrete random variables; Geometric with p = 0.6. Poisson with λ = 5 (Note, λ = np). Binomial with n = 10, p = .4.

  If the outer cylinder is fixed and the inner cylinder

sae 50 oil at 20 degrees c fills the concentric annular space between an inner cylinder ri5 cm and an outer cylinder

  Matlab program for plotting antenna radiation patterns

In this assignment you will develop and test a Matlab program for plotting antenna radiation patterns and antenna parameters calculation

  Problems related to matlab

solve the system for the least-squares estimates of Δρi.

  Discuss about the measurement process and the data

CITS5502 Software Processes -  Assignment Two - Simulating a Process Clearly state your objectives and any assumptions that you have to make in the simulations.

  Write a matlab code that will generate data

CHEG 3053 - THERMODYNAMICS - MATLAB PROJECT - Prototype E - Write a MATLAB code that will generate data needed to prepare a graph showing P vs. x1, y1,; P vs x2

  Implement the paper in MATLAB

Implement the paper in MATLAB (pulse compression techniques mentioned in the paper). Give the detailed report for the implementation

  Write a matlab script program that evaluates the frequency

Write a Matlab script program that reads in a value of ? and evaluates the frequency response for this value of ? together with its polar form

  Demonstrate effective research and report writing skills

MP 3680 Engineering simulation - kinetic analysis - Analyse how certain factors are affecting the accuracy of a simulation and evaluate industry standard

  Write a function that will convert from kw to hp and and

problem engineers use both english and si units on a regular basis. here are some conversions factors for various

  Random processes

Theme: Random Processes, Compute and plot separate correlation functions of white noise data and of sinusoidal data. Do this using both the biased and unbiased autocorrelation functions. Are the results what you expected?

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