Session 9 – Coursework 2 Part 1/3
Matlab编程代写 This is the second and main piece of coursework for the Matlab programming part of your ABEE 1025 module.
This is the second and main piece of coursework for the Matlab programming part of your ABEE 1025 module. You’ll be simulating the temperature change inside a small building (actually a garden shed) over time. The coursework is split into three worksheets, which will be given to you over three sessions. Each worksheet follows the usual format of steps you can follow. The outputs in each session will be added to a portfolio of answers that you should submit altogether on Moodle by the date below. Each worksheet also contains a marking rubric at the end to guide you.
Please note the submission link will be open on Moodle from Friday 20th December and you are encouraged to submit on this date, with the deadline used as a final cut off point after which there will be penalties for late submission.
This is an individual piece of coursework and the work you submit must be your own. Anyone suspected of cheating will be dealt with according to the University policy on academic misconduct.
Objectives Matlab编程代写
- Use Matlab to build a thermal model of a simple
Useful Equations, Data & Notation
Assigned
Condition |
Building Material | k / Thermal Conductivity
(W/m·K) |
L / wall thickness
(mm) |
A | Lightweight Concrete | 0.19 | 150.0 |
B | Clay Brick | 0.71 | 102.5 |
C | Timber | 0.14 | 15.0 |
D | Polyurethane | 0.02 | 5.0 |
E | Plywood | 0.16 | 24.0 |
ALL | Felt – Bitumen Layers | 0.50 | 3.0 |
Plywood (roofing) | 0.16 | 8.0 |
Table 1: Notation and values to be used.
Procedure Matlab编程代写
To fulfil the requirements of this coursework you should submit (via Moodle) a small portfolio containing three pieces of code (two functions and one script) and one Word document (or pdf) containing answers to questions asked in the three worksheets. The items you should submit in your portfolio, along with the marking scheme, will be included in a summary on the last page of each worksheet. You will need to finish each week before going on to the next. Your complete portfolio should be submitted before the deadline.
Have a look the marking scheme at the end of each worksheet to see how your submissions will be marked.
- Find your assigned condition from the list on Moodle. You will have been assigned a letter A-E which will determine the materials your simulated building is made of. You will need it this week and next Please note your coursework must be based on the conditions you have been allocated or you will receive zero marks. Matlab编程代写
-
You will need your function from Part 5 (Steps 1&2) of session If you don’t have it return to session five and complete these steps.
- (Re)name your function ‘buildingProperties’. Your function should have the building height(h), width (w), length (l) and pitch angle (α) of the building as inputs. Your function should output the volume of the building (V).
- Add to your function to give the surface area of the building walls (Awall), the surface area ofthe building roof (Aroof ), and the mass of air inside the building (m) as Use the value for the density of air given in table 1. This function should be submitted as part of your portfolio, add a comment containing your name in the second line of the function (see marking scheme at the end of this worksheet).
- Test your function using the values for h,w,l and α from table 1. You should get;
Awall = 10.20 m2
Aroof = 2.82 m2
V = 4.00 m3
m = 4.90 kg
- Start a new script. In your script use the values of k and L for your assigned condition tocalculate U values for the walls and roof (Uwall and Uroof). The walls are constructed of a single layer of material. The roof is constructed of a layer of plywood and a layer of bitumen felt, k and L values for the roofing materials are given at the top of this You will need equation 1a (for a single layer) and 1b (used when there are multiple layers e.g. the roof).
-
Obtain the function called ‘getQloss’ from Moodle. This function uses equation 2 to calculatethe heat loss (dQloss) given Tin,Tout, Aroof, Uroof, Awall, Uwall and dt. Matlab编程代写
- Extend the script you created in step six to test the ‘getQloss’ function to estimate the heatloss over one second. Use Aroof and Awall for surface area from your ‘buildingProperties’ function and the U values which you have already calculated in the script. Use Tout = 10 ⁰C, Tin = 20 ⁰C, dt = 1s. You should get:
Condition | Heat loss over 1
second (kJ) |
A | 0.63 |
B | 1.21 |
C | 1.46 |
D | 0.91 |
E | 1.18 |
-
Obtainthe function called ‘getQheater’ from This function uses equation 3 to calculate the heat input from a heater placed inside the building (dQheater) given inputs Tin ,Theater,M and dt. Matlab编程代写
- Extendyour script from step six to test the ‘getQheater’ function and get the heat added over one second using values from table 1 and Tin = 20 ⁰C, dt = 1s. You should get dQheater = 5.027 KJ.
- Write a new function called ‘getdT’. This function should use equation 4 to calculate thechange in the internal temperature given m, dQloss and dQheater as This function should be submitted as part of your portfolio, add a comment containing your name in the second line of the function (see marking scheme at the end of this worksheet).
- Extend your script from step six to test your ‘getdT’ function using the values you havepreviously used and You should get:
Condition | Temperature change over
1 second (⁰C) |
A | 0.89 |
B | 0.77 |
C | 0.72 |
D | 0.84 |
E | 0.78 |
- Extend your script from step six to use a for loop to calculate the change in internal temperature over 200 seconds (t=2:dt:200). You’ll need to calculate the heat loss, heat gain, temperature change and new temperature for each iteration of your loop. Assume that we know the temperature at t = 1s (Tin= 20⁰C). Plot your result, you should see the temperature change over time and then reach a steady
- Starta new Word document – this will contain your answers to questions and plots to submit for the next three worksheets.
- Thefirst line of the document should be your name and student number.
- Thesecond line of the document should be your assigned condition (A,B,C,D or E).
- Inyour word document add the answers to these questions:
Q1a What is the steady internal temperature your simulated room reaches after 200 seconds? Matlab编程代写
Give your answer in degrees Celsius to two decimal places.
Q1b How long does it take to reach this temperature? (Assume a steady temperature has been reached when |dTin|<0.001 ⁰C). Give your answer in integer seconds.
Q1c If the heater is turned up (Theater=50 ⁰C) what is the steady internal temperature your simulated room reaches after 2 00 seconds? Give your answer in degrees Celsius to two decimal places.
Q1d If the heater is turned off (dQheater = 0), how long does the room take to reach a steady temperature? (Assume a steady temperature has been reached when |dTin|<0.001 ⁰C). Give your answer in integer seconds (hint: you may need to run your simulation for longer than 200s).
(|x| should be taken to mean the magnitude of x)
Marking Rubric & Submission Summary Matlab编程代写
This week 16 marks are available from a total of 60 available for this coursework. You should add your ‘buildingProperties’ and ‘getdT’ functions to your submission portfolio along with a Word document formatted as specified in steps 14-16 and containing answers to Q1a-d.
5 marks will be given for the submitted ‘buildingProperties’ function.
- 1 mark will be given for use of the correct function name.
- 1 mark will be given if the filename matches the function name.
- 1 mark will be given if the function takes the specified inputs.
- 1 mark will be given if the function gives the specified outputs.
- 1 marks will be given if the function gives correct answers to test inputs.
1 mark will be removed for failure to use semi-colons to supress output on each line of code in this function.
3 marks will be given for the submitted ‘getdT’ function. Matlab编程代写
- 1 mark will be given if the function takes the specified inputs.
- 1 mark will be given if the function gives the specified outputs.
- 1 marks will be given if the function gives correct answers to test inputs.
1 mark will be removed for failure to use semi-colons to supress output on each line of code in this function.
8 marks will be given for correct answers to questions 1a-d
For each numerical answer:
- 1 mark will be for the correct answer using the specified units.
- 1 mark will be given for an answer correctly rounded to the specified number of decimal places.