Problem 2 (15 points) (Core Course Outcomes 5 & 11)/MatlabGrader Consider the function f(x) = cos(x), where the argument is in radians, and its analytical second derivative d² dx2 f(x) = c - cos(x) defined on the interval 1 ≤ x ≤ 40 evaluated at Mk + 1 equally spaced points x; where Mk = 2. Use function mySecond Derivative Order 3 to calculate the error e; of the finite difference approximation of d² f/dx² at each point xi. 7,8,9,..., 20, 21, plot the entry-wise 3-norm Lk of the error e; (see Exam 2) as a function of hk using a logarithmic For k scale for both Lk and hk. Notes for the MatlabGrader script submission: • Comment out clear or clear all in your script when submitting to MatlabGrader. • Generate and store the figure handle examFigl for the graph before doing any plotting commands, using examFigl = figure (1); • Properly label both axis using the appropriate variable names (h, L). • Do not include the source code for any functions in your script submission. Necessary functions are provided on Matlab- Grader. Required submission: ☐ well commented script source code submitted to Matlab Grader using the Canvas link for Exam 5 - Problem 2 Problem 3 (15 points) (Core Course Outcomes 1, 4 & 12) For problem 2 reporting results with at least 5 significant digits, a) calculate and report (=print) the order of accuracy p using linear least squares regression for the entire range of hk values where truncation errors dominate. Give (=print) the range of k values used for the fit, i.e., the minimum and maximum k values used for the fit. b) calculate and report (=print) the order of accuracy p using linear least squares regression for the entire range of hk values where round-off errors dominates. Give (=print) the range of k values used for the fit, i.e., the minimum and maximum k values used for the fit. You do not have to determine the ranges of k values for a) and b) automatically in code, but can determine them from the graph of problem 2 and then set them in your script. Required submission: ☐ well commented script source code included in your Gradescope submission; ☐ printout of requested results in your Gradescope submission;

Elements Of Electromagnetics
7th Edition
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Sadiku, Matthew N. O.
ChapterMA: Math Assessment
Section: Chapter Questions
Problem 1.1MA
icon
Related questions
Question
Problem 2 (15 points) (Core Course Outcomes 5 & 11)/MatlabGrader
Consider the function
f(x) = cos(x),
where the argument is in radians, and its analytical second derivative
d²
dx2
f(x) = c
- cos(x)
defined on the interval 1 ≤ x ≤ 40 evaluated at Mk + 1 equally spaced points x; where Mk = 2. Use function
mySecond Derivative Order 3 to calculate the error e; of the finite difference approximation of d² f/dx² at each point xi.
7,8,9,..., 20, 21, plot the entry-wise 3-norm Lk of the error e; (see Exam 2) as a function of hk using a logarithmic
For k
scale for both Lk and hk.
Notes for the MatlabGrader script submission:
• Comment out clear or clear all in your script when submitting to MatlabGrader.
• Generate and store the figure handle examFigl for the graph before doing any plotting commands, using
examFigl = figure (1);
• Properly label both axis using the appropriate variable names (h, L).
• Do not include the source code for any functions in your script submission. Necessary functions are provided on Matlab-
Grader.
Required submission:
☐ well commented script source code submitted to Matlab Grader using the Canvas link for Exam 5 - Problem 2
Problem 3 (15 points) (Core Course Outcomes 1, 4 & 12)
For problem 2 reporting results with at least 5 significant digits,
a) calculate and report (=print) the order of accuracy p using linear least squares regression for the entire range of hk values where
truncation errors dominate. Give (=print) the range of k values used for the fit, i.e., the minimum and maximum k values used
for the fit.
b) calculate and report (=print) the order of accuracy p using linear least squares regression for the entire range of hk values where
round-off errors dominates. Give (=print) the range of k values used for the fit, i.e., the minimum and maximum k values used
for the fit.
You do not have to determine the ranges of k values for a) and b) automatically in code, but can determine them from the graph of
problem 2 and then set them in your script.
Required submission:
☐ well commented script source code included in your Gradescope submission;
☐ printout of requested results in your Gradescope submission;
Transcribed Image Text:Problem 2 (15 points) (Core Course Outcomes 5 & 11)/MatlabGrader Consider the function f(x) = cos(x), where the argument is in radians, and its analytical second derivative d² dx2 f(x) = c - cos(x) defined on the interval 1 ≤ x ≤ 40 evaluated at Mk + 1 equally spaced points x; where Mk = 2. Use function mySecond Derivative Order 3 to calculate the error e; of the finite difference approximation of d² f/dx² at each point xi. 7,8,9,..., 20, 21, plot the entry-wise 3-norm Lk of the error e; (see Exam 2) as a function of hk using a logarithmic For k scale for both Lk and hk. Notes for the MatlabGrader script submission: • Comment out clear or clear all in your script when submitting to MatlabGrader. • Generate and store the figure handle examFigl for the graph before doing any plotting commands, using examFigl = figure (1); • Properly label both axis using the appropriate variable names (h, L). • Do not include the source code for any functions in your script submission. Necessary functions are provided on Matlab- Grader. Required submission: ☐ well commented script source code submitted to Matlab Grader using the Canvas link for Exam 5 - Problem 2 Problem 3 (15 points) (Core Course Outcomes 1, 4 & 12) For problem 2 reporting results with at least 5 significant digits, a) calculate and report (=print) the order of accuracy p using linear least squares regression for the entire range of hk values where truncation errors dominate. Give (=print) the range of k values used for the fit, i.e., the minimum and maximum k values used for the fit. b) calculate and report (=print) the order of accuracy p using linear least squares regression for the entire range of hk values where round-off errors dominates. Give (=print) the range of k values used for the fit, i.e., the minimum and maximum k values used for the fit. You do not have to determine the ranges of k values for a) and b) automatically in code, but can determine them from the graph of problem 2 and then set them in your script. Required submission: ☐ well commented script source code included in your Gradescope submission; ☐ printout of requested results in your Gradescope submission;
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Elements Of Electromagnetics
Elements Of Electromagnetics
Mechanical Engineering
ISBN:
9780190698614
Author:
Sadiku, Matthew N. O.
Publisher:
Oxford University Press
Mechanics of Materials (10th Edition)
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:
9780134319650
Author:
Russell C. Hibbeler
Publisher:
PEARSON
Thermodynamics: An Engineering Approach
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:
9781259822674
Author:
Yunus A. Cengel Dr., Michael A. Boles
Publisher:
McGraw-Hill Education
Control Systems Engineering
Control Systems Engineering
Mechanical Engineering
ISBN:
9781118170519
Author:
Norman S. Nise
Publisher:
WILEY
Mechanics of Materials (MindTap Course List)
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:
9781337093347
Author:
Barry J. Goodno, James M. Gere
Publisher:
Cengage Learning
Engineering Mechanics: Statics
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:
9781118807330
Author:
James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:
WILEY