代写 Scheme graph PARTNER1 NAME: PARTNER1 LAB SECTION: PARTNER2 NAME: PARTNER2 LAB SECTION:

PARTNER1 NAME: PARTNER1 LAB SECTION: PARTNER2 NAME: PARTNER2 LAB SECTION:
EAS-230 Spring 2019 – Programming Project (PP)
Due Dates:
Hardcopy Submissions for Sections C, D, G and H: Friday 04/26/19 Hardcopy Submissions for Sections A, B, E, F and I: Thursday 04/25/19 Submission to UBlearns for all sections: Thursday 04/25/19 before 11:59 pm.
Directions:
1. This project must be done in groups of 2 students at maximum. Your partner can be of any sections given by your specific instructor.
2. Name your group as UBitName1_UBitName2, where UBitName1 and UBitName2 are the UBitNames of partners 1 and 2, respectively.
3. If you cannot find a partner please e-mail me with the subject line “PARTNER NEEDED”
4. This project will be submitted as:
a. A paper copy (the report) including all scripts and functions, the display in the command window, all plots, the results and analysis must be written (a template of the report will be posted on UBlearns). Your report must be turned-in at the start of your first lecture on the due dates shown above. Be sure to write your name and lab section on every page. Your report must be saved as a pdf.
b. Your .m-files and .mat-files, if any, developed in this project in addition to the report pdf file must be saved with the exact names as in the text of this assignment in a new directory. This directory must be zipped and uploaded to UBlearns before 11:59 pm on 4/25/2019. (Do Not include any files ending in “.m~”, “.sav” or other in your zip file)
5. You must write your own code and follow all instructions to get full credit. You are not allowed to use codes or scripts found on the internet or any other references.
6. You must use good programming practices, including indentation, commenting your functions scripts and choosing meaningful variable names to make your programs self- documenting.
7. It is your responsibility to make sure that your functions/scripts work properly and are free of errors by utilizing the resources at your disposal.
EAS 230 – Spring 2019 – PP Page 1 of 14

PARTNER1 NAME: PARTNER1 LAB SECTION: PARTNER2 NAME: PARTNER2 LAB SECTION:
Background:
A uranium plate generates heat uniformly at a constant rate of 𝑔̇ W/m3. Consider a large plate
made of uranium with a thickness 𝐿 = 20 𝑐𝑚, thermal conductivity 𝑘 = 28 W/m°C, and
thermal diffusivity 𝛼 = 12.5 × 1012 m2/s. Assume the plate is initially at a uniform
temperature of 𝑇 . At time 𝑡 = 0, each side of the plate is subjected to a boundary condition 454
that affects the change in temperature through the plate over time. Assume the boundary conditions are constantly applied over time. The solution for how the temperature changes over time through the plate, given a specific set of boundary conditions, can be estimated using numerical methods.
In this project, you will write a program that estimates the temperature distribution across the plate over time after the application of given boundary conditions using (1) the explicit finite difference numerical method and (2) the implicit finite difference numerical method.
Figure 1: An illustration of a plate depicting the nodes over a cross section of the plate and
the numerical solution. The number of nodes are from 1 to M the temperatures defined for
each time step at each node are defined as 𝑇4 . 7
Numerical Solution:
Numerical methods are commonly used to determine the changes in temperature along the thickness of the plate. One such method is called the finite difference method. In summary, we can divide a cross-section of the plate into a specific number of control volumes, identified at specific locations called nodes, and apply a set of equations to each node. This set of equations is known as the energy balance approach, generally defined by equation (1).
𝑅𝑎𝑡𝑒 𝑜𝑓 𝑐h𝑎𝑛𝑔𝑒 𝑅𝑎𝑡𝑒 𝑜𝑓 h𝑒𝑎𝑡 8𝑜𝑓 𝑡h𝑒 𝑒𝑛𝑒𝑟𝑔𝑦 𝑐𝑜𝑛𝑡𝑒𝑛𝑡C = D 𝑐𝑜𝑛𝑑𝑢𝑐𝑡𝑖𝑜𝑛 𝑎𝑡 𝑡h𝑒
𝑜𝑓 𝑡h𝑒 𝑛𝑜𝑑𝑒 𝑙𝑒𝑓𝑡 𝑠𝑖𝑑𝑒 𝑜𝑓 𝑡h𝑒 𝑛𝑜𝑑𝑒
𝑅𝑎𝑡𝑒 𝑜𝑓 h𝑒𝑎𝑡
I + D 𝑐𝑜𝑛𝑑𝑢𝑐𝑡𝑖𝑜𝑛 𝑎𝑡 𝑡h𝑒
𝑟𝑖𝑔h𝑡 𝑠𝑖𝑑𝑒 𝑜𝑓 𝑡h𝑒 𝑛𝑜𝑑𝑒
𝑅𝑎𝑡𝑒 𝑜𝑓 h𝑒𝑎𝑡
I + D𝑔𝑒𝑛𝑒𝑟𝑎𝑡𝑖𝑜𝑛 𝑖𝑛𝑠𝑖𝑑𝑒I
𝑡h𝑒 𝑛𝑜𝑑𝑒
(1)
EAS 230 – Spring 2019 – PP
Page 2 of 14

