写作SCIE1000编程、Python编程调试

” 写作SCIE1000编程、Python编程调试SCIE1000 Semester One, 2021Python and Communication Assignment1 The scenarioA public science museum in St Lucia is planning to update its exhibit. A feature of the museumis that each exhibit item is accompanied by two explanations, each written for a different audience.One explanation is pitched to the Science rookie and the other to the science enthusiast. Patronsread the explanation tailored To the level at which they feel most comfortable. Some characteristicsof a typical audience member in each category are described in Table 1.Patron Type Typical characteristicsScience Rookie Not familiar with scientific terminology or notation;will need terminology explained using a simple vocabulary;is unfamiliar with graphs;may be a younger person, Possibly 10+ years of age;likes to press buttons.Science Enthusiast Familiar With common scientific terminology and notation (not overly technical);will need terminology explained using somewhat sophisticated vocabulary;is prepared to read longer passages of moderate complexity;is familiar with graphs;likes to press buttons.Table 1: Characteristics of Different patronsThe museum is planning an exhibition called Mother Nature, the Mother of Invention. Thetopic is biomimicry, and the aim is summarised in the following passage from the exhibition prospectus:With this exhibition we aim to instil in our patrons a sense of wonder at the abilitiesdisplayed by animals to withstand harsh environments. Patrons will learn about mechanismsby which certain animals can improve the survivability of a group as a whole, andconsider possible developing technologies that mimic these natural behaviours.Recently, biomimicry research has looked at applying the modelling of emperor penguin huddlesto multi-robot systems, with the aim of improving the survivability of the robot group in harshenvironments [5].The museum director has asked the SCIE1000 teaching team for help in finding skilled volunteersto develop exhibit items. Once developed, the items will be maintained and potentially modifiedby museum staff, each of whom has a strong background in high-school mathematics, together withat least a beginners level of Python experience. We assured the director that SCIE1000 studentsare skilled at: making mathematical models using a mathematical toolkit familiar to any studentof Mathematical Methods (aka Maths B, or equivalent); writing Python programs, including thosewhich use arrays, loops, plots and new functions; and communicating scientific information to variousaudiences.12 An overview of the taskYou will write an interactive Python program that will run on a machine in the exhibition hallat the new science museum, as part of this exhibition. Your program will guide users to a betterunderstanding and appreciation of how and why emperor penguins form huddles. The informationyou need to create the relevant models is provided in Section 5 of this document, and a high-leveloverview of how to complete the Task is provided in Section 6.This assignment requires you to produce and deliver two items:(D1) A Python code file that satisfies the specifications in Section 7. This includes following thelogical flow laid out in the flow chart provided in Figure 4 (see Page 10).(D2) An audio-video screencapture file (3-4 minutes long) in which you show your code and communicatethe overview of your approach to museum staff who will need to maintain your code.3 Submission and gradingBoth deliverables (D1) and (D2) are to be uploaded via Blackboard submission link by 2pm on27 May, 2021. Late submissions without an approved extension will be penalised according to thepolicy in the ECP; consult Section 5.3 of the Electronic Course Profile for more information.Your submitted code will be run and tested as part of this grading process. A rubric (gradingcriteria) for this assignment is on Page 11. The file that you submit will be checked using softwarewhich is specially designed to detect plagiarism in code. Consult Section 6.1 of the ECP for moreinformation and procedures concerning plagiarism.This assignment has an advanced section which must be attempted by students aiming forgrades of 6 or 7 (see the grading criteria for more explanation). The shaded section of the flow chartindicates this advanced section, and more information is provided in Section 5.5. If you have anyquestions, please contact the Course lecturers via Campuswire (see Section 4 below).4 About getting helpThis assignment is a piece of summative assessment, designed to let you demonstrate your level ofmastery of several learning objectives in this course. As such, it is very important that the work yousubmit is all your own. This does not mean that you cannot receive help in regards to this assignment,but that help must be limited to general advice about modelling, Python and communication. Thistask sheet has been carefully constructed, and part of your job is to interpret the information itcontains. Some choices have been left to your judgement, and this is intentional.Remember that you must not look at anyone elses code and you must not show your code toanyone. Both of these actions are examples of behaviour that may be considered academic misconduct.No code from your assignment attempt should be posted on the course Campuswire site, orany other site, at any time. However, if you have problems with your code, you may develop somegeneric sample code that demonstrates the issue that you are having (but does not relate to theassignment). This can be discussed with others and/or posted to Campuswire for assistance. Allsuch Campuswire posts should be made visible to all students, so that everyone can see the questionand the answer from lecturers.25 Modelling Emperor Penguin Huddles5.1 Emperor penguins and breedingPenguins are flightless birds, with flippers instead of wings, adapted to living in a marine environment.Emperor penguins (Aptenodytes forsteri) live on the Antarctic continent and are the largest knownspecies of penguin, with adults weighing around 40 kg [2]. The emperor penguin is the only birdthat breeds during the Antarctic winter. They breed on sea ice which is well away from the oceanwhere these penguins feed. Emperor penguins mate in late April and May. Once a female penguinlays an egg, she returns to the sea, usually around late May / early June [2]. Male emperor penguinsprotect and incubate the egg by placing it carefully between their feet and a fold of their skin; ittakes between 65 75 days for the egg to hatch [2]. This means that by the time the male penguinsfinally return to the ocean for food, they have been fasting for about four months [3]. Once a chickhatches, emperor penguins share parental duties [2].The museum exhibition is interested in explaining the conditions experienced by a male emperorpenguin, protecting an egg, in a harsh Antarctic winter (approximately June-August).5.2 Modelling winter temperatures in the Antarctic continentIn 2008, the authors of [9] studied a medium-sized emperor penguin colony ( 2000 animals) closeto Neumayer Antarctic Research Station (70S 8W). To model the temperatures faced by emperorpenguins, we will use meteorological data from Neumayer Antarctic Research Station. The tablebelow is adapted from [4], and is restricted to some of the coldest months of the year.Month May June July August SeptMean temp (C) 21 22 24 23 23Max temp (C) 2 5 4 4 3Min temp (C) 45 45 46 44 46Table 2: Mean, maximum and minimum air temperature values, Neumayer station from 1993-2004To model the average (mean) daily temperatures in the winter months, we will use a simple modelfor the average temperature Tavg (in C) over time (in days since 1 June). Our model assumptionsare: On 1 June Tavg = 21C; Tavg declines linearly from 1 June until 16 July, at which point Tavg = 24C; Tavg increases linearly from 16 July until 31 August, at which point Tavg = 23C.Temperature varies throughout the day as well. In Table 2, we are given the minimum andmaximum temperatures seen in a given month, over about a decade of measurements. A typicalday usually does not vary as drastically as those highest and lowest recorded temperatures; mostmeasurements were within 8 10C of the average daily recordings [4]. To model the temperatureat a given time of the day, you may use a sine function, with parameters that you must choose basedon the information provided here.35.3 Wind ChillWhen very cold temperatures Are combined with winds, the apparent temperature (or wind-chilltemperature) will feel colder than the air temperature. A model for the apparent temperature ATin C, which is used by the National Weather Service in the USA and by Environment Canada (seefor example, [8]) is:AT = 13.112 + 0.6215T 11.37v0.16 + 0.3965T v0.16,where T is the air temperature in C and v is the wind speed in km/h (assumed to be at least 5km/h). Environment Canada recommends the model is only used for air temperatures strictly lessthan 0C [8].Average wind speeds experienced by emperor penguin colonies are around 15 km/h [3] withtypical maximum wind speeds of about 30 km/h [9]. However, emperor penguins have been knownto endure wind speeds of up to 180 km/h [9].5.4 HuddlingEmperor penguins form large huddles in order to protect the group from the cold [1, 3, 9, 7]. Huddlingdecreases the required energy expenditure of individual penguins [1]. Temperatures inside a huddlehave been found to reach temperatures as high as about 37C [3].Huddles can be loose or tight [3, 6], where a tight huddle has a high density, nearly hexagonalpacking arrangement [9]. The images in Figure 1 are taken from [6] and show examples of emperorpenguin huddles. Huddles are not motionless; even in tight huddles, where individual movementis not possible, the penguins slowly shuffle as a group. The shape of a tight huddle, when viewedfrom above, may be circular or more elongated. As wind speed increases, penguins on the outsideof the huddle receiving the most wind and exposure to the cold will shift along the huddle so thatthey move to the back of the huddle, where they are then protected from the wind, creating a moreelongated shape.Figure 1: Examples of loose (left) and tight (right) emperor penguin huddles.In a 2008 study of emperor penguins, Gilbert et al.[3] found that wind speed had a positiveimpact on the number of loose huddles formed per day and temperature had a significant effect onthe number of tight huddles formed per day.45.5 Details on effects of wind on huddle shape (Advanced Section only)An enthusiast user is likely to be interested in the modelling done by Waters et al. [7] on the effect ofwind on penguin huddle shapes. The key assumption of their model is that each individual penguinseeks to reduce its own heat loss. Thus, in their model, a penguin on the boundary of the huddleexposed to the wind will move Downwind, to the leeward side of the huddle in order to be protectedfrom the wind. In [7], the authors say, Our model recovers important features of actual huddles suchas their overall shape, downwind motion, and an equal distribution of access to the benefits of thehuddle among penguins.Figure 2: Time progression of penguin huddle simulation with 100 penguins [7].Waters et al. [7] claimFor small [wind speeds], when diffusive effects act to render the temperature distributionnearly uniform, the aspect ratio is close to one, depicting a more circular huddle. Incontrast, for large [wind speeds], where only a small leeward region is sheltered from thewind, the aspect ratio is much larger than one, depicting a more elongated huddle….Thewind pushes the heat distribution more narrowly around the huddle, causing the locationson the upper and lower edges of the huddle to exhibit more heat loss and thus be less attractiveto relocating penguins. As a result, the huddle formation loses a layer of thicknessand becomes more elongated.The shape of a tight huddle, when viewed from above, may be circular or more elongated andcan be roughly modelled by an ellipse (see Figure 3).5Major axisMinor axisFigure 3: General shape of an ellipse. The shortest and longest axes are called the minor and majoraxis, respectively.Waters et al. [7] describe the Peclet number, Pe, as a non-dimensional number that is proportionalto the wind speed and therefore captures the effects of varying the strength of the wind. They usedmodel simulations to study how huddle thickness w relates to Pe, where the huddle thickness is givenby the number of penguins across the minor axis.The following data is adapted from simulations in [7] with 400 penguins. You may assume thatthe number of penguins across the major axis of the ellipse shape is approximately 400/w.Peclet number (Pe) 1 2 10 30 100 300 1000 1100 1200huddle thickness (w) 20 18 13 9 8 4 4 3 3Table 3: Huddle thickness against Peclet number for penguin huddle simulations6 A detailed overview of the taskYour assignment submission must follow the specifications listed in Section 7. Below, we first give ahigh-level overview of how to approach the main section and the advanced section.To complete the main section, you will need to: Find an appropriate mathematical function to model the average winter temperature, for agiven day, using the information provided in Section 5.2. You will write a function average_winter_tempin your code which implements this model (see Section 7 for specifications). Find an appropriate mathematical function to model the winter temperature, which takes accountof daily fluctuations, using the information provided in Section 5.2. You will write afunction winter_temp in your code which implements this model (see Section 7 for specifications). You will write a function wind_chill in your code which implements the wind chill model inSection 5.3 (see Section 7 for specifications). According to the main section of the flow chart: Print information and ask for user input related to the contexts of Antarctic temperatures,wind chill and penguin huddles, in a manner accessible for the patron type.6 Provide a graph for the enthusiast user for temperatures over the month chosen by theuser. Include a description of how You approached this section of your code in your screencapturevideo (D2), including (briefly) how you developed your models and the overall code structure.To complete the advanced section, you will need to: Find an appropriate mathematical function to model the simulation data in Table 3. It will behelpful to consider the log-linear plot and log-log plot of the data, and use one of these in thedevelopment of a model. According to the Advanced section of the flowchart: Provide a graph of the data from Table 3 which also shows the model you have fit to it. Provide a brief explanation of your model to the enthusiast user. Ask the user to input a Peclet number and display the rough huddle shape that is predicted. Include a description of how you approached this section of your code in your screencapturevideo (D2), including how you developed your model for huddle thickness as a function of thePeclet number.7 Specifications for your submitted fileSpecifications about the Python: Museum staff have supplied a flowchart describing how the program should run (Figure 4 onPage 10). Your code must be an implementation of the flowchart provided. Your code must be well-structured and follow the guidelines for programming practice, asintroduced in SCIE1000. Whenever you prompt the user for information, you may assume they enter an appropriatenumber, and you can store their answer as a float. You do not need to check for incorrectinputs. You may only use Python commands introduced in SCIE1000. Recall that museum staffmust be able to maintain and modify the code, so you may only use commands that theyunderstand. Museum staff have a beginners level of experience using Python, which you mayregard as the equivalent of a student who has taken SCIE1000. The Python commands youhave covered in this course should be more than sufficient to complete the assignment. Museum staff have identified several functions that they think will be useful in possible modi-fications and extensions of the code. You must define these functions in your code, withthe exact names specified below and which take the same arguments in the order specified. Youshould use these functions in your code as appropriate. You may define other new functions asneeded.7(a) You must define a function called average_winter_temp which takes one input, days since1 June (in an appropriate interval), and returns the average daily temperature (in degreesCelsius) at that day, according to the average winter temperature model from Section 5.2.(b) You must define a function called winter_temp which takes one input, time since midnighton 1 June (in an appropriate interval), and returns the temperature at that time, accordingto the winter temperature model with daily fluctuations from Section 5.2. You may choosewhether to measure the input in Hours or in days (where partial days are accepted input).(c) You must define a function called wind_chill, which takes two inputs, air temperature(in degrees Celsius), and wind speed (in km/h), in that order, and returns the apparenttemperature according to the wind chill model in Section 5.3. Note that a function called graph_ellipse is already defined in the program template file(available on Blackboard). The function takes two arguments, a and b, and graphs a figure ofan ellipse with minor axis of length a and major axis of length b. This function is only neededfor completing the advanced section (see the flowchart on Page 10).Specifications about the communication: All messages to the user, including prompts to enter data, should communicate in a mannerappropriate for the level of patron and should serve the purpose of the program. You should write no more than a couple of sentences for each piece of information you explainto the user. Follow the principles for communication in science as described in Appendix B ofthe lecture book. Be precise, clear and concise! You should use units appropriately in your communication with the user. Make sure you areaware of the units of values being passed into functions and the units of values being returnedfrom functions. You should include useful and appropriate comments in your code to help the museumstaff who may need to maintain and modify the code. Any variable names and function namesyou define should be chosen with communication in mind. Whenever you produce a graph you should provide appropriate labels and explanatorytext. Your screencapture video should provide a clear overview of how your code worksand why you made the choices you did. This does not replace excellent commenting inthe code. One way to create such a file by opening a Zoom meeting, sharing your screen, andselecting Record Record to this computer. If you choose to use sources other than those cited in this task sheet, you should include abibliography as comments at the end of your code, to show the museum staff maintaining thecode where you obtained any relevant information you used. Any referencing style is fine.8File type and file name: Your assignment (D1) should be saved as a .py file called InteractivePenguins********.pywith the string ******** replaced by your student number. Your screencapture audio/video file (D2) should be saved as Explanation********.mp4with the string ******** replaced by your student number.References[1] Ancel A, Visser H, Handrich Y, Masman D, Le Maho Y (1997) Energy saving in huddling penguins. Nature 385:304305.[2] Australian Antarctic Program. Penguins. httpss://www.antarctica.gov.au/about-antarctica/animals/penguins/emperor-penguins/, accessed 13 December 2020.[3] Gilbert C, Robertson G, Le Maho Y, and Ancel A. (2008) How do weather conditions affect the huddling behaviourof emperor penguins? Polar Biology 31: 163169.[4] Konig-Langlo G C. and Loose B. (2007) The meteorological observatory at Neumayer stations (GvN and NM-II),Antarctica, Polarforschung, 76, 2538, 2007.[5] Mina T and Min B-C. (2018) Penguin huddling inspired distributed boundary movement for group survivalin multi-robot systems using Gaussian Processes. Proceedings of the 2018 IEEE, International Conference onRobotics and Biomimetics December 12-15, 2018, Kuala Lumpur, Malaysia.[6] Richter S., et al.(2018) Phase transitions in huddling emperor penguins. J Phys Appl Phys, 51: p. 214002[7] Waters A, Blanchette, F, Kim AD (2012) Modeling huddling penguins. PLoS ONE 7(11): e50277.doi:10.1371/journal.pone.0050277[8] Wind Chill and Humidex Calculators, Government of Canada, httpss://weather.gc.ca/windchill/wind_chill_e.html,accessed 12 March 2021.[9] Zitterbart D P, Wienecke B, Butler J P, and Fabry B. (2011) Coordinated movements prevent jamming in anemperor penguin huddle. PLoS ONE 6(6): e20260. doi:10.1371/journal.pone.00202609Print a welcome message that is appropriate for all patrons. Prompt the user to enter their Patron typePrint an introduction about Emperor penguins and this interactive programYesPrint a farewell messageNoUser is anenthusiast?YesAdvanced sectionNoIf user is anenthusiast?YesPrint a general message about winter temperatures.Calculate the temperature using the function winter_temp and print a useful message.Prompt the user to select a day of the month.Display a graph of the winter temperature over the chosen month,including daily fluctuations.Print a useful message about wind chill. Prompt the user to enter a wind speed.Calculate the apparent temperature using wind_chill. Print a useful message.Print a brief description of emperor penguin huddles. Qualitatively explainthe basic effect of wind speed on the shape of a tight huddle.Ask the user if they want to choose another winter month.Prompt the user to select a winter month.Display a graph of the data on huddle thickness vs Pcletnumber, with an appropriate model fit to it. Provide a briefexplanation of this model.NoPrompt the user to pick or enter a time of day (in at most hourly increments).Print a useful message about the general predicted temperature that day.Show the approximate predicted huddle shape, using graph_ellipse.Prompt the user to enter a Pclet number.Ask the user if they want to choose another Pclet number.YesNoFigure 4: Flowchart for the interactive program (shaded section indicates the advanced section).10Python and Communication Assignment Grading CriteriaYour grades for the Python and Communication sections of the assignment (each on a 17 scale) arecalculated by using the grade that best matches your answers for the main sections plus the extragrades for the advanced sections. Your overall grade will thus be up to a maximum of 14. The tablebelow shows the criteria for each grade.Grade Python (17) Communication (17)1 The code is limited and displays little understandingof the modelling involved.Communication is very poor and would bedifficult to understand by any audience.2 The code fails to run for any input, doesnot meet the specifications, and/or has seriousconceptual errors in the modelling.The communication of the relevant scientificinformation (in the code and to patrons)is generally poor.3 The code runs for some expected inputs,meets at least some of the specifications,and/or may have some significant conceptualerrors in the modelling.The communication of the relevant scientificinformation (in the code and to patrons)lacks clarity or is not at the appropriatelevel for most target audiences.4 The code runs without error for most inputs,mostly meets the specifications, andmostly represents the mathematical modellingwith perhaps only some conceptualand/or mathematical errors.The communication of the relevant scientificinformation (in the code, the screencapturevideo, and to patrons) is adequatefor most target audiences. There maybe some limitations in the communicationwithin the code and/or to patrons.5 The code runs without error for all expectedinputs, largely meets all the specifications,and accurately represents themodelling with perhaps only one or twominor errors.The communication of the relevant scientificinformation (within the code, thescreencapture video, and to patrons) ismostly clear, fluent, and uses a level andstyle appropriate for each target audience.Advanced Section0 Not completed, or the advanced code hassignificant conceptual errors.Not completed, or the communication inthe advanced section is poor.+1 The code for the advanced section runswith only minor errors and mostly representsthe modelling with some conceptualor calculation errors.The level of communication is adequatethroughout the advanced section butwould require some editing before use inan exhibit. The advanced section is alsocommunicated in the screencapture video.+2 The code for the advanced section runswithout error and accurately representsthe modelling with at most one minor error.The level of communication is clearthroughout the advanced section andwould be suitable for use in an exhibitwith perhaps only one or two smallchanges. The advanced section is alsoclearly communicated in the screencapture请加QQ:99515681 或邮箱:99515681@qq.com WX:codehelp

添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导