Develop an M-file function to implement Romberg integration based on Fig. 20.2. Test the function by using
Question:
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. 20.1.
Fig.20.2
Example 20.1
Data From Problem 20.1
Use Romberg integration to evaluate
to an accuracy of εs = 0.5%.Your results should be presented in the format of Fig. 20.1. Use the analytical solution of the integral to determine the percent relative error of the result obtained with Romberg integration. Check that εt is less than εs.
Transcribed Image Text:
function [q, ea, iter] =romberg (func, a, b, es, maxit, varargin)
romberg: Romberg integration quadrature
q = romberg (func, a, b, es, maxit, p1, p2, ...):
Romberg integration.
8
f
& input:
8
func = name of function to be integrated
a, b = integration limits
8
es = desired relative error (default = 0.000001%)
& maxit = maximum allowable iterations (default = 30)
8
&
pl, p2, ... = additional parameters used by func
& output:
용 q= integral estimate
8
8
ea = approximate relative error (8)
iter = number of iterations
if nargin<3, error('at least 3 input arguments required'), end
if nargin<4|isempty (es), es=0.000001; end
if nargin<5|isempty (maxit), maxit=50; end
n = 1;
I (1,1)= trap (func, a, b, n, varargin{:});
iter = 0;
while iter
function [q, ea, iter] =romberg (func, a, b, es, maxit, varargin)
romberg: Romberg integration quadrature
q = romberg (func, a, b, es, maxit, p1, p2, ...):
Romberg integration.
8
f
& input:
8
func = name of function to be integrated
a, b = integration limits
8
es = desired relative error (default = 0.000001%)
& maxit = maximum allowable iterations (default = 30)
8
&
pl, p2, ... = additional parameters used by func
& output:
용 q= integral estimate
8
8
ea = approximate relative error (8)
iter = number of iterations
if nargin<3, error('at least 3 input arguments required'), end
if nargin<4|isempty (es), es=0.000001; end
if nargin<5|isempty (maxit), maxit=50; end
n = 1;
I (1,1)= trap (func, a, b, n, varargin{:});
iter = 0;
while iter
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 66% (6 reviews)
Answered By
Nicholas Maina
Throughout my tutoring journey, I've amassed a wealth of hands-on experience and honed a diverse set of skills that enable me to guide students towards mastering complex subjects. My proficiency as a tutor rests on several key pillars:
1. Subject Mastery:
With a comprehensive understanding of a wide range of subjects spanning mathematics, science, humanities, and more, I can adeptly explain intricate concepts and break them down into digestible chunks. My proficiency extends to offering real-world applications, ensuring students grasp the practical relevance of their studies.
2. Individualized Guidance:
Recognizing that every student learns differently, I tailor my approach to accommodate various learning styles and paces. Through personalized interactions, I identify a student's strengths and areas for improvement, allowing me to craft targeted lessons that foster a deeper understanding of the material.
3. Problem-Solving Facilitation:
I excel in guiding students through problem-solving processes and encouraging critical thinking and analytical skills. By walking learners through step-by-step solutions and addressing their questions in a coherent manner, I empower them to approach challenges with confidence.
4. Effective Communication:
My tutoring proficiency is founded on clear and concise communication. I have the ability to convey complex ideas in an accessible manner, fostering a strong student-tutor rapport that encourages open dialogue and fruitful discussions.
5. Adaptability and Patience:
Tutoring is a dynamic process, and I have cultivated adaptability and patience to cater to evolving learning needs. I remain patient through difficulties, adjusting my teaching methods as necessary to ensure that students overcome obstacles and achieve their goals.
6. Interactive Learning:
Interactive learning lies at the heart of my approach. By engaging students in discussions, brainstorming sessions, and interactive exercises, I foster a stimulating learning environment that encourages active participation and long-term retention.
7. Continuous Improvement:
My dedication to being an effective tutor is a journey of continuous improvement. I regularly seek feedback and stay updated on educational methodologies, integrating new insights to refine my tutoring techniques and provide an even more enriching learning experience.
In essence, my hands-on experience as a tutor equips me with the tools to facilitate comprehensive understanding, critical thinking, and academic success. I am committed to helping students realize their full potential and fostering a passion for lifelong learning.
4.90+
5+ Reviews
16+ Question Solved
Related Book For
Applied Numerical Methods With MATLAB For Engineers And Scientists
ISBN: 9781259027437
3rd Edition
Authors: Steven C. Chapra
Question Posted:
Students also viewed these Mathematics questions
-
Fig 22.3: Use Romberg integration to evaluate dx to an accuracy of s = 0.5% based on Eq. (22.9). Your results should be presented in the form of Fig. 22.3. Use the analytical solution of the integral...
-
Use Romberg integration to evaluate to an accuracy of s = 0.5%. Your results should be presented in the form of Figure. Use the analytical solution of the integral to determine the percent relative...
-
Develop a user-friendly computer program for Romberg integration based on Figure. Test it by duplicating the results of Examples 22.3 and 22.4 and the function in Prob. 22.10.
-
Why is it likely to have preexisting normal faults in an orogenic belt?
-
In Problem 12.7 on page 424, you used the plate gap on the bag sealing equipment to predict the tear rating of a bag of coffee (stored in Starbucks). Using the results of that problem, a. determine...
-
An industrial process involves evaporation of a thin water film from a contoured surface by heating it from below and forcing air across it. Laboratory measurements for this surface have provided the...
-
Pew Research Center collected data on the same 10 political value questions from 1994 to 2014 and combines these responses to place each person on a scale ranging from consistently liberal to...
-
Frozen Delight, Inc. charges an initial franchise fee of $75,000 for the right to operate as a franchisee of Frozen Delight. Of this amount, $25,000 is collected immediately. The remainder is...
-
What is the net income for this period and total assets on this balance sheet Use the following adjusted trial balance to answer questions 22-25. Cash $ 6,530 Accounts Receivable 2,450 Prepaid...
-
Develop an M-file function that computes first and second derivative estimates of order O(h 2 ) based on the formulas in Figs. 21.3 through 21.5. The functions first line should be set up as function...
-
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....
-
An athlete executing a long jump leaves the ground at a 28.0o angle and travels 7.80m. (a) What was the takeoff speed? (b) If this speed were increased by just 5.0%, how much longer would the jump be?
-
Assume fixed cost = $20,000 and variable cost per unit = $7.50. At what price will the firm achieve break-even point if expected sales volume (in units) equals 10,000 units? At what price will the...
-
At the end of t years, the future value of an investment of $42,500 in an account that pays 12% compounded monthly is S=42,500 1 + 500 (1+0.12) 12 future value of the investment be more than...
-
Given that the weekly incomes of the accountants in an accounting firm at Botswana follows a normal distribution with a mean of 2,000 and a standard deviation of 500. 1) Calculate the probability of...
-
A power plant burns natural gas to generate 740 MW of electricity with 42% efficiency. 88% of the waste heat is removed by cooling water. The natural gas has a heat content of 49,000 kJ/kg. a. How...
-
Two radar stations located 20 miles apart detect an aircraft between them. The angle of elevation measured by the 1st station is 35, whereas the angle of elevation measured by the 2nd, is 15....
-
Download the daily S&P5001ndex from January 2, 2006, and continuing to the most recent date. Let P, denote the SP500 time series and pt = In (P1). a. Compute the daily return (i.e., Rt = pt = pt1)....
-
In Exercises evaluate the limit, using LHpitals Rule if necessary. lim 07x cos x X
-
Recompute the regression fits from Probs. (a) 17.4, and (b) 17.15, using the matrix approach. Estimate the standard errors and develop 90% confidence intervals for the coefficients.
-
Develop, debug, and test a program in either a high-level language or macro language of your choice to implement linear regression. Among other things: (a) Include statements to document the code,...
-
A material is tested for cyclic fatigue failure whereby a stress, in MPa, is applied to the material and the number of cycles needed to cause failure is measured. The results are in the table below....
-
Given the information below answer the questions. Depreciation Expense-Building 12,000 12,000 Repairs Expense 8,850 8,850 feedba Depreciation Expense-Equipment 4,800 4,800 Insurance Expense 3,150...
-
Bond A: 10% (annual) coupon rate with semiannual payments, 5 years to maturity Bond B: 4% (annual) coupon rate with semiannual payments, 20 years to maturity Exhibit 1: Bond Price vs. Yield to...
-
You are choosing between two projects. The cash flows for the projects are given in the following table ($ million): Project A B Year 0 - $50 -$99 a. What are the IRRS of the two projects? b. If your...
Study smarter with the SolutionInn App