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...
-
In our story of Jack and Jill in the chapter, why couldnt they successfully remove themselves from box 4 in Exhibit 1?
-
The Pitot tube on a supersonic aircraft (see Video V3.8) cruising at an altitude of \(30,000 \mathrm{ft}\) senses a stagnation pressure of 12 psia. If the atmosphere is considered standard, determine...
-
Assume that you just won the state lottery. Your prize can be taken either in the form of $40,000 at the end of each of the next 25 years (that is, $1,000,000 over 25 years) or as a single amount of...
-
Looking at the perspective of a patient Most employer based health insurance includes deductibles, co-pays, and other mechanisms to engage the employee in the overall cost of healthcare expense....
-
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...
-
Why do writing and speaking become even more important as people rise in the organization?
-
Omega Co. has annual sales of $250,000, costs of goods sold of $168,000, and assets of $322,000. Accounts receivable are $86,200. What is the receivables turnover?
-
Problem 2: Aggregate Savings and Labour Supply with a Bequest Motive Consider the following consumer's problem: max U = +1 +2 +y+0+=1, 0
-
What does this code do? Comparator sortByYearDescTitle (b1, b2)->b2.getPublication Year() bl.getPublication Year() == 0 ?bl.getTitle().compareTo (b2.getTitle()) : b2.get Publication Year()...
-
What is global investment outlook for US Large Cap Market, the mutual fund Akre Focus Instl-AKRIX?
-
Please write Apply content marketing fundamentals principles to develop a basic content marketing strategy and plan including: storytelling, content marketing mission, audience persona, brand voice,...
-
Connie is the recently appointed engagement partner of the audit of Camel Ltd. She has just taken over the audit from Kar-Ming Leo, who rotated off the audit after a seven-year period as the...
-
Perform the indicated operations. In designing a cam for a fire engine pump, the expression is used. Simplify this expression. (3) (3 4 32
-
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...
-
es Cone Corporation is in the process of preparing its December 31, 2024, balance sheet. There are some questions as to the proper classification of the following items: a. $69,000 in cash restricted...
-
Grayson (single) is in the 24 percent tax rate bracket and has sold the following stocks in 2023: Note: Loss amounts should be indicated by a minus sign. Stock Stock A Date Purchased 1/23/1999 Basis...
-
Determine the magnitude,direction and position of the force which will keep the body in equilibrium? 20 N 30 30 N 1 m B 1 m 1 m 70 N D 1 m 60 50 N
Study smarter with the SolutionInn App