1. Write a function MyTrapezoidQuad that takes as inputs a function f and an array of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Write a function MyTrapezoidQuad that takes as inputs a function f and an array of values xs with spacing h between them. The function should return the approximated integral of f over the interval (zo...) using the trapezoid rule on the given points. Hint: Use the pseudocode in Listing 1 to write your function. Use your Matlab function to approximate the integral of: A= - [² e² cos(x)dr = (e$ - 1) Jo using n=2,4,8, 16, 32, 64, 128, 256 subintervals (h= 20=). Re- port the results of your approximation in a table with columns: " n the number of subintervals T(h) - the approximated integral values using Trapezoid rule En the absolute error |A-T(h)| -the error ratio (where=1 Hint: Since Trapezoid rule is order 2 in h, your error should decrease by a factor of 4, (22), when you double n. 1. Write a function MyTrapezoidQuad that takes as inputs a function f and an array of values xs with spacing h between them. The function should return the approximated integral of f over the interval (zo...) using the trapezoid rule on the given points. Hint: Use the pseudocode in Listing 1 to write your function. Use your Matlab function to approximate the integral of: A= - [² e² cos(x)dr = (e$ - 1) Jo using n=2,4,8, 16, 32, 64, 128, 256 subintervals (h= 20=). Re- port the results of your approximation in a table with columns: " n the number of subintervals T(h) - the approximated integral values using Trapezoid rule En the absolute error |A-T(h)| -the error ratio (where=1 Hint: Since Trapezoid rule is order 2 in h, your error should decrease by a factor of 4, (22), when you double n.
Expert Answer:
Related Book For
Calculus For Business, Economics And The Social And Life Sciences
ISBN: 9780073532387
11th Brief Edition
Authors: Laurence Hoffmann, Gerald Bradley, David Sobecki, Michael Price
Posted Date:
Students also viewed these programming questions
-
Aqua gym ltd is boutique gym chai that operates in Sydney area. Aqua gym offers an annual membership at a price of $12,000. After costumers pays an upfront cash payment of the annual membership fee...
-
Write a method called printPowersOf2 that accepts a maximum number as an argument and prints each power of 2 from 2 0 (1) up to that maximum power, inclusive. For example, consider the following...
-
9.1 Exercise (JDK Source Code): Extract the source code of the class Math from the JDK source code ("$JAVA_HOME" "src.zip" "Math.java" under folder "java.lang"). Study how constants such as E and...
-
Suppose the graph represents the sales of goods of a company from the year 2000 to 2008. a) Find the average rate of change from x = 1 to x = 4 and interpret. b) Find the average rate of change from...
-
Nola, a tax novice, has a fairly simple tax question. Besides tax services, what are some sources that she can use to answer her question?
-
Examine the values for depreciation in 2015 and the balance for property, plant, and equipment in 2011 and 2015. What was Fincorp's gross investment in property, plant, and equipment during 2015?...
-
Formulate some hypothetical examples of organizations in each stage of the life cycle.
-
Wendy Ellis operates a wholesale computer center and has hired you as her bookkeeper to record the following transactions. She would like you to (1) journalize the following transactions, (2) record...
-
The ratio of cash to monthly cash expenses can be used to _____. a. assess how long a company with negative cash flows from investing activities can continue to operate b. assess how long a company...
-
The following is the statement of financial position of Rasheed Brothers Corporation (amounts in thousands). Instructions Evaluate the statement of financial position presented. State briefly the...
-
A bond that matures in 4 years has a face value of $1,000, an annual coupon of $50, paid annually, and currently sells for $1,017.40. What is this bond's duration?
-
True or False. AC HI pot testing of motor winding systems provides the highest stress available for the evaluation of the winding insulation system. It should therefore be performed ONLY on a new...
-
What can you do with a Reliance Electric loose rotor bar construction on which someone has swedged the bars?
-
True or False. A technician should always be accompanied by an electrician from the customers site to open and test electrical equipment and never open live electrical cabinets.
-
What is the most important aspect of using Automatic Lubers for grease application to a bearing?
-
True or False: When checking for soft foot on a large, heavy machine resting on I-beam rails, it is always advisable to use the one-foot-at-atime method called for by the laser equipment manual.
-
Does Max Webers theory of entrepreneurial growth hold good in todays context? Justify
-
Prove the following D,(cos x) = - sin x (Hint: Apply the identity cos(A + B) = cos A cos B sin A sin B)
-
Repeat Exercise 55 for marginal revenue and for the marginal cost C'(x) = 2 + x + x 2 . Data from Exercises 55 A company determines that the marginal revenue from the production of x units of its...
-
The curve y 2 (2 x) = x 3 is called a cissoid. a. Use a graphing utility to sketch the curve. b. Find an equation for the tangent line to the curve at all points where x = 1. c. What happens to the...
-
In Exercises 15 through 44, evaluate the given definite integral using the fundamental theorem of calculus. (1/2 el/x dx 13 2 a
-
Use chloroform to extract acetone from water. Equilibrium data are given in Table 13-6. Find number of equilibrium stages required for a countercurrent cascade if feed is \(1000.0 \mathrm{~kg} /...
-
We are extracting pyridine from \(500 \mathrm{~kg} / \mathrm{h}\) of a feed that is \(15.0 \mathrm{wt} \%\) pyridine and \(85.0 \mathrm{wt} \%\) water using \(225 \mathrm{~kg} / \mathrm{h}\) of pure...
-
Equilibrium for extraction of acetic acid from 3-heptanol into water at \(25^{\circ} \mathrm{C}\) is \(\mathrm{y}=1.208 \mathrm{x}\), where \(\mathrm{y}=\) weight fraction acetic acid in water and...
Study smarter with the SolutionInn App