Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask MATLAB Expert

Part A -

1) Derive a 4-point formula for an approximation of f"(x) in terms of f(x-3h), f(x-h), f (x), and (x + 2h). Hint: write the Taylor series for f(x - 3h), f(x - h), and f(x+ 2h), and take an appropriate linear combination of these. Also, find the error term.

2) If f"(x) is approximated by the Three-Point Centered Difference formula.

f(x - h) - 2f(x) + f(x + h)/h2

Find the value of the step size, h, which minimizes the upper bound of |E(f, h)|, where E(f, h) is the sum of the round-off and truncation errors. As in class, start by letting f(x- h) y- + ε-, f(x + h) = y+ + ε+, and f(x) = y0 + ε0, where it y-, y0 and y+ are the approximate values of the function evaluations, and ε-, ε0 and ε+ are the errors. Again, assume that |ε-| ≈ ε, |ε0| ≈ ε, and |ε+| ≈ ε, where ε is approximately machine epsilon.

3) Apply Richardson's Extrapolation once starting with the Two-Point Backward Difference formula, f(x) - f(x-h)/h to find a higher-order formula to approximate f '(x). This formula is of what order?

4) Integrate Newton's divided-difference interpolating polynomial to prove the formula

-hh P(x) dx = (1/3)h.

1386_Figure.png

5) Consider the quadrature rule

01f(x)dx ≈ c1f(0) + c2f(1/4) + c3f(1)

Find c1, c2, and c3 such that the quadrature rule integrates the functions f(x) = 1, x, and x2 exactly. (Note that the points are not evenly spaced.) What is the degree of precision of this quadrature formula?

6) Recall that the error in a quadrature rule based on an interpolant P(x) = ax2 + bx + c for f(x) on three evenly-spaced nodes x0, x1, and x2, can be written as

E(x) = x_0x_2((x - x0) (x - x1)( x - x2 )f"(c(x))/6)dx

Find an upper bound for |E(x)| in terms of h. the distance between adjacent nodes, and M3, where M3 = maxx∈[x0-x2]|If"(x)|. You may use the fact that |abF(x)dx| ≤ ab|F(x)|dx for any integrable function F(x)and interval [a, b].

7) If 01 ex^2 dx is approximated with the Composite Trapezoid Rule, determine the number of panels m needed for the upper bound of the absolute value of the error term to be less than any positive real number E.

8) Apply the composite Simpson's Rule with m = 2 panels to the integral. Compute the absolute error between the exact integral and the approximation.

0πxcosxdx

9) Can use calculator with 4 digit rounding. Apply Romberg Integration to find R33 for the integral

01x2dx

Part B -

1) Compute a vector of the exact absolute errors in the Three-Point Centered Difference formula for f"(2), where f(x) = sinx, with h = 10-1,...,10-12. Plot your vector versus h using MATLAB's loglog(). Use the vector to estimate the optimal value of h in MATLAB, and compare this value with your results in problem #2. Use ε = 10-16 (roughly machine epsilon), and also use an upper bound for the fourth derivative for all x ∈ R. What happens as h keeps getting smaller?

2) Write a function m-file to approximate the integral in #7 with the Composite Trapezoid Rule on m panels. The function should accept any number of panels m, any integration bounds, a and b, and any function, func, as input: function int = trapfun (m, a, b, func).

First, run your function for m = 100 panels, and output the approximation. Next, to achieve an error of E = 10-6, run your function with the value of m using your result in #7. Output this approximation.

7) If 0∫1ex^2dx is approximated with the Composite Trapezoid Rule, determine the number of panels m needed for the upper bound of the absolute value of the error term to be less than any positive real number E.

3) Now, write a function m-file to approximate the integral in #7 with the Composite Simpson's Rule on m panels. The function should accept any number of panels m, any integration bounds, a and b, and any function, func, as input function int = simpfun (m, a, b, func). Run your problem for m = 50 panels, and output the approximation.

4) Modify the function romberg.m posted in eLearning, to a function, called rombergmod, that stops generating rows of the matrix (tableau) when the absolute value of the difference between successive diagonal entries is less than a specified error, i.e., use the function call,

r = rombergmod[f, a, b, error]

Inside the function, set the maximum number of rows to be a "large" number, specifically 100. You may need to use an external function m-file, romfun.m, for the function input for f. Run your function for error 0.5x10-8. How many function evaluations (evaluations of the integrand) are used to compute the last diagonal element in the matrix, given this error? This element is what order of approximation?

Attachment:- Assignment.rar

MATLAB, Engineering

  • Category:- MATLAB
  • Reference No.:- M92050981

Have any Question?


Related Questions in MATLAB

Assignment details -need to write a code for connecting

Assignment Details - Need to write a code for connecting segments (Lines) a special case of TSP. The problem is to connect lines in 2d/ 3d space with path obstructions. Can you help me write the code for this? Hope you m ...

Prepare a 3 - 10 pages long reportprepare a presentation

Prepare a 3 - 10 pages long report Prepare a presentation with 5 - 9 slides. The slides will include introduction (need and similar work), theoretical background (tested neural networks), Data, Results (Comparison of the ...

Question a safe prime is a prime number that can be written

Question : A safe prime is a prime number that can be written in the form 2p + 1 where p is also a prime number. Write a MATLAB script file that finds and displays all safe primes between 1 and 1000.

Recitation problems -1 determine the highest real root of

Recitation Problems - 1. Determine the highest real root of f(x) = 2x 3 - 11.7x 2 + 17.7x - 5 using the Newton-Raphson method with at least four iterations. Start with an initial guess of x 0 = 3. 2. Determine the real r ...

What comparison of means test was used to answer the

What comparison of means test was used to answer the question

Question 1 manipulate spectral imagehyperspectral images

Question 1. Manipulate spectral image Hyperspectral images can be seen as a generalisation of normal colour images such as RGB images. In a normal RGB colour image, there are 3 channels, i.e. channels for red colour, gre ...

Assignment -matlab codes and simulated model in

Assignment - Matlab codes and simulated model in simulink/matlab and truetime. 1. Matlab codes and simulink model for pid controller optimization using particle swarm optimization (PSO) my plant is integer order 1000/(s^ ...

Assignment matlab programmingusing appropriate matlab

Assignment: MatLab Programming Using appropriate MatLab syntax, write the code required to analyse and display the data as per the problem description. The order of the MatLab Program should be as follows: Variables and ...

Assignment -data is given on which want to do computational

Assignment - Data is given on which want to do computational production planning using Metaheuristic MATLAB Programming: 1) Ant Colony Algorithm on both Partial and Total Flexible Problem. 2) Bee Algorithm on both Partia ...

Assignmentq1 find the laplace transforms of the following

Assignment Q.1 Find the Laplace transforms of the following functions: (a) t 2 + at + b and (b) sin(2nΠt/T) Q.2 Find f (t) for the following F(s) = α[ f (t)]. (i) 5/(s + 3), (ii) 1/s 2 + 25, (iii) 1/s(s+1) Q.3 Find the L ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As