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 November 2017, Treasury 4s of 2041 offered a semiannually compounded yield to maturity of 2.6%. Recognizing that coupons are paid semiannually, calculate the bonds price.
-
What is the probability that a player is dealt 2 cards worth 10 points each?
-
Friedman Construction reported taxable income of $50,000 for 2011, its first fiscal year. The enacted tax rate for 2011 is 40%. Enacted tax rates and deductible amounts for 20122014 are as follows:...
-
Common stock, $12 par value $ 480,000 Paid-in capital in excess of par value, common stock Retained earnings 90,000 360,000 In the fourth quarter, the following entries related to its equity are...
-
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...
-
Explain different concept related to profit calculation.
-
Examine the function of narrative framing devices in shaping reader expectations and thematic resonance. How do authors like Italo Calvino or Margaret Atwood use framing narratives to provide...
-
Explore the concept of intertextuality in narrative construction, particularly in postmodern literature. How do authors like Jorge Luis Borges or Salman Rushdie weave together disparate texts and...
-
Here is our non profit budget We would raise money by talking to schools mostly and parents that can relate to our cause. Reaching out to schools should not cost much but it will still need to be in...
-
What are the potential challenges and benefits associated with distributed leadership models in flat organizational structures, and how can leaders ensure effective coordination and communication...
-
1 A business, Davis Wreckers, is considering a project that will require the company to purchase $470,000 in new equipment and to spend $80,000 on building rennovations to accommade the new...
-
List these in order of increasing entropy: (a) 0.5 kg of ice and 0.5 kg of (liquid) water at 0C; (b) 1 kg of ice at 0C; (c) 1 kg of (liquid) water at 0C; (d) 1 kg of water at 20C.
-
Factor and simplify, if possible. Check your result using a graphing calculator. 3 cot 2 + 6 cot + 3
-
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...
-
Actividad 3. Anlisis y reporte de caso: empleado herido mientras operaba una sierra circular
-
Which of the following is not a responsibility of the California Department of Tax and Fee Administration? a. administration of sales tax b. administration of use tax c. collection of cost recover...
-
9 In March 2012, Yoshiro Inc.. decided to retire an outstanding bond issue before maturity. The coupon rate on the bond issue was 5%. The bond was issued in 2011 at an effective interest rate of 6%....
Study smarter with the SolutionInn App