联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Python编程Python编程

日期:2019-11-25 10:04

CIVE285 Coursework 1

Due date and time: Friday 22 November, 23:59

Task

This coursework is to create a Python function for plotting the following three math functions in one figure.

The unit of ?? is radian. The range of ?? that needs to be plotted is [0,???], where ???is the

critical value of ?? when the difference of ??(??) and ??(??) is equal to a given threshold ??.

Mathematically, ???

satisfies the following equation:

??(???) ? ??(???) = ??i.e.,??? =1??ln??2

(4)

You need to create a Python function to plot ??(??), ??(??) and ?(??). Your function should be

named my_plot. The function should take three arguments and be called in the syntax

below:

my_plot(a,b,delta)

where a and b are the parameters of the math functions in Eqs. (1)-(3), and delta is the ??

value in Eq. (4). The expected behaviour and return value of your function is specified below:

? In the two cases (i) and (ii) below,

(i) a>0 and delta>2

(ii) a<0 and delta<2

the function should return a Boolean value ‘True’ and plot ??(??), ??(??) and ?(??) in one

figure in Console.

? Otherwise, when neither (i) nor (ii) is satisfied, the function should return a Boolean

value ‘False’ and print a message in Console saying that the figure cannot be plotted.

CIVE285 Coursework 1

2

You are not allowed to use the NumPy package in your code.

Requirement on the figures plotted:

? The horizontal axis should represent ??.

? The lines should be smooth enough.

? The lines representing the three math functions should be easily distinguishable even if

the figure is printed in black and white later; use appropriate line styles and legend to

achieve this.

? The axes should be correctly labelled.

You can use the following test cases to test your function.

my_plot(-0.5,10,0.1)

my_plot(-0.5,10,2.1)

my_plot(2,25,60)

my_plot(2,25,1.9)

Submission instruction

The my_plot function you created should be placed in a .py file named

mod_xxxx.py

where xxxx is your full Student ID number. In this .py file, your my_plot function should

only be defined but not called; in other words, when the file itself is executed, it should not

plot or print anything in Console. Your code should include detailed comments to help the

readers understand your code.

You need to submit this .py file together with a report.

The report should be in .pdf format. The file name of your report should be in the format of

‘student ID_last-name_first-name.pdf’ with no spaces, e.g., ‘123456789_Ye_Hongbo.pdf’.

Report requirement

The page limit of the report is 3 pages max.

CIVE285 Coursework 1

3

The report should cover:

? Aims: The aims of the coursework.

? Programme design: How the function is designed and structured, including but not

limited to the key variables and key processes used (such as conditional, loops, functions,

modules, packages, and so on).

? Test cases: The test cases as well as the output of each test case.

- The figures should be the direct output of the function calling and should not be

manually edited.

- The figures should have good resolution and thus can be easily read.

- Any texts in the figures should be clear and large enough to read.

? Discussions: Discussions on the results, the coding and debugging process, and anything

you learnt from the process of finishing the coursework.

? Appendix (not counted in the page limit): The source code in your submitted .py file

should be copied to the end of the report. The code must be presented in text format;

snapshots are not acceptable.

Marking scheme

This assignment has a value of 15 points.

? 10 points are on the code and the result of the function calling.

? 5 points are on the report.

Any of the following will cause 0 marks for the coursework.

? Using the NumPy package.

? Not attaching your source code to the end of the report, or not attaching it as texts.

? The source code attached to the end of the report is not the same as the code in the .py

file submitted.

? Exceeding the page limit.

Both the report and code will be a Turnitin assignment, so they will be checked for plagiarism.

Do not copy code from your classmates.


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp