Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

EEEE2055: Modelling Methods and Tools

Coursework 2 – Spring 2023

Numerical Integration and Techniques

Coursework 2 is on the data processing and analysis of numerical integration techniques. The task accounts for 80% of the total mark.

Presentation and formatting of your report account for 20% of the total mark. 

Your answers for this coursework should be submitted on Moddle by 15:00, Monday 8th May 2023 

1. Late submission will be penalized for 5% per day. No marks for more than 7 days late.

3. Handwritten answers are accepted. Please scan and convert them into a pdf file. (Please make sure your answers are clearly readable, otherwise, you will lose the corresponding marks!!!)

Prerequisites

PyCharm for Python. Please download and install “Anaconda” from the website directly: https://www.anaconda.com. Through Anaconda, you can install PyCharm Community Edition (Free) and create a new Python environment (Python3 recommended). Considering different systems, you may find the guidelines below helpful.

1. https://docs.anaconda.com/anaconda/user-guide/tasks/pycharm/

2. https://medium.com/@GalarnykMichael/setting-up-pycharm-with-anaconda-plus-installing-packages-windows-mac-db2b158bd8c

Task description

In the file “2058-coursework”, there are five .txt files and one .py file.

Each .txt file (e.g. “random_data1.txt”) contains two columns of data. The data in the first column are the randomly chosen  value (where ), while the data in the second column are the corresponding  value (where ). The total number of random data varies from each file.

The .py file is a python script file and it is a template for you to use. The template includes the codes for you to read the data from the .txt file and plot the numerical results. Do not change anything in the template unless you are told to replace the values or variables in the comments. What you need to do is to insert your codes at the right place (implement the calculation of different numerical integration methods) and successfully run the coding.

Step 1:  Calculate the integration of exponential function  on the domain , set the analytical result, which is also the reference result.

Step 2: Based on the template, use the linear interpolation method to process the original data. (You can find the corresponding function in the Numpy package) [10%]

Step 3: Based on the template, fulfil the function to calculate the numerical integration based on the Trapezoidal rule and Simpson’s rule. You need to program by yourself and not use the integrated numerical function in other packages (such as the function simpson in Scipy). [40%]

Step 4: If there is no bug in your codes, the program will automatically plot your results and save them as an image after you run it. You can check whether the results are correct or not.

Step 5: Use your program to compute the numerical integrations through different input data, by changing the name of the input file in the template.

Step 6: Finish a report to  [30%]

1. Demonstrate the key procedures,

2. Insert the results (five images)

3. For the numerical results based on the random_data, calculate the relative errors considering different integration methods and intervals.

4. Analyze the effects of the original data, interpolation intervals, numerical integration methods (or anything else you discovered)

Step 7: Submit your report (in the name “EEEE2058-id-report”)  and the moderated .py file (in the formation “EEEE2058-your name-id.py”) separately into different submission boxes(which will be created after the release of this coursework).

Presentation and report formatting

The report should have a logical structure throughout, a title/cover page, pagination, table of contents, sections and appendixes clearly labelled.

Written explanations should be relevant, clear, and easy to understand without spelling mistakes.

Figures, plots, and tables should be enumerated and must have captions.

Include an explanation (minimum of 1 paragraph) of what is shown in each figure/plot included. Cross references should be used consistently when commenting or referring to figures, plots, or tables.

Where external sources are used, correct referencing and citation should be conducted using an appropriate referencing style (e.g., IEEE referencing style).

The pages for the report should be no more than 10.