Develop an M-file function to implement adaptive quadrature based on Fig. 20.6. Test the function by using
Question:
Develop an M-file function to implement adaptive quadrature based on Fig. 20.6. Test the function by using it to determine the integral of the polynomial from Example 20.1. Then use it to solve Prob. 20.20.
Fig.20.6
Example 20.1
Problem 20.20
The upward velocity of a rocket can be computed by the following formula:
where ν = upward velocity, u = velocity at which fuel is expelled relative to the rocket, m0 = initial mass of the rocket at time t = 0, q = fuel consumption rate, and g = downward acceleration of gravity (assumed constant = 9.81 m/s2). If u = 1850 m/s, m0 = 160,000 kg, and q = 2500 kg/s, determine how high the rocket will fly in 30 s.
function q = quadadapt (f, a, b, tol, varargin) * Evaluates definite integral of f(x) from a to b if nargin < 4 | isempty (tol), tol c = (a + b)/2; 1. e-6; end fa = feval (f, a, varargin{:}); feval (f, c, varargin{:}); fc = fb = feval (f, b, varargin{:}); quadstep (f, a, b, tol, fa, fc, fb, varargin{:}); q = end function q = quadstep (f, a, b, tol, fa, fc, fb, varargin) Recursive subfunction used by quadadapt. h = b = a; c = (a + b)/2; fd = feval (f, (a+c)/2, varargin{:}); fe = feval (f, (c+b)/2, varargin{:}); q1h/6* (fa + 4*fc + fb); q2 = h/12 * (fa + 4*fd + 2*fc + 4*fe + fb); q1) <= tol if abs (q2 q=q2 + (q2 - q1)/15; = - else qa = quadstep (f, a, c, tol, fa, fd, fc, varargin{:}); qb c, b, tol, fc, fe, fb, varargin{:}); quadstep (f, = end end q = qa + qb;
Step by Step Answer:
From the details provided it appears that you are tasked with developing an Mfile function in MATLAB that can perform adaptive quadrature for numerica...View the full answer
Applied Numerical Methods With MATLAB For Engineers And Scientists
ISBN: 9781259027437
3rd Edition
Authors: Steven C. Chapra
Students also viewed these Mathematics questions
-
Use the indicated data to construct the frequency distribution. Listed below are the first 50 Chicago commute times from Data Set 31. Construct a frequency distribution. Use a class width of 15...
-
The upward velocity of a rocket can he computed by the following formula: where = upward velocity, u = velocity at which fuel is expelled relative to the rocket, m 0 = initial mass of the rocket at...
-
A researcher is running a simulation of an upward rocket to study the upward velocity of the rocket using various fuel consumption rates. The researcher has found that the upward velocity of the...
-
Can you draw the upper shear zone margin on Figure 16.9? Is it easily definable?
-
In Problem 12.6 on page 424, an owner of a moving company wanted to predict labor hours, based on the cubic feet moved (stored in Moving ). Using the results of that problem, a. determine the...
-
Phone numbers The dotplot below displays the last digit of 100 phone numbers chosen at random from a phone book. Describe the shape of the distribution. Does this shape make sense to you? Explain. 0...
-
Cost of indirect material is apportioned to various departments. State whether the following statements are true or false:
-
1. Which inventory costing method generally results in less current taxes paid by the company? a. LIFO b. FIFO c. Moving Average d. All methods result in the same taxes paid 2. Which inventory...
-
Each year, POPPY Company's fiscal year ends on December 31. To provide funding for its next project, POPPY issued 9% bonds with a face amount of $670,000 on April 1, 2023. The bonds sold for...
-
Develop an M-file function to implement Romberg integration based on Fig. 20.2. Test the function by using it to determine the integral of the polynomial from Example 20.1. Then use it to solve Prob....
-
The root-mean-square current can be computed as For T = 1, suppose that i(t) is defined as Evaluate the I RMS using (a) Romberg integration to a tolerance of 0.1%, (b) The two- and three-point...
-
Do you believe that ERM will continue to evolve, and if so, how?
-
In the global discourse on healthcare, the United States and England stand out as two contrasting models, each providing a distinct approach to addressing the challenges of cost , access, and...
-
2.A. Using the quotes below, answer the following questions. Exchange rate Bid Ask In New York, USD/EUR 1.2267 1.2875 In London, USD/GBP 1.6555 1.7334 2.A1. Calculate the EUR/GBP cross exchange...
-
Question 43 Part B Q1ii 20 points Save A a) A property is currently leased for $100,000 p.a. with fully recoverable outgoings. The lease has 3 years to run on the current (fixed) rent. The market...
-
Define HIPPA? What is the purpose of HIPPA? What are the 4 main rules of HIPPA?
-
Accounting for Inventories" Please respond to the following: As a Financial Accountant,determine the best type of income statement a retailer should use.Defend your suggestion. Analyze inventory...
-
1. Given TOMS mission and the way its business model is constructed, would you characterize TOMS business model as a standard business model or a disruptive business model? What impact has TOMS...
-
Why did management adopt the new plan even though it provides a smaller expected number of exposures than the original plan recommended by the original linear programming model?
-
The following data shows the relationship between the viscosity of SAE 70 oil and temperature. After taking the log of the data, use linear regression to find the equation of the line that best fits...
-
The data below represents the bacterial growth in a liquid culture over a number of days. Find a best-fit equation to the data trend. Try several possibilities-linear, parabolic, and exponential. Use...
-
The concentration of E. coli bacteria in a swimming area is monitored after a storm: The time is measured in hours following the end of the storm and the unit CFU is a "colony forming unit" Use this...
-
In 2019, Sunland Company had a break-even point of $388,000 based on a selling price of $5 per unit and fixed costs of $155,200. In 2020, the selling price and the variable costs per unit did not...
-
11. String Conversion Given a binary string consisting of characters '0's and '1', the following operation can be performed it: Choose two adjacent characters, and replace both the characters with...
-
Consider the table shown below to answer the question posed in part a. Parts b and c are independent of the given table. Callaway Golf (ELY) Alaska Air Group (ALK) Yum! Brands (YUM) Caterpillar...
Study smarter with the SolutionInn App