代写MATLAB & Numerical methods – Summative Assessment Semester 2 2024/25代做Matlab编程

2025-06-03 代写MATLAB & Numerical methods – Summative Assessment Semester 2 2024/25代做Matlab编程

MATLAB & Numerical methods – Summative Assessment Semester 2 2024/25

Problem: The following reaction scheme is for a batch reactor operated under isothermal conditions. Solve the resulting system of ODEs using MATLAB and Simulink

Assuming mass action kinetics, this yields the following system of ODEs

Given the initial concentrations of the reactant species are A = 1, B = 1, C = 1 mols, your tasks are as follows

(a) Solve the first 2 time points, given a step size of 0.1, for each of the differential equations using the Euler’s method calculation that you were shown you how to do by hand in Semester 1. These will need to be solved sequentially in the order presented in the table below (i.e. You will first need to solve [A] @ t=0.1 and then go on to solve of [B] @ t=0.1 etc.. Once you have completed this task you should be able to complete the first 2 empty rows of the Table 1.

Table 1: Template table for Euler’s method calculation values

t

[A]

[B]

[C]

[D]

0

1

1

1

0

0.1

0.2

60

(b) Develop a Simulink model to simulate the system of equations and plot the concentration of each species over time. You should use a Fixed-step Solver: ode1 (Euler); with a Fixed-step size 0.1.

(c) The next task is to write the MATLAB code to solve this problem using the odes45 function. For this second simulation use the initial conditions A = 1, B = 2, C = 1 mols. This will require you to generate a script. file and a function file containing the system of ODEs to pass to the ode45 function in your script. (similar to the example in slide pack 5 of the lecture notes).

This is an individual project. The maximum report length is 5 pages (the report should be typed with size 12 font, single line spacing and any graphs that are included should be of high quality; i.e. not in the default dark colours of the scope object, they can be changed in scope settings). The Simulink model file and MATLAB files created should be uploaded in a zip folder using the dedicated upload box for the code.

Deliverables

1. Provide Euler’s hand calculations (typed using the equation editor in MS Word) for the first 2 rows of the table. Any 2 example calculations will be sufficient to include in the report alongside the completed tables and will ensure unique reports. [10 marks]

2. Use Simulink to solve the system of ODEs. Include the Simulink block diagram on a full side of A4 (with all signals labelled) in the main body of the report along with the output graph showing the change in time of the 4 species. Provide the 1st 5 and last 5 rows of the matrix of concentrations in a table. [15 marks]

3. Develop the MATLAB code to solve the system of ODEs an provide the annotated (commented) script. and function files that you developed in the main body of the report along with a single output plot of the 4 species. Provide the 1st 5 and last 5 rows of the matrix of concentrations in a table from the variable step size solver ode45. [15 marks]

4. Develop the code to store a structured array of the output data and provide the annotated (commented) script. you used to do so in the main report [10 marks]

5. Provide 3 bullet points reflecting on what you have learned when completing this assignment. You should focus on the dynamic response of the species and how they are impacted by the chance in initial conditions of the system. Marks will also be awarded in this section for presentation and layout of the report to a professional standard and ability to follow instructions. [10 marks]