13. Write a user defined MATLAB function to compute the definite integral, intout, of a function...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
13. Write a user defined MATLAB function to compute the definite integral, intout, of a function f (x) in the limits x0 to xn with an accuracy of sigfig significant digits using an n-segment composite trapezoidal rule as represented by the formula: 1 = f(x)dx= =[f(x)+2 "-1 f(x)+2f(x+mh) + f (x) where h= Xx,,-Xo . n m=1 3 Use Romberg extrapolation, I = (41 Fine-Coarse), where I fine and I coarse represents trapezoidal integrals evaluated with finer (n) and coarser grids respectively, for a faster convergence. Your code needs to be capable of making a decision on grid refinements based on the desired accuracy. As discussed in class, start iterating with n = 1, and keep on doubling n until you reach the desired accuracy. This will make the step size / for the coarser grid calculation two times that of the finer grid calculation. Using this strategy, it was discussed in class that in each subsequent grid refinement, you need to evaluate the function f(x+mh) only for the odd values of m. To start with, initialize IFine equal to the trapezoidal integral corresponding to n = 1. The convergence criterion is based on the relative error in IFine Use your code to solve the following integrals with an accuracy of 14 significant digits. In all cases calculate the error and note down the number of iterations required to achieve the desired accuracy. (a) / = = (t-2)dt; Analytical solution, 1 = 84 (b) 1 = 22w-w-3 dw; Analytical solution, I = -32/15 w2 13. Write a user defined MATLAB function to compute the definite integral, intout, of a function f (x) in the limits x0 to xn with an accuracy of sigfig significant digits using an n-segment composite trapezoidal rule as represented by the formula: 1 = f(x)dx= =[f(x)+2 "-1 f(x)+2f(x+mh) + f (x) where h= Xx,,-Xo . n m=1 3 Use Romberg extrapolation, I = (41 Fine-Coarse), where I fine and I coarse represents trapezoidal integrals evaluated with finer (n) and coarser grids respectively, for a faster convergence. Your code needs to be capable of making a decision on grid refinements based on the desired accuracy. As discussed in class, start iterating with n = 1, and keep on doubling n until you reach the desired accuracy. This will make the step size / for the coarser grid calculation two times that of the finer grid calculation. Using this strategy, it was discussed in class that in each subsequent grid refinement, you need to evaluate the function f(x+mh) only for the odd values of m. To start with, initialize IFine equal to the trapezoidal integral corresponding to n = 1. The convergence criterion is based on the relative error in IFine Use your code to solve the following integrals with an accuracy of 14 significant digits. In all cases calculate the error and note down the number of iterations required to achieve the desired accuracy. (a) / = = (t-2)dt; Analytical solution, 1 = 84 (b) 1 = 22w-w-3 dw; Analytical solution, I = -32/15 w2
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
A two-dimensional state of stress at a point in a loaded material in the direction defmed by the x-y coordinate system is defined by three components of stress xx yy, and xy. The stresses at the...
-
The new line character is utilized solely as the last person in each message. On association with the server, a client can possibly (I) question the situation with a client by sending the client's...
-
The insurance company Helmet is considering acquiring BeSafe, a life insurance company. According to BeSafes most recent financial statements, its loss ratio stands at 0.9, and its expense ratio...
-
On January 1, 2017, Tiamund Corp. sold at 103, 100 of its $1,000 face value, five-year, 9% non-convertible, retractable bonds. The retraction feature allows the holder to redeem the bonds at an...
-
Suppose you purchase 500 shares of stock at $48 per share with an initial cash investment of $8,000. If your broker requires a 30 percent maintenance margin, at what share price will you be subject...
-
The following reactions take place at \(1500 \mathrm{~K}\) and \(10 \mathrm{bar}\) : \[ \begin{align*} & A+B ightarrow C+D \tag{A}\\ & A+C ightarrow 2 E \tag{B} \end{align*} \] where...
-
The expected annual returns are 15% for investment 1 and 12% for investment 2. The standard deviation of the first investments return is 10%; the second investments return has a standard deviation of...
-
Describe the key differences between mutexes and semaphores in the context of process synchronization. When would you use one over the other ?
-
MBA 708 Essentials of Financial Statement Analysis Week 6 Case Study: Transaction and Financial Analysis Tallulah Company has been in business for several years and is publicly traded on a major U.S....
-
Gagner Clinic purchases land for $175,000 cash. The clinic assumes $1,500 in property taxes due on the land. The title and attorney fees totaled $1,000. The clinic has the land graded for $2,200....
-
Existential Reflections: According to Stuart Greenstreet, writing in Philosophy Now , 2016: "No objective account of my properties could ever describe my subjective experience of what it's like to be...
-
The Plaintiff must suffer harm in order to sue for negligence. If he suffers no harm, he cannot sue. 4. Penguin is a parachuter. One day, while jumping from a plane, he suffers a bad fall and breaks...
-
watch the video (link) for about 30 min and answer the questions. https://youtu.be/ue5FwR0OEXE David Starkey's Magna Carta . In a paragraph or two, summarize you have learned from the video )....
-
Assignment Documents Read the article, "U.S. Health Care from a Global Perspective, 2019: Higher Spending, Worse Outcomes?"(See article attached below or review the Reading and Resources for Module...
-
The state of Rhode Island requires that all contractors must be licensed for any residential work to be done. Barrington General Contractors was hired to build an addition to a home that the Leighton...
-
Sketch the drain and transconductance curve for VGS = +2V, +1V, 0V -1V, -2V, -3V and -4V.
-
Prove the formula for (d/dx)(cos-1x) by the same method as for (d/dx)(sin-1x).
-
Make a plot of a circle with its center at (4.2, 2.7) and radius of 7.5.
-
Use a single command to create a row vector (assign it to a variable named b) with 8 elements such that the last three element are 3.8 and the rest of the elements are 0s. Do not type the vector...
-
The circumference of an ellipse can be approximated by: C = Ï[3(a + b) - ./(3a + b) (a + 3b)] Calculate the circumference of an ellipse with a = 16 in. and b = 11 in. a
-
The following are methods used to evaluate public health data and scientifc evidence except a. Use of standard criteria by experts b. By combining the results of multiple scientifc studies that are...
-
Which industrial transducer does not require a power supply (selfgenerated signal)?
-
Nordson Co. of Amherst, Ohio, a maker of painting and glue equipment, exports nearly half its output. Customers value its reliability as a supplier. Because of an especially sharp run up in the value...
Study smarter with the SolutionInn App