SCIE1000编程 写作、Python编程语言

” SCIE1000编程 写作、Python编程语言SCIE1000 Theory and Practice in SciencePython and Communication AssignmentSemester One, 20201 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.Table 1: Characteristics of different patronsPatron 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.The planned exhibition is called Exploring Our Galaxy. The topic is exoplanets (planets foundorbiting distant stars) and the aim is summarised in the following exhibition prospectus:With this exhibition we aim to instil in our patrons a sense of wonder at the vastness ofour galaxy and the potential for finding other forms of life with whom it may be possibleto communicate. Patrons will marvel at the challenge of searching for exoplanets andthey will speculate about the number of potential civilisations in our galaxy with whom wecould theoretically communicate.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 student ofMaths B (or equivalent); writing Python programs, including those which use arrays, loops, plotsand new functions; and communicating scientific information to various audiences.Based on this boasting by the SCIE1000 teaching team, you have been asked to develop an exhibititem. You will develop an interactive (command-line) Python program which engenders in museumpatrons a sense of wonder at the vastness of our galaxy and the potential for communicating withother forms of life.SCIE1000作业 写作、Python编程语言作业调试、 辅导Python课程作业、 写作data作业2 An overview of the taskYou will write an interactive Python program to guide a user through some speculation aboutcivilisations in our galaxy (see Section 4) as well as whether a potential exoplanet could be detectedfrom Earth given its size and distance from its star (see Section 5).Your program will follow the logical flow laid out in the flow chart provided in Figure 2.A detailed list of program requirements is provided in Section 6 of this document.Your assignment will be separately be graded on two aspects, each on a 17 scale. The first aspectwill be your use of Python to represent the underlying mathematical models. This will include thequality of your code and the accuracy with which you represent the models. The second aspect willbe on the communication that you use. This covers both the communication within your program(for staff at the exhibit) and the communication you use with the patrons of the exhibit.Your submitted code will be run and tested as part of this grading process. A rubric (markingcriteria) for this assignment is on the last page of this document. This assignment has an advancedsection which must be attempted by students aiming for grades of 6 or 7 (see the grading criteriafor more explanation). The shaded section of the flow chart indicates this advanced section, and thecorresponding modelling information is in Section 5.6. If you have any questions, please contact thecourse staff.Your code file must be uploaded via the Blackboard submission link by 2pm on 1 June, 2020.Late submissions without an approved extension will be penalised; consult Section 5.3 of the ElectronicCourse Profile for more information concerning late submissions.3 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 workyou submit is all your own.This does not mean that you cannot receive help in regards to this assignment, but that help mustbe limited to general advice about Python and modelling – not specific to how to do this particularassignment. Your teaching team, the SLC tutors, your classmates, your friends, and anyone else forthat matter, can answer as many general questions about Python and modelling as you care to ask.They can even help you understand what particular error messages may mean. They should not,however, tell you what to write or correct your code. You should type or create every character inthe files you submit. The files that you submit will be checked using software which isspecially designed to detect plagiarism in code. Consult Section 6.1 of the Electronic CourseProfile for more information and procedures concerning plagiarism.This task sheet has been carefully constructed, and part of your job is to interpret the informationit contains. Some choices have been left to your judgement, and this is intentional. Anyquestions you have about the assignment task should be posted on the course Piazza site as a publicpost (visible to all students). This is the only place where you can receive authoritative answers toquestions. In this way, all students will have access to the same information. Sometimes the answerto a question on Piazza will be See the assignment task sheet. Such answers are simply to avoidrestating information, and indicate that you will need to decide how to use the supplied information.24 Imagining potential civilisations in the Milky WayThe Drake equation, named after the astronomer and astrophysicist Dr. Frank Drake, is a formalisationto guide speculation about the probability of finding civilisations in our galaxy (the MilkyWay) with whom it may be possible to communicate. This equation is often quoted with sevenparameters (see [1]). We will use the following simplified version:N = R p n c L (1)whereN = number of civilisations in the galaxy that can communicate with EarthR = average rate of star formation (per year) in the galaxyp = proportion of stars with planetary systemsn = number of planets per system with conditions suitable for lifec = proportion of potentially habitable planets on which a technological civilisation developsL = average lifetime (in years) of such a civilisation within the detection windowTable 2, adapted from [1], includes recent estimates (ie best known estimates) for the parametersin the Drake equation, as well as historical estimates which were used in the 1960s.Table 2: Parameters of the Drake equation and their estimatesParameter R p n c L1960s estimation 10 per year 0.5 2 0.0001 10,000 yearsRecent estimation 7 per year 0.5 1 0.02 10,000 yearsBefore you plan your communication to the user about this information (see the flow chart in Figure2 for details) you should carefully think about how estimates for N are made and how reliable youthink those estimates are.5 Exoplanets5.1 Detecting exoplanets using the Kepler space telescopeExtraterrestrial planets, or exoplanets, are planets that orbit around stars other than our Sun. Sincethe nearest star is around 4 light-years away (the distance light travels in 4 years), exoplanets areextremely difficult to detect. However, in recent years, a number of different techniques have beendeveloped which are capable of directly or indirectly inferring the existence of an exoplanet aroundanother star in our galaxy (the Milky Way).One very successful method for detecting exoplanets is to observe the intensity of the light emittedby the star as a function of time. If an exoplanet passes in front of this star, it partially blocks the staras viewed from the Earth, and the measured intensity of the star will (slightly) decrease. Multiplemeasurements at regular intervals (at least three passes in front of its star) can be used to confirmthe existence of an exoplanet.3A telescope that has been used extensively for the detection of exoplanets using this approachis the Kepler space telescope. Its goal was to detect smaller exoplanets in the range from the sizeof Earth to the size of Jupiter. This telescope, recently retired, was launched in 2009, and hassuccessfully detected several thousand exoplanets [2].5.2 Modelling exoplanet detectionThe model we will develop here will be a very simplified model of the physical process in which aplanet transits in front of a star. In particular, we will make the following assumptions when buildingour model: We will be detecting exoplanets that are orbiting a star which has the same size and mass asthe Sun. The star mass impacts on the speed of the exoplanet as it moves around its star, andhence the time to complete a full orbit around the star, while the mass and size of the starinfluence the time the exoplanet takes to pass in front of the star. There is a perfect alignment of the exoplanet between our observation point on Earth, andthe star around which it orbits. This maximises the time that the exoplanet is in front of itsstar. The light emitted by the star is uniform across the width of the star. This simplifies ourcalculation of intensity as the exoplanet transits in front of the star. The radius of the exoplanet is small compared to the radius of its star. This allows us to choosea simple model of the transit.Note: there will be some constants relevant to our solar system that you will need to research andfind values for. Exercise care with units!5.3 Choosing input parametersTo model the transit of the exoplanet in front of its star, we first need to specify the the size of theexoplanet and the distance the exoplanet is from its star. Your program will ask the patron to choosethese. However, most rookies (and many enthusiasts) will not have a good feel for what values wouldbe appropriate. Hence, you will need to think carefully about how this is posed to the patrons. Werecommend thinking about how to use relative values compared to similar values for the Earth/Sun.5.4 Model – calculating the velocity of the exoplanetThe velocity of the exoplanet is dependent on how far it is from its star, and the gravitationalattraction of the star. We can relate these back to values for Earth usingvelocity of exoplanetvelocity of Earth =sdistance of Earth from the Sundistance of exoplanet from its star45.5 Model – calculating the key output parametersWe can now begin calculating the relevant output parameters. These are: Minimum relative intensity. When the exoplanet is fully between the Earth and the exoplanetsstar, the intensity of the star observed from the Earth will be decreased as the exoplanetblocks some of the light from the star. We can define a relative intensity as the ratio of theobserved intensity when the exoplanet is in front of the star to the observed intensity when theexoplanet is not in front of the star. This intensity depends on the ratio of the cross sectionalarea of the exoplanet to the cross-sectional area of its star. The cross-sectional area of a sphereis the area of a circle with a radius which is equal to the radius of the sphere. We can thuswrite an equation for the observed relative intensity of the star when the exoplanet is in frontof the star asRelative intensity = 1 cross-sectional area of the planetcross-sectional area of the starThis equation gives the minimum observed relative intensity. The maximum relative intensity,when the exoplanet is not in front of the star, is equal to 1.Note that we have ignored the short period of time when the exoplanet is only partially infront of the star (i.e. across one edge of the star). We will explore this further in the advancedsection below. Transit time. The velocity of the exoplanet and the diameter of its star will determine thetransit time. The faster the exoplanet is moving, the shorter the transit time and, likewise, thelarger the diameter of the star, the longer the transit time. The transit time can be written asTransit time = diameter of the starvelocity of the exoplanet Period of orbit. The period of the orbit of the exoplanet is the time for the exoplanet to makeone complete orbit around its star (this is 1 year for Earth). The period of orbit is determinedby the exoplanets speed, and the distance the exoplanet is from its star. The period can thusbe written asPeriod = circumference of the orbitvelocity of the exoplanetYour program should output values for these parameters, accompanied with appropriate explanationsfor what each means. Detection. The detection limit for Kepler to observe a planet is an intensity decrease of 1part in 10,000 (or 0.01%) as the exoplanet transits the star. You should inform the patronwhether their chosen exoplanet could be detected or not. You might also like to comment onhow long the star needs to be observed to confirm detection of the exoplanet.5vexoplanetrstar -rstart5 t4 t3 t2 t1x5 x4 x3 x2 x1xout_L xin_LStarExoplanet(a) (b)x x 0 xxin_R xout_R(c)Figure 1: For the advanced section. Diagram of the motion of the exoplanet across the face of thestar. (a) Stepping the position of the exoplanet (x) as the time is varied (t); (b) Limits for theexoplanet crossing the border of the star on the left side; (c) and limits for the right side.5.6 Advanced sectionThe science enthusiast should be provided with further information including a graph of the intensityand a paragraph of accompanying text. The graph should show how the relative intensity varies asthe exoplanet transits its star over time. The accompanying text should briefly (but clearly) explainone limitation of the model that has been used.To create the graph, there are a number of approaches that you could use Develop a time step approach. This will involve using a loop in your program which stepsthrough time as the planet transits in front of the star. This is shown in Fig. 1(a), with avery coarse time step. At each time step, you will need to calculate the position of the planet.Time, t and position, x, are related viax = x0 + vtwhere x0 is some starting position (t = 0), and v is the velocity of the planet. At each timestep, you will need to calculate the observed relative intensity which will be equal to 1 if the planet is not in front of the star (positions 1 and 5 in the figure). equal to the minimum intensity, Imin, that you previously calculated if the planet is fullyin front of the star (position 3 in the figure). between the minimum intensity and 1 when the planet overlaps the edge of the star(positions 2 and 4 in the figure). We will use a linear interpolation to approximate theintensityRelative intensity = 1 x xoutxin xout (1 Imin)where x is the position of the planet, and xin and xout are the positions of the planet whenit is just inside and just outside the star, respectively (see Fig. 1b and Fig. 1c).6 Determine the times of specific events, and join using straight lines. As noted in the previousapproach, the intensity if equal to 1 when the planet is outside the star, and equal to Imin whenthe planet is fully in front of the star. The transition between these intensities occurs as theplanet crosses the border of the star. In this approach, you will need to determine the time(relative to some starting time) When the planet is just inside the star, and just outside thestar, on each side of the star. These positions are shown in Fig. 1(b) and Fig. 1(c).If you are unsure of what your graph should look like, then we recommend that you do some researchon the Kepler mission.Some extra notes on Python graphing: Python sometimes plots a graph using an offset. For example, for an axis with limits of 0.999 -1.000, Python may create a graph with the axis running from 0 – 0.001 with an offset of +0.999.To avoid this use the Python command: ticklabel_format(useOffset=False) If you want to specify the horizontal axis limits, use the command xlim(lowerlimit,upperlimit)and if you want to specify the vertical axis limits, use the command ylim(lowerlimit,upperlimit),where you choose lowerlimit and upperlimit yourself (put some numbers in to see how it works).6 Specifications for your submitted fileThe file you submit for this assignment must be an interactive Python program which models certainaspects of the search for exoplanets and other civilisations in our galaxy.Specifications about the Python: Museum staff have supplied a flowchart describing how the program should run (Figure 2).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 a number, and youcan store their answer as a float. 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 call these functions in your code as appropriate. You may define other new functionsas needed.7(a) You must define a function called get_period_of_planet which takes two arguments, thedistance from the exoplanet To its star and the velocity of the exoplanet (in that order),and returns the period of the orbit of that exoplanet around its star.(b) You must define a function called get_transit_time which takes two arguments, thevelocity of the exoplanet and the radius of the star (in that order), and returns the timetaken for the exoplanet to transit across the front of its star.(c) You must define a function called get_min_rel_intensity which takes two arguments,the radius of the exoplanet and the radius of the star (in that order), and returns theminimum relative intensity of the light from that star during the exoplanets transit acrossthe star.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 museum staffwho may need to maintain and modify the code. Any variable names and function names youdefine should be chosen with communication in mind. Whenever you produce a Graph you should provide appropriate labels and explanatory text.File type and file name: Your assignment should be saved as a .py file. The file should be calledInteractiveSpaceAliens********.pywith the string ******** replaced by your student number. When you are writing one long program as a .py file, it is usually easiest using Spyder, ratherthan Jupyter. To access Spyder, simply open Anaconda and then click Launch under theoption for Spyder.References[1] Glade, N., Ballet, P. and Bastien, O. (2012) A stochastic process approach of the drake equationparameters. International Journal of Astrobiology, Vol. 11(2), pp. 103108.[2] Cleary, D. (2018). Planet hunter nears its end: Kepler space telescope found trove of exoplanets.Science, Oct 19, 2018, Vol. 362(6412), p. 274(2).8Print a welcome message that is appropriate for all patrons. Prompt the user to enter their Patron typePrint an intro about other planets and other potential civilisations in our galaxyAsk the user if they want to try again with another exoplanet searchAsk the user what they think is the proportion (or percentage)of habitable planets that develop technological civilisationsCalculate and print N using their estimates, with a useful messageYesNoPrint a farewell messageYesAsk the user for the relative size of the planet they want to find (relative to Earth)Ask the user for the distance of that planet to its star (relative to Earths distance from the sun)Calculate the period For the planets orbit using get_period_of_planetCalculate the transit time for the planet using get_transit_timeCalculate the minimum relative intensity of the planet using get_min_rel_intensityPrint each of these values for the user with useful messagesIf user is anenthusiast?Calculate the intensity of light from the star for aseries of times and store these values in an array.Plot a graph of the intensity of light from the starover time as the planet transits across the star.NoInform the user whether their chosen planet could be detected or notIntroduce the idea of searching for planets around stars other than our ownWrite a short paragraph about a limitation of themodellingAdvanced sectionFigure 2: Flowchart for theInteractive program (shaded section indicates the advanced section).9Assignment GradingYour 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)如有需要,请加QQ:99515681 或邮箱:99515681@qq.com

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