Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN: 9781337508841
Author: Carey
Publisher: Cengage
expand_more
expand_more
format_list_bulleted
Question
I need help with question 5 and 6, I need the code to pass the required steps in Matlab Grader. Thank You!
![non-programmable calculator or script/functions coded in this class to help in verifying the numerical results of individual steps;
- on Gradescope associate/select your answer pages with the corresponding problem numbers. Failure to do so may result in
no points given initially and will require a re-grade request to fix;
- if the problem header contains MatlabGrader, you must submit your code to Matlab Grader using the Exam - Problem link
available in the Canvas Module;
point scores received for MatlabGrader problems during the exam are provisional and may change even after the deadline in
case the MatlabGrader assessment codes contain bugs;
-point scores you may see on Canvas after submission of Canvas multiple choice answers are arbitrary and may not reflect your
graded final score for such problems;
if a problem requires submission of a printout, submit a pdf of your source code and results. Do not submit a picture/screen
capture of your screen. No credit will be given in that case. See Module 0 on Canvas for a how-to.
- only use functions developed in this class to solve the exam problems. If an equivalent build-in Matlab function is used
for a function developed in this class, no credit will be given.
- brute force searches are neither acceptable nor a numerical method in this class and therefore will give no credit.
- to earn credit, your solution must contain all steps used to determine the solution. This includes all code (functions) not previously
submitted in homework or exam problems to determine the solution.
- answers given in code will not receive credit.
- exam bonus problems give bonus points for the indicated exam and additional opportunities to demonstrate core outcome mastery.
However, a module's exam score is capped at 100%;
Problem 1 (5 points, CCOs #5, 10)/Gradescope
The temperature of a fluid in a pipe of length L can be described by the following 1D non-dimensional equation
эт
Ət
эт
= =U + a(T).
მე
a²T
მ2
+Q(x,t)
(1)
with time t, temperature T, constant velocity u, temperature dependent thermal diffusivity a(T), and a source term describing
additional heating/cooling along the pipe, Q(x, t). On the left end, the fluid entering the pipe has a prescribed temperature of
T(x =0,t) = 5 - 4 sin
20πT
11
On the right end of the pipe, the fluid leaving the pipe has a prescribed temperature gradient,
ᎧᎢ
4π
მე:
(x = L,t) = -2 - 3 sin
5
At t = 0 the temperature of the fluid in the pipe is
T(x, t = 0) = 5
The thermal diffusivity of the rod can be modeled by a third-degree polynomial
a(T) ao a₁T+α₂T² +α3T³.
(2)
(3)
(4)
(5)
For a grid of M + 1 equally spaced points along the rod and Ax the spacing between points, do the following tasks:
a) write the equation for the temperature at the first point T = ... using Eq. (2);
b) write the equation for the temperature at the last point T+1 = ... as a function of the neighboring points using a third order
accurate finite difference approximation to Eq. (3). Potential third-order finite difference formulas using the notation of Table
8.1 are:
-2f(x-3)+9f(xi-2) - 18f (xi-1)+11f(xi))
f'(xi)
f'(xi)
+ O(Ax³)
6Ax
f(xi-2) - 6f(xi-1)+3f(xi) +2f(xi+1)
+ O(Ax³)
6Ax
-2f(x-1)-3f(xi) +6f(xi+1) − f(xi+2)
f'(xi)
=
+ O(Ax³)
6Ax
f'(xi)
=
−11f(xi) + 18f(xi+1) − 9f (xi+2) + 2f (xi+3) + O(Ax³)
6Ax
1
(6)
(7)
(8)
(9)
c) at all non-boundary mesh points i, using second-order central finite differences write the equation for the right-hand-side fr
of Eq. (1), incorporating Eq. (5), leaving Q(x, t) as Q(xi, t") or Q. Use only the above variable names and not any specific
parameter values given in later problems.
d) write the equation for the initial temperature at every interior point T =...
In all answers do not forget the superscript where appropriate, e.g., n, to indicate the discrete time level and the sub-script
to indicate the appropriate location, e.g., i. No points will be awarded if these are missing or wrong.
Required submission:
handwritten or typeset answers using the correct variable names and all sub- and superscripts submitted to Gradescope
Problem 2 (3 points)/MatlabGrader
Develop a Matlab function myBCE 9 that applies the boundary conditions of problem 1 tasks a)-b) to the dependent variable T. The
function input shall be
t: scalar value of time t
• T: column vector of temperature values T at all M + 1 mesh points at time t
The function output shall be
⚫ T: column vector of temperature T at all M + 1 mesh points at time t with the boundary conditions applied
The function shall use the following global variable
• dx: grid spacing Ax
Do not set values for global variables inside the function.
Required submission:
☐ well commented function source code submitted to Matlab Grader using the Canvas link for Exam 9 - Problem 2
Problem 3 (4 points)/MatlabGrader
Develop a Matlab function myRHSE9 that calculates the right hand side of Eq. (1) at every interior mesh point according to problem
1 task c).
The function input shall be
⚫ t: scalar value of time t
• T: column vector of temperature values T at all M + 1 mesh points at time t
The function output shall be
⚫ f: column vector for all M + 1 mesh points containing the right-hand side values of Eq. (1) in the interior of the mesh and
zero on the boundaries.
The function shall use the following global variables
• dx: grid spacing Ax
• x: column vector of grid point coordinates
⚫u: scalar value of velocity u
• a: column vector containing ao to a3 (see Eq. (5))
⚫ Q: anonymous function for Q(x, t)
Do not set values for global variables inside the function. Apply boundary conditions by calling my BCE 9 before calculating f.
Required submission:
☐ well commented function source code submitted to Matlab Grader using the Canvas link for Exam 9 - Problem 3
Problem 4 (4 points, CCOs #2 & #234)/MatlabGrader
To determine the model constants ao to aз in Eq. (5), a series of measurements of a as a function of T is taken. The measured
data is available on Canvas in the MAT file data.mat that must be copied into your working directory and loaded using the
Matlab command load("data.mat"); This loads the Matlab column vector variables Texp and alphaExp containing 800
measured data pairs (T, a). Calculate ao to a3 in Eq. (5) that best fit the measured data and store the results in the global column
vector variable a. If you are unable to complete this task, use a = [0.2; 0.2; -0.01; -0.0002]; in the following problems.
Note: the MatlabGrader assessments for this problem use random data contained in the .mat file. Functions developed in this class
required to solve this problem are provided on Matlab Grader. These can be called in your script, but their source code should not
be included in your problem submission.
Required submission:
☐ well commented script source code submitted to Matlab Grader using the Canvas link for Exam 9 - Problem 4
values of ao to a4 stored in the global column vector a
2
Problem 5 (20 points, CCOs #5, 8, 10, 11, 12)/ MatlabGrader
For
3
5π
Q(x,t) = 2+ cos(3πt) cos(
"
(10)
L = 4, M = 80, u = 4.8, and At = 16Ax², calculate and graph the solution of Eq. (1), T(x, t), at t = 0,1, 2, 3, 4, and 5 in one
figure, and at t = 6, 7, 8, 9, and 10 in a second figure. Do not use subfigures. In a third figure, plot T(x = L, t) as a function of t.
Recall that all global variables used in functions, e.g., see Problem 3, must be declared global and set to their respective values in
the script. You must use the third-order Runge-Kutta method from Exam 8 to solve this problem.
Notes for the MatlabGrader script submission:
• Comment out clear or clear all in your script when submitting to MatlabGrader.
• Generate and store the figure handles examFigl, examFig2, and examFig3 for the requested 3 figures before doing
any plot commands, using examFigl = figure (1); etc.
•
Properly label all axis using the appropriate variable names, e.g., (x, T), respective (t,T(x = L, t)).
• Inlcude legends in the first 2 figures listing the times t of each line.
• Do not include the source code for any functions in your script submission. Necessary functions are provided on Matlab-
Grader.
• Start your script code from scratch and do not try to modify the recitation codes.
⚫ The script submitted to this problem must contain the script portion from problem 4 calculating the global variable a or
setting the alternate values given there.
Required submission:](https://content.bartleby.com/qna-images/question/27c0385d-5521-4276-95c3-f5add10125cc/5800781e-0289-4983-90b1-95c6defcfe9a/eamwgt_thumbnail.jpeg)
Transcribed Image Text:non-programmable calculator or script/functions coded in this class to help in verifying the numerical results of individual steps;
- on Gradescope associate/select your answer pages with the corresponding problem numbers. Failure to do so may result in
no points given initially and will require a re-grade request to fix;
- if the problem header contains MatlabGrader, you must submit your code to Matlab Grader using the Exam - Problem link
available in the Canvas Module;
point scores received for MatlabGrader problems during the exam are provisional and may change even after the deadline in
case the MatlabGrader assessment codes contain bugs;
-point scores you may see on Canvas after submission of Canvas multiple choice answers are arbitrary and may not reflect your
graded final score for such problems;
if a problem requires submission of a printout, submit a pdf of your source code and results. Do not submit a picture/screen
capture of your screen. No credit will be given in that case. See Module 0 on Canvas for a how-to.
- only use functions developed in this class to solve the exam problems. If an equivalent build-in Matlab function is used
for a function developed in this class, no credit will be given.
- brute force searches are neither acceptable nor a numerical method in this class and therefore will give no credit.
- to earn credit, your solution must contain all steps used to determine the solution. This includes all code (functions) not previously
submitted in homework or exam problems to determine the solution.
- answers given in code will not receive credit.
- exam bonus problems give bonus points for the indicated exam and additional opportunities to demonstrate core outcome mastery.
However, a module's exam score is capped at 100%;
Problem 1 (5 points, CCOs #5, 10)/Gradescope
The temperature of a fluid in a pipe of length L can be described by the following 1D non-dimensional equation
эт
Ət
эт
= =U + a(T).
მე
a²T
მ2
+Q(x,t)
(1)
with time t, temperature T, constant velocity u, temperature dependent thermal diffusivity a(T), and a source term describing
additional heating/cooling along the pipe, Q(x, t). On the left end, the fluid entering the pipe has a prescribed temperature of
T(x =0,t) = 5 - 4 sin
20πT
11
On the right end of the pipe, the fluid leaving the pipe has a prescribed temperature gradient,
ᎧᎢ
4π
მე:
(x = L,t) = -2 - 3 sin
5
At t = 0 the temperature of the fluid in the pipe is
T(x, t = 0) = 5
The thermal diffusivity of the rod can be modeled by a third-degree polynomial
a(T) ao a₁T+α₂T² +α3T³.
(2)
(3)
(4)
(5)
For a grid of M + 1 equally spaced points along the rod and Ax the spacing between points, do the following tasks:
a) write the equation for the temperature at the first point T = ... using Eq. (2);
b) write the equation for the temperature at the last point T+1 = ... as a function of the neighboring points using a third order
accurate finite difference approximation to Eq. (3). Potential third-order finite difference formulas using the notation of Table
8.1 are:
-2f(x-3)+9f(xi-2) - 18f (xi-1)+11f(xi))
f'(xi)
f'(xi)
+ O(Ax³)
6Ax
f(xi-2) - 6f(xi-1)+3f(xi) +2f(xi+1)
+ O(Ax³)
6Ax
-2f(x-1)-3f(xi) +6f(xi+1) − f(xi+2)
f'(xi)
=
+ O(Ax³)
6Ax
f'(xi)
=
−11f(xi) + 18f(xi+1) − 9f (xi+2) + 2f (xi+3) + O(Ax³)
6Ax
1
(6)
(7)
(8)
(9)
c) at all non-boundary mesh points i, using second-order central finite differences write the equation for the right-hand-side fr
of Eq. (1), incorporating Eq. (5), leaving Q(x, t) as Q(xi, t") or Q. Use only the above variable names and not any specific
parameter values given in later problems.
d) write the equation for the initial temperature at every interior point T =...
In all answers do not forget the superscript where appropriate, e.g., n, to indicate the discrete time level and the sub-script
to indicate the appropriate location, e.g., i. No points will be awarded if these are missing or wrong.
Required submission:
handwritten or typeset answers using the correct variable names and all sub- and superscripts submitted to Gradescope
Problem 2 (3 points)/MatlabGrader
Develop a Matlab function myBCE 9 that applies the boundary conditions of problem 1 tasks a)-b) to the dependent variable T. The
function input shall be
t: scalar value of time t
• T: column vector of temperature values T at all M + 1 mesh points at time t
The function output shall be
⚫ T: column vector of temperature T at all M + 1 mesh points at time t with the boundary conditions applied
The function shall use the following global variable
• dx: grid spacing Ax
Do not set values for global variables inside the function.
Required submission:
☐ well commented function source code submitted to Matlab Grader using the Canvas link for Exam 9 - Problem 2
Problem 3 (4 points)/MatlabGrader
Develop a Matlab function myRHSE9 that calculates the right hand side of Eq. (1) at every interior mesh point according to problem
1 task c).
The function input shall be
⚫ t: scalar value of time t
• T: column vector of temperature values T at all M + 1 mesh points at time t
The function output shall be
⚫ f: column vector for all M + 1 mesh points containing the right-hand side values of Eq. (1) in the interior of the mesh and
zero on the boundaries.
The function shall use the following global variables
• dx: grid spacing Ax
• x: column vector of grid point coordinates
⚫u: scalar value of velocity u
• a: column vector containing ao to a3 (see Eq. (5))
⚫ Q: anonymous function for Q(x, t)
Do not set values for global variables inside the function. Apply boundary conditions by calling my BCE 9 before calculating f.
Required submission:
☐ well commented function source code submitted to Matlab Grader using the Canvas link for Exam 9 - Problem 3
Problem 4 (4 points, CCOs #2 & #234)/MatlabGrader
To determine the model constants ao to aз in Eq. (5), a series of measurements of a as a function of T is taken. The measured
data is available on Canvas in the MAT file data.mat that must be copied into your working directory and loaded using the
Matlab command load("data.mat"); This loads the Matlab column vector variables Texp and alphaExp containing 800
measured data pairs (T, a). Calculate ao to a3 in Eq. (5) that best fit the measured data and store the results in the global column
vector variable a. If you are unable to complete this task, use a = [0.2; 0.2; -0.01; -0.0002]; in the following problems.
Note: the MatlabGrader assessments for this problem use random data contained in the .mat file. Functions developed in this class
required to solve this problem are provided on Matlab Grader. These can be called in your script, but their source code should not
be included in your problem submission.
Required submission:
☐ well commented script source code submitted to Matlab Grader using the Canvas link for Exam 9 - Problem 4
values of ao to a4 stored in the global column vector a
2
Problem 5 (20 points, CCOs #5, 8, 10, 11, 12)/ MatlabGrader
For
3
5π
Q(x,t) = 2+ cos(3πt) cos(
"
(10)
L = 4, M = 80, u = 4.8, and At = 16Ax², calculate and graph the solution of Eq. (1), T(x, t), at t = 0,1, 2, 3, 4, and 5 in one
figure, and at t = 6, 7, 8, 9, and 10 in a second figure. Do not use subfigures. In a third figure, plot T(x = L, t) as a function of t.
Recall that all global variables used in functions, e.g., see Problem 3, must be declared global and set to their respective values in
the script. You must use the third-order Runge-Kutta method from Exam 8 to solve this problem.
Notes for the MatlabGrader script submission:
• Comment out clear or clear all in your script when submitting to MatlabGrader.
• Generate and store the figure handles examFigl, examFig2, and examFig3 for the requested 3 figures before doing
any plot commands, using examFigl = figure (1); etc.
•
Properly label all axis using the appropriate variable names, e.g., (x, T), respective (t,T(x = L, t)).
• Inlcude legends in the first 2 figures listing the times t of each line.
• Do not include the source code for any functions in your script submission. Necessary functions are provided on Matlab-
Grader.
• Start your script code from scratch and do not try to modify the recitation codes.
⚫ The script submitted to this problem must contain the script portion from problem 4 calculating the global variable a or
setting the alternate values given there.
Required submission:

Transcribed Image Text:Problem 5: PDE solution
see pdf.
Important
■ Make sure you define ALL global variables in your script, i.e., declare them as global and set their value, including the anonymous function Q!
■ If you time out, make sure you are calculating the solution only once!
■ Make sure to use the correct initial condition from the updated assignment pdf: T(x, t = 0) = 5
■ The notes for problem 5 listed the y-axis label as T(x=0,t), but the problem requests plotting T(x=L,t) in figure 3. Thus please use T(x=L,t) as the y-axis label.
■ Recall: boundary conditions take precedent over initial conditions. Thus you have to apply boundary conditions after setting the initial conditions.
My Solutions >
■ The Matlab Grader assessments for this problem are very "absolutist": to pass an assessment, the entire result must be correct, i.e., even if a single result point/value is
incorrect, you likely will be unable to pass an assessment. The final grading for this problem likely will include "partial credit" for some assessments to account for "minor"
mistakes. It's impossible to account for these beforehand, since there are way too many ways to make such mistakes. I will analyze failing codes when doing the final
grading for this problem to account for such "minor" mistakes. (That's the long explanation for the statement in bold under Required submission for this problem).
Script
1
Assessment:
clear is not used
no function definitions in script
variables examFig1, examFig2, examFig3 exist
solution figures 1 & 2 axis labels
solution figure 3 axis labels
legend used
solutions in figure 1 correct
solutions in figure 2 correct
solution in figure 3 correct
figure 3 from t=0 to t=10 with initial boundary conditions?
眉 Save
CReset
MATLAB Documentation
Open Problem in MATLAB Online
Run Script
Submit
?
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps

Knowledge Booster
Similar questions
- (Civil eng.) Write an assignment statement to determine the maximum bending moment, M, of a beam, given this formula: M=XW(LX)L X is the distance from the end of the beam that a weight, W, is placed. L is the length of the beam.arrow_forward(Data processing) Your professor has asked you to write a C++ program that determines grades at the end of the semester. For each student, identified by an integer number between 1 and 60, four exam grades must be kept, and two final grade averages must be computed. The first grade average is simply the average of all four grades. The second grade average is computed by weighting the four grades as follows: The first grade gets a weight of 0.2, the second grade gets a weight of 0.3, the third grade gets a weight of 0.3, and the fourth grade gets a weight of 0.2. That is, the final grade is computed as follows: 0.2grade1+0.3grade2+0.3grade3+0.2grade4 Using this information, construct a 60-by-7 two-dimensional array, in which the first column is used for the student number, the next four columns for the grades, and the last two columns for the computed final grades. The program’s output should be a display of the data in the completed array. For testing purposes, the professor has provided the following data:arrow_forward(Practice) Use the max_element and min_element algorithms to determine the maximum and minimum values in the vector created for Exercise 8. (Hint: Use the expression max_ element(vectorName.begin(), vectorName.end()) to determine the maximum value stored in the vector. Then use the same arguments for the min_element algorithm.)arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:CengageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTCOMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE L
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrNew Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage LearningC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage

EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L

C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr

New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning

C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning