If you look at the roofs of houses in Colchester and Wivenhoe, you will see that some of them are fitted with photovoltaic panels which generate electricity from incident sunlight. The amount of electricity generated per day obviously depends on the length of the day but also on factors such as the weather: cloud and rain reduce the amount of sunlight, the ambient temperature affects the mobility of electrons, and so on. Some people who have solar panels take a reading each day, so that they are able to work out how much electricity they have generated.
You are asked to write a program that reads in a file of such daily readings which is given on the command line. Your program should take precisely one command-line argument, the name of this file. An example file, generation.dat, is provided, taken from a real solar panel installation, so a typical invocation of your program would be
python3 solar.py generation.datEach line of generation.dat normally contains two numbers: the first denotes the day and is an integer starting from zero, while the second is the reading of the generation meter at the end of that day. Hence, to determine the amount of electricity generated in day N, one would subtract the reading for day N - 1 from that of day N. Note that there is not a reading for every day in the file (because the person recording the data forgot or was away), so you need to do something sensible to handle such events. Some lines in the file start with # and are to be interpreted as comments. When the data have been read in, you should make your solar.py:
Split the readings into 28-day chunks and calculate the mean and standard deviation (s.d.) of each chunk
Produce a plot containing the following lines:
Finally, you should find an equation that fits the data reasonably well and calculate the correlation coefficient between values calculated from your equation and the 28-day chunk means. The nature of the equation that you need to fit will become apparent when you view the plot of the 28-day chunks. You should draw this line on the plot in green.
You should present your code in accordance with the assessment criteria that will be used for marking it. In particular, your program should be structured into routines where appropriate and the code should be well documented using the approaches described in the lecture notes.
Your program must run under Linux on the computers in CSEE Lab4 and must be invoked as described above. You may make use of any routines you have already written during CE705 sessions; if they reside in a file other than solar.py, you need to upload that file as part of your submission. (Any such files need to be presented in accordance with the assessment criteria too.) You may also make use of routines that are part of the standard Python library or you have found on the web; but if you do the latter, you must acknowledge the original author — failure to do so is an academic offence. You do not need to submit the graph because your program will be executed as part of the marking process.
|Submission deadline:||Tuesday 16th January 2018|
|What to submit:||
the source code of your program|
any ancillary source files it needs to run
|Feedback returned:||three weeks after submission|
|Assessment criteria:||see the detailed description of the criteria|
Remember to identify your work with your registration number only. The coursework system allows you to upload your work as often as you like, so do keep uploading your files as you develop them.
|Last updated on 2015-10-21 10:19:06||Web pages maintained by Adrian F. Clark [contact]|