3.1. Complete, by hand, the VBA function that adds one increment of time DELTA_T for each...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
3.1. Complete, by hand, the VBA function that adds one increment of time DELTA_T for each cycle of a loop until the total time reaches P*DELTA_T, where P is a whole number greater than 1. DELTA_T and P values are user-provided input. The code is to report the final value back to the spreadsheet. Function sum_deltas(P, DELTA_T) Z = O For j = 1 To P DELTA_T P DELTA_T*P ROUNDING ERROR 0.4 10 0.4 20000 0.4 40000 0.4 60000 0.4 80000 0.4 100000 Next j sum deltas = Z End Function ollolol 0.5 10 0.5 20000 0.5 40000 0.5 60000 0.5 80000 0.5 100000 0.6 10 0.6 20000 0.6 40000 0.6 60000 0.6 80000 0.6 100000 3.2. a. Write VBA code similar to that of #3.1 but in an actual VBA module. Also, within the argument list for the function in the first line, write "DELTA_T As Single" instead of just "DELTA_T". Also, choose a different name for the function, and adjust the code accordingly. Then, use "click and drag" and relative cell addresses to complete the 3rd column in the table at the right. Show the error in the fourth column by comparing the result in the third column with the exactly correct values. Show the absolute error as opposed to the relative error. Show this error to the nearest thousandth (i.e., the 3rd decimal place), but do not use scientific notation. b. Create an adequately labeled grayscale chart in Excel in which "ROUNDING ERROR" is plotted against P for DELTA T = 0.4, 0.5, and 0.6. Clearly distinguish between the three curves with a legend. C. In general, what happens to the magnitude of the rounding error as the number of operations increases? d. Why is the rounding error always 0 for DELTA_T = 0.5? What do you think the plot of the error would look like for DELTA T = 0.25, and 0.125, and 0.75? e. In this exercise, many operations are executed, but the operation is always addition and with the same number. How easy do you think it would be to predict the sign and magnitude of the rounding error when there are many diverse operations involving a variety of numbers? f. Suppose P*DELTA_T were to be the input for a function G having a condition number of 24. If P*DELTA_T has the error shown in the lower right corner of your table, what would be the percent error in the function G? 3.1. Complete, by hand, the VBA function that adds one increment of time DELTA_T for each cycle of a loop until the total time reaches P*DELTA_T, where P is a whole number greater than 1. DELTA_T and P values are user-provided input. The code is to report the final value back to the spreadsheet. Function sum_deltas(P, DELTA_T) Z = O For j = 1 To P DELTA_T P DELTA_T*P ROUNDING ERROR 0.4 10 0.4 20000 0.4 40000 0.4 60000 0.4 80000 0.4 100000 Next j sum deltas = Z End Function ollolol 0.5 10 0.5 20000 0.5 40000 0.5 60000 0.5 80000 0.5 100000 0.6 10 0.6 20000 0.6 40000 0.6 60000 0.6 80000 0.6 100000 3.2. a. Write VBA code similar to that of #3.1 but in an actual VBA module. Also, within the argument list for the function in the first line, write "DELTA_T As Single" instead of just "DELTA_T". Also, choose a different name for the function, and adjust the code accordingly. Then, use "click and drag" and relative cell addresses to complete the 3rd column in the table at the right. Show the error in the fourth column by comparing the result in the third column with the exactly correct values. Show the absolute error as opposed to the relative error. Show this error to the nearest thousandth (i.e., the 3rd decimal place), but do not use scientific notation. b. Create an adequately labeled grayscale chart in Excel in which "ROUNDING ERROR" is plotted against P for DELTA T = 0.4, 0.5, and 0.6. Clearly distinguish between the three curves with a legend. C. In general, what happens to the magnitude of the rounding error as the number of operations increases? d. Why is the rounding error always 0 for DELTA_T = 0.5? What do you think the plot of the error would look like for DELTA T = 0.25, and 0.125, and 0.75? e. In this exercise, many operations are executed, but the operation is always addition and with the same number. How easy do you think it would be to predict the sign and magnitude of the rounding error when there are many diverse operations involving a variety of numbers? f. Suppose P*DELTA_T were to be the input for a function G having a condition number of 24. If P*DELTA_T has the error shown in the lower right corner of your table, what would be the percent error in the function G?
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
For the increasing marginal-extraction-cost model of the allocation of a depletable resource, how would the ultimate cumulative amount taken out of the ground be affected by (a) An increase in the...
-
Work Problem 8.24 with the following turbine reheat intercept pressure: a) 200 kPa and b) 600 kPa. An ideal Rankine power cycle with reheat is shown in Fig. 8.33. Steam leaves the boiler at 8 MPa and...
-
Benny purchased $400,000 of Peach Corporation face value bonds for $320,000 on November 13, 2020. The bonds had been issued with $80,000 of original issue discount because Peach was in financial...
-
List three ways to get input from the console and convert that input to the desired data type.
-
1. Could Tony be right? Are employees defrauding the company, or has the Russian Roulette finally bit the bullet? 2. What possible fraud activities are associated with declining cash flows? Mikos...
-
Briefly list the major administration tasks you can handle to manage a database in cloud. . QUESTION 12 List the major components of email system. QUESTION 13 In a job interview, you are...
-
It is not possible to know what is possible, says Frances Moore Lappe, author of the bestseller Diet for a Small Planet and eighteen other books on hunger, poverty, and environmental crises. The...
-
Guitano, age 67, is concerned about retirement income for his spouse, Marianne, age 66, should he predecease her. He currently receives 100% of the maximum CPP retirement pension. Marianne has a CPP...
-
Two tempered-steel bars, each 3/16 in. thick, are bonded to a 1/2-in. mild-steel bar. This composite bar is subjected as shown to a centric axial load of magnitude P. Both steels are elastoplastic...
-
Dave and Kathy, both age 58, own and operate an antique shop that they plan to run it for as long as possible and then pass along to the family. The business is worth $500,000 and the couple's other...
-
You make a one-time investment of pre-income-tax funds of $5,000 in each of the following accounts for 35 years, earning 10% per year. Assume that all your tax rates stay at 20% over time. How much...
-
58. Allyza is employed in JBC Corporation. She has the following for the current year: Statutory minimum wage Overtime pay Night-shift differential Commission from the same employer Total How much is...
-
Discuss the 4Ps of the Marketing Mix. Which do you consider to be most important?
-
Highland Theatre is owned by Finnean Ferguson. At June 30, 2014, the ledger showed the following: Cash, $6,000; Land, $100,000; Buildings, $80,000; Equipment, $25,000; Accounts Payable, $5,000;...
-
Clarita is a single taxpayer with two dependent children, ages 10 and 12. Clarita pays $3,000 in qualified child care expenses during the year. If her adjusted gross income (all from wages) for the...
-
Dr. George E. Beeper is a single taxpayer. He lives at 45 Mountain View Dr., Apt. 321, Spokane, WA 99210. Dr. Beeper's Social Security number is 775-88-9531. Dr. Beeper works for the Pine Medical...
-
Laura is a single taxpayer living in New Jersey with adjusted gross income for the 2012 tax year of $35,550. Laura's employer withheld $3,300 in state income tax from her salary. In April of 2012,...
-
Explain how corporations provide limited liability to their owners.
-
What are the goals of the Financial Services Authority in the United Kingdom?
-
Alder, Svingos, and Shaw owned an equal number of shares in a corporation that was organized to run a restaurant. They entered into a shareholders agreement that provided, among other things, that...
Study smarter with the SolutionInn App