PARTNER1 NAME: PARTNER1 LAB SECTION: PARTNER2 NAME: PARTNER2 LAB SECTION:
The finite difference method obtains an approximate solution for the temperature distribution across the plate and over time, 𝑇(𝑥, 𝑡), at a finite set of x and t. The solution domain is depicted in Figure 2.
Figure 2: The solution domain where each shape represents a node/temperature on the plate. The rows represent temperature change across the plate and the columns represent temperature change over time.
The x-axis represents the space variable 0 ≤ 𝑥 ≤ 𝐿, while the y-axis represents the time variable 0 ≤ 𝑡 ≤ 𝑡7PQ . The black squares represent the nodal temperatures at 𝑡 = 0, which are determined from the initial conditions, while the white squares represent the nodal temperatures at 𝑡 > 0 at the boundaries of the plate, which are determined from the boundary conditions. The circles represent the temperatures at any internal node 0 < 𝑥 < 𝐿 at any time 𝑡 > 0. Eventually, the solution will be developed as an 𝑀 × 𝑁 array where every row representsthechangeintemperatureataspecificlocation𝑥overtime0≤𝑡≤𝑡7PQ andevery column represents the change in temperature along the plate thickness 0 ≤ 𝑥 ≤ 𝐿 at a specific time 𝑡
For this project, the nodes representing change in position across the plate are uniformly spaced in the interval 0 ≤ 𝑥 ≤ 𝐿, where 𝐿 is the thickness of the plate, such that 𝑥7 represents the location of each node and can be determined by equation (2a) where 𝑚 represents each node and 𝑀 is the total number of nodes, including those on the boundary.
𝑥7 =(𝑚− 1)∆𝑥; 𝑚 = 1,2,…,𝑀 (2a) Given 𝐿 and 𝑀, the constant spacing ∆𝑥 between the nodes can be computed with equation
(2b).
∆𝑥= Z (2b)
[1\
𝑛+1
𝑛 𝑛−1
EAS 230 – Spring 2019 – PP Page 3 of 14

PARTNER1 NAME: PARTNER1 LAB SECTION: PARTNER2 NAME: PARTNER2 LAB SECTION:
Similarly, the nodes representing the change in time are uniformly spaced on the interval 0 ≤ 𝑡 ≤ 𝑡7PQ such that 𝑡5 represents the time at each interval and can be determined by equation
(3a) where 𝑛 is the interval number and 𝑁 is the total number of intervals.
𝑡5 =(𝑛− 1)∆𝑡; 𝑛 = 1,2,…,𝑁 (3a)
The time of each interval, ∆𝑡, can be calculated with equation (3b) and is also known as the size of the time step.
∆𝑡 = ]^_` (3b) a1\
The overall solution is found by calculating the temperature at each node in position, 𝑚, and at each node in time, 𝑛.
Explicit Finite Difference Scheme:
The generic solution, found in equation (1), can be formalized with the Forward Time Centered Space (FTCS) finite difference format and is found in equation (5a) where 𝜏 is calculated with equation (5b).
𝑇5c\ =𝜏𝑇5 +(1−2𝜏)𝑇5 +𝜏𝑇5
7 71\ 7 7c\
𝜏 = j∆] ∆Qf
+𝜏dė∆Qfh; g
𝑚=2,3,…,𝑀−1 (5a) (5b)
Equation (5a) represents a set of 𝑀 − 2 equations for 𝑀 − 2 internal nodes at a specific time, 𝑡5c\. Each equation for each node (𝑚 = 2 to 𝑀 − 1) is explicit for one temperature at time 𝑡5c\ and can be used to solve for the temperature at a specific internal node at a specific time interval. Two more equations are required for 𝑚 = 1 and 𝑚 = 𝑀 to determine the full temperature distribution for a specific time interval, 𝐓5c\, at all nodes. The final two equations can be found by applying specific boundary conditions.
Four types of boundary conditions (BC) are described below where the remaining two equations for the explicit method are shown for each specified BC.
1. Prescribed temperature BC where the temperatures at node 1 and node 𝑀 are constant. At node 1: 𝑇5c\ = 𝑇 = Constant (6a)
\l
At node M: 𝑇5c\ = 𝑇 = Constant (6b) [Z
2. Prescribed heat flux BC where heat naturally flows from hot to cold temperatures at the edge of the plate. q is defined as the heat flux at the specific boundary node.
At node 1: 𝑇5c\ = 𝑇5c\ + tu∆Q
(7a) (7b)
\s
At node M: 𝑇5c\ = 𝑇5c\ + tv∆Q
[ [1\
g g
3. Insulated BC where there is no heat flow into or out of the boundary.
EAS 230 – Spring 2019 – PP
Page 4 of 14

PARTNER1 NAME: PARTNER2 NAME:
At node 1: 𝑇5c\ = 𝑇5c\ \s
At node M: 𝑇5c\ = 𝑇5c\ [ [1\
PARTNER1 LAB SECTION: PARTNER2 LAB SECTION:
(8a)
(8b)
4. Convective BC where heat flow at the boundaries defined according to the principles of
convection. h is defined as the heat transfer coefficient at a specific boundary node and
𝑇 is the outside temperature at a large distance from the plate. w
Atnode1:𝑇5c\ =d1−2𝜏−2𝜏xu∆Qh𝑇5 +2𝜏𝑇5 +𝜏d2xu∆Q𝑇 +ė(∆Q)fh (9a) \g\sgwg
AtnodeM:𝑇5c\ =d1−2𝜏−2𝜏xv∆Qh𝑇5 +2𝜏𝑇5 +𝜏d2xv∆Q𝑇 +ė(∆Q)fh (9b) [ g[[1\gwg
Any two equations for a specified BC can be combined with equation (5a) for a complete set of equations for each node. The solution can be found by solving the equation for each node, 𝑇5c\,
7
to determine the temperature profile across the plate for a single time interval, 𝐓5c\. This type
of system is called uncoupled since each equation has only one unknown temperature, 𝑇5c\, 7
for time, 𝑡5c\, seen on the left-hand side of each equation. The right-hand side for each equation can be determined from the known, previously solved for, temperature distribution from the previous time step 𝐓5.
Stability Criterion for Explicit Method: Limitation on ∆𝒕
The explicit method results in relatively simple equations with one unknown per node, 𝑇5c\;
however, it suffers from an undesirable feature that severely restricts its utility. The explicit method is not unconditionally stable and the largest permissible value of the time step ∆𝑡 is limited by the stability criterion shown in equation (10). If the time step ∆𝑡 is not sufficiently small, the solutions obtained by the explicit method may oscillate wildly and diverge from the actual solution. To avoid such divergent oscillations, the value of ∆𝑡 must be maintained below a certain upper limit established by the stability criterion.
Stability Criterion for Explicit Method:
∆𝑡 < ∆Qf for stability (10) sj Implicit Finite Difference Method The implicit method for solving this problem is unconditionally stable; however, it requires solving a system of equations for each time, 𝑡5c\. The system of equations for the implicit method can be built using equation (11) for the internal nodes (𝑚 = 2 to 𝑀 − 1) and the two equations defined by the boundary conditions for the implicit method, shown below. −𝜏𝑇5c\ +(1+2𝜏)𝑇5c\ −𝜏𝑇5c\ =𝑇5 +𝜏ė(∆Q)f for𝑚=2,3,...,𝑀−1 (11) g The same four BCs are described below and list the remaining two equations needed so solve for the solution via the implicit method. 71\ 77c\7 7 EAS 230 – Spring 2019 – PP Page 5 of 14 PARTNER1 NAME: PARTNER2 NAME: 1. Prescribed temperature BC At node 1: 𝑇5c\ = 𝑇 = Constant PARTNER1 LAB SECTION: PARTNER2 LAB SECTION: (12a) (12b) (13a) (13b) (14a) (14b) Combining equation (11) and a given set of BC equations, the system of equations can be rewritten in matrix format, 𝐴 𝐓 = 𝐛, as shown in equation (16). éaa0"" 0 0 0ùéTùn+1ébù ê1,1 1,2 úê1úê1ú êa2,1 a2,2 a2,3 0 " 0 0 0úêT2ú êb2ú ê0a3,2a3,3a3,4 " 0 0 0úêT3úêb3ú ê000## # 0 0úê!ú=ê!ú ê ! ! ! # # # ! ! úê ! ú ê ! ú (16) 000#aaa0Tb ê M-2,M-3 M-2,M-2 M-2,M-1 úê M-2ú ê M-2ú 2. Prescribed heat flux BC At node 1: 𝑇5c\ = 𝑇5c\ + tu∆Q \l At node M: 𝑇5c\ = 𝑇 = Constant [Z \s At node M: 𝑇5c\ = 𝑇5c\ + tv∆Q 3. Insulated BC At node 1: 𝑇5c\ = 𝑇5c\ [ [1\ g g \s At node M: 𝑇5c\ = 𝑇5c\ [ [1\ 4. Convective BC Atnode1:d1+2𝜏+2𝜏xu∆Qh𝑇5c\ −2𝜏𝑇5c\ =𝑇5 +𝜏dsxu∆Q𝑇 +ė(∆Q)fh (15a) AtnodeM:−2𝜏𝑇5c\+d1+2𝜏+2𝜏xv∆Qh𝑇5c\=𝑇5+𝜏dsxv∆Q𝑇 +ė(∆Q)fh (15b) g\s\gwg [1\ g[[gwg ê 0 0 0 " 0 aM-1,M-2 aM-1,M-1 aM-1,M úêTM-1ú êbM-1ú ê000"" 0 a aúêTúêbú ë M,M-1 M,M ûë M û ë M û The coefficients in 𝐴 and the constants in vector 𝐛 for the internal nodes (𝑚 = 2,3, ... , 𝑀 − 1) can be determined from equation (17) where: 𝑎 =−𝜏; 𝑎 =(1+2𝜏); 𝑎 =−𝜏; 𝑏 =𝑇𝑛 +𝜏𝑔̇(∆𝑥)2 (17) 7,71\ 7,7 7,7c\ 7 𝑚 𝑘 The coefficients in 𝐴 and the constants in vector 𝐛 for the boundary nodes (𝑚 = 1 𝑎𝑛𝑑 𝑚 = 𝑀) depend on the boundary conditions and are listed below. EAS 230 – Spring 2019 – PP Page 6 of 14 PARTNER1 NAME: PARTNER2 NAME: 1. Prescribed temperature BC Atnode1:𝑎 =1, 𝑎 =0, PARTNER1 LAB SECTION: PARTNER2 LAB SECTION: 𝑏 =𝑇5c\ =𝑇 \,\ \,s \ \ l (18a) (18b) (19a) (19b) (20a) (20b) (21a) (21b) Unlike the explicit method, a system of 𝑀 equations must be solved at every time step to determine the temperature profile 𝐓5c\ at all 𝑥 nodes for a specific time, 𝑡5c\. Once the formulation (explicit or implicit) is complete and the initial condition is specified, the solution of a transient problem is obtained by marching in time using a step size of ∆𝑡 as follows: select a suitable time step ∆𝑡 and determine the nodal temperatures from the initial condition. Taking the initial temperatures as the previous solution 𝐓5 at 𝑡 = 0, obtain the new solution 𝐓5c\ at all nodes at time 𝑡 = ∆𝑡 using the transient finite difference relations. Now using the solution 𝐓5c\ just obtained at 𝑡 = ∆𝑡 as the previous solution, obtain the new solution 𝐓5cs at 𝑡 = 2 ∆𝑡 using the same relations. Repeat the process until the solution at the desired time is obtained. This technique is called marching in time. References: [1] Y. Cengel, “Heat Transfer – A Practical Approach,” 2nd edition, McGraw-Hill. AtnodeM:𝑎 =0, 𝑎 =1, 𝑏 =𝑇5c\ =𝑇 [,[1\ [,[ [ [ Z 2. Prescribed heat flux BC Atnode1:𝑎\,\ =1, 𝑎\,s =−1, 𝑏\ =tu∆𝑥 g AtnodeM:𝑎[,[1\ =−1, 𝑎[,[ =1, 𝑏[ =tv∆𝑥 g 3. Insulated BC Atnode1:𝑎\,\ =1, 𝑎\,s =−1, 𝑏\ =0 AtnodeM:𝑎[,[1\ =−1, 𝑎[,[ =1, 𝑏[ =0 4. Convective BC Atnode1:𝑎\,\ =d1+2𝜏+2𝜏xu∆Qh, 𝑎\,s =−2𝜏, g \\gwg 𝑏 =𝑇5+𝜏dsxu∆Q𝑇 +ė(∆Q)fh AtnodeM:𝑎[,[1\ =−2𝜏, 𝑎[,[ =d1+2𝜏+2𝜏xv∆Qh, g 𝑏 =𝑇5+𝜏dsxv∆Q𝑇 +ė(∆Q)fh [[gwg EAS 230 – Spring 2019 – PP Page 7 of 14 PARTNER1 NAME: PARTNER1 LAB SECTION: PARTNER2 NAME: PARTNER2 LAB SECTION: Project Deliverables: I. Write a script file named EAS230_S19_PP.m that starts with a fully commented descriptive text that has the following: A. Full names of the students participated in the project, their person numbers, UBitnames and lab sections B. Full description of the program and the variables used. Your program must be able to do the following: 1. Initializes the variables for plate length (L), thermal conductivity (𝑘), and thermal diffusivity (a). 2. Performs user input: a. Prompt the user to enter the energy generated (𝑔̇) within the plate in W/m3. b. Prompt the user to enter the number of nodes (divisions in space), M. If M is less than 2 or not an integer the program must use a while loop to display “Invalid entry!” and prompt the user to re-enter valid numbers. c. Prompt the user to enter the total time of the simulation, 𝑡7PQ,in seconds. d. Prompt the user to enter the initial conditions in the form of a vector of 𝑀 elements of the temperature profile at 𝑡 = 0. If the user did not enter in a vector with 3 elements at least, use a while loop to display “Invalid entry!” and prompt the user to re-enter a valid vector. e. Print out a menu showing the boundary condition options: 1 for prescribed temperature, 2 for Prescribed heat flux, 3 for insulated, and 4 for convective. f. Prompt the user to enter the boundary conditions for node 1 as an integer number 1, 2, 3, or 4. If the user did not enter a valid option, use a while loop to display “Invalid entry!” and prompt the user to re-enter a valid option. g. Based on the chosen boundary condition for node 1, prompt the user for the remaining required information: i. Prescribed temperature: constant temperature in oC ii. Prescribed heat flux: heat flux in W/m2 iii. Convective: heat transfer coefficient in W/m2K and the outside temperature in oC h. Prompt the user to enter the boundary condition for node M as a number. If the user did not enter in a valid option, use a while loop to display “Invalid entry!” and prompt the user to re-enter a valid option. EAS 230 – Spring 2019 – PP Page 8 of 14 PARTNER1 NAME: PARTNER1 LAB SECTION: PARTNER2 NAME: PARTNER2 LAB SECTION: II. A. 3. i. Based on the chosen boundary condition for node M, prompt the user for the remaining required information: i. Prescribed temperature: constant temperature in oC ii. Prescribed heat flux: heat flux in W/m2 iii. Convective: heat transfer coefficient in W/m2K and the outside temperature in oC j. Prompt the user to specify which solver to be used: The user must enter the number 1 for explicit solver and 2 for implicit solver. If the user did not enter a valid option, use a while loop to display “Invalid entry!” and prompt the user to re-enter a valid option. Depending on the solver specified by the user, a. For the explicit solver: The script must calculate an appropriate time step (∆𝑡) from equation (6) and the corresponding number of time steps (N), which must be an integer. If the calculated 𝑁 is not an integer, the program must round it to the next integer using the ceil function and then readjust the value of the time step (∆𝑡) from equation (3b). The program then must call a function named ExplicitSolver to solve for the temperature distribution over time for the plate using the explicit numerical method as described before. b. For the implicit solver: The script must prompt the user for the desired number of time steps (𝑁) and then calculate the appropriate time step (∆𝑡) from equation (3b). The program then must call a function named ImplicitSolver to solve for the temperature distribution over time for the plate using the implicit numerical method as described before. Write a function named ExplicitSolver that does the following: Take the following INPUTS: 1. The number of space (position) nodes (M) 2. The number of time steps (N) 3. The energy generated (𝑔̇ ) 4. The time step (∆𝑡) 5. A vector of initial conditions of the temperature at each space node at 𝑡 = 0 6. The boundary condition for node 1 as a number (1, 2, 3, or 4) EAS 230 – Spring 2019 – PP Page 9 of 14 PARTNER1 NAME: PARTNER1 LAB SECTION: PARTNER2 NAME: PARTNER2 LAB SECTION: III. A. B. C. D. 7. A boundary condition parameter (BCP1) for node 1 where the values sent into the function depends on the type of the chosen boundary condition a. For BC 1, the value sent to the function must be 𝑇  b. For BC 2, the value sent to the function must be 𝑞 c. For BC 3, the value sent to the function must be 0 d. ForBC4,thevaluesenttothefunctionmustbe[h ,𝑇 ]asavector w 8. The boundary condition for node M as a number (1, 2, 3, or 4) 9. A boundary condition parameter (BCPM) for node M where the values depend on the type of chosen boundary condition a. For BC 1, the value sent to the function must be 𝑇 Z b. For BC 2, the value sent to the function must be 𝑞Z c. For BC 3, the value sent to the function must be 0 d. For BC 4, the value sent to the function must be [h ,𝑇 ] as a vector Zw 10. Any other inputs you deem necessary. Return the OUTPUTS: the temperature distribution over time, 𝑇(𝑚, 𝑛), as a 2D array of 𝑀 × 𝑁 elements where each column corresponds to the temperature distribution at a single instant in time. The function must have a function definition line, an H1 line and an appropriate help comments to define your inputs, outputs, and how to use your function. Solve the explicit finite different method by: i. Initializing the first column in the temperature distribution matrix, 𝑇(𝑚, 𝑛), with the initial condition vector defining the temperature at the initial time, 𝑡 = 0. ii. Solving the system of equations (equation 5a and the corresponding boundary condition equations) using the initial temperatures as 𝐓5 to find the next set of temperatures, 𝐓5c\. Store your new set of temperatures in the next column of 𝑇(𝑚, 𝑛). iii. Then using the solution just obtained as 𝐓5, to solve the system of equations to find the next set of temperatures for 𝐓5c\. iv. The process is repeated until the temperature at every time step is estimated. Always store your new set of temperatures in the next column of 𝑇(𝑚, 𝑛). Write a function named ImplicitSolver that does the following: Take the INPUTS: EAS 230 – Spring 2019 – PP Page 10 of 14 PARTNER1 NAME: PARTNER2 NAME: 1. The number of nodes (M) 2. The number of time steps (N) 3. The energy generated (𝑔̇ ) 4. The value of time step (∆𝑡) PARTNER1 LAB SECTION: PARTNER2 LAB SECTION: 5. A vector of initial conditions of the temperature at each space node at 𝑡 = 0 6. The boundary condition for node 1 as a number (1, 2, 3, or 4) 7. A boundary condition parameter (BCP1) for node 1 where the values sent into the function depends on the type of the chosen boundary condition a. For BC 1, the value sent to the function must be 𝑇  b. For BC 2, the value sent to the function must be 𝑞 c. For BC 3, the value sent to the function must be 0 d. For BC 4, the value sent to the function must be [h , 𝑇 ] as a vector. w 8. The boundary condition for node M as a number (1, 2, 3, or 4) 9. A boundary condition parameter (BCPM) for node M where the values depend on the type of chosen boundary condition a. For BC 1, the value sent to the function must be 𝑇 Z b. For BC 2, the value sent to the function must be 𝑞Z c. For BC 3, the value sent to the function must be 0 d. For BC 4, the value sent to the function must be [h , 𝑇 ] as a vector. Zw 10. Any other inputs you deem necessary. B. Return the OUTPUTS: the temperature distribution over time, 𝑇(𝑚, 𝑛), as a 2D array of 𝑀 × 𝑁 elements where each column corresponds to the temperature distribution at a single instant in time. C. The function must have a function definition line, an H1 line and an appropriate help comments to define your inputs, outputs, and how to use your function. D. Solve the implicit finite different method by: i. Initializing the first column in your temperature distribution matrix, 𝑇(𝑚, 𝑛), with the initial condition vector defining the temperature at the initial time, 𝑡 = 0. ii. Creating an 𝑀 × 𝑀 matrix A and 𝑀 × 1 vector b using the coefficients for each internal node from equation 9 and the coefficients for the appropriate boundary EAS 230 – Spring 2019 – PP Page 11 of 14 PARTNER1 NAME: PARTNER1 LAB SECTION: PARTNER2 NAME: PARTNER2 LAB SECTION: IV. 1. conditions (may be different for node 1 versus node M). The temperatures used in either the coefficients or the vector b is that at the previous time 𝐓5. iii. Solving the system of equations to find the next set of temperatures, 𝐓5c\. Store your new set of temperatures in the next column of 𝑇(𝑚, 𝑛). v. Then using the solution just obtained as 𝐓5, to the solve the system of equations to find the next set of temperatures for 𝐓5c. vi. The process is repeated until the temperature at every time step is estimated. Always store your new set of temperatures in the next column of 𝑇(𝑚, 𝑛). Test your program with the following cases: The plate is initially at a uniform temperature of 150°C. Heat is generated uniformly in theplateataconstantrateof𝑔̇= 5×102W/m3.Attime𝑡=0,onesideoftheplateis brought into contact with iced water and is maintained at 0°C at all times, while the other side is subjected to convection with an environment at 𝑇 = 30°C with a heat w transfer coefficient of h = 45 W/m2 °C. a. Use the explicit method with 𝑀 = 51, 101, 201 with a total time of 10 minutes. Depending on the calculated time step, plot the temperature profile 𝑇 vs 𝑥 at approximately 1 min, 2.5 min, 5 min, 10 min from the start of cooling. You should have a total of 3 plots, one per each set of nodes (𝑀) where every plot has four lines graphs on the same set of axes, for the four times. At minimum, annotate your plots with a title, axis labels, and a legend. Save your three 𝑇(𝑚, 𝑛) arrays with different descriptive names in a file EAS230_S19_PP.mat. b. Use the implicit method with 𝑀 = 101 and 𝑁 = 201, 401, 801 with a total time of 10 minutes. Depending on the calculated time step, plot the temperature profile 𝑇 vs 𝑥 at approximately 1 min, 2.5 min, 5 min, 10 min from the start of cooling. You should have a total of 3 plots, one per each set of nodes (𝑁) where every plot has four lines graphs on the same set of axes, for the four times. At minimum, annotate your plots with a title, axis labels, and a legend. Save your three 𝑇(𝑚,𝑛) arrays with different descriptive names in a file EAS230_S19_PP.mat. c. How do your results from the explicit solution compare to those from the implicit solution? Is this what you expected? d. Based on your results, how heat is moving through the plate? How did the specified boundary conditions affect this? 2. EAS 230 – Spring 2019 – PP Page 12 of 14 The plate is initially at a uniform temperature of 150°C. Heat is generated uniformly in the plate at a constant rate of 𝑔̇ = 0, 5 × 102, 10 × 102 W/m3. At time 𝑡 = 0, one side PARTNER1 NAME: PARTNER1 LAB SECTION: PARTNER2 NAME: PARTNER2 LAB SECTION: of the plate is brought into contact with water at 𝑇 = 10°C with a heat transfer w coefficient of h = 95 W/m2 °C, while the other side is insulated at all times. a. Use the explicit method with 𝑀 = 101 with a total time of 10 minutes. Depending on the calculated time step, plot the temperature profile 𝑇 vs 𝑥 at approximately 1 min, 2.5 min, 5 min, 10 min from the start of cooling. You should have a total of 3 plots, one per each set of nodes (𝑀) where every plot has four lines graphs on the same set of axes, for the four times. At minimum, annotate your plots with a title, axis labels, and a legend. Save your three 𝑇(𝑚, 𝑛) arrays with different descriptive names in a file EAS230_S19_PP.mat. b. Use the implicit method with 𝑀 = 101 and 𝑁 = 201 with a total time of 10 minutes. Depending on the calculated time step, plot the temperature profile 𝑇 vs 𝑥 at approximately 1 min, 2.5 min, 5 min, 10 min from the start of cooling. You should have a total of 3 plots, one per each heat generation constant (𝑔̇) where every plot has four lines graphs on the same set of axes, for the four times. At minimum, annotate your plots with a title, axis labels, and a legend. Save your three 𝑇(𝑚,𝑛) arrays with different descriptive names in a file EAS230_S19_PP.mat. c. Based on your results, how heat is transferred through the plate? How did the specified boundary conditions affect this? 3. The plate is initially at a uniform temperature of 150°C. Heat is generated uniformly in the plate at a constant rate of 𝑔̇ = 5 × 102 W/m3. At time 𝑡 = 0, one side of the plate is insulated at all times and the other side is subjected to standard heat flux with a value of −1000 W/m2. The negative sign means that the plate is cooled at this side at a constant rate. a. Use the explicit method with 𝑀 = 101 with a total time of 10 minutes. Depending on the calculated time step, plot the temperature profile 𝑇 vs 𝑥 at approximately 1 min, 2.5 min, 5 min, 10 min from the start of cooling. You should have a total of 1 plot where all four times are plotted on the same set of axes. At minimum, annotate your plots with a title, axis labels, and a legend. Save your 𝑇(𝑚, 𝑛) array with a descriptive name in a file EAS230_S19_PP.mat. b. Use the implicit method with 𝑀 = 101 and 𝑁 = 201 with a total time of 10 minutes. Depending on the calculated time step, plot the temperature profile 𝑇 vs 𝑥 at approximately 1 min, 2.5 min, 5 min, 10 min from the start of cooling. You should have a total of 1 plot where all four times are plotted on the same set of axes. At minimum, annotate your plots with a title, axis labels, and a legend. Save your 𝑇(𝑚, 𝑛) array with a descriptive name in a file EAS230_S19_PP.mat. EAS 230 – Spring 2019 – PP Page 13 of 14 PARTNER1 NAME: PARTNER1 LAB SECTION: PARTNER2 NAME: PARTNER2 LAB SECTION: c. Based on your results, how heat is transferred through the plate? How did the specified boundary conditions affect this? 4. Compare between the temperature distribution after 2.5 and 10 minutes for cases 1, 2, and 3. The plate is initially at a uniform temperature of 150°C. Heat is generated uniformly in the plate at a constant rate of 𝑔̇ = 5 × 102 W/m3. For 𝑀 = 101, use the saved data to create 2 plots one for the explicit method and one for the implicit method. Use 𝑁 = 201 for the implicit method. Each figure must have 3 × 1 fully annotated subplot, one for each case of 1, 2, and 3. Each subplot will have 2 line graphs on the same axes, one for 𝑡 = 2.5 min and the other for 𝑡 = 10 min. For each set of subplots everything is similar except the boundary conditions. Show the boundary conditions used in the title text of each subplot. Use legend, title, axis labels, grids, etc. EAS 230 – Spring 2019 – PP Page 14 of 14