Mechanical Engineering and Practice Skills I – MECH0004
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
Mechanical Engineering and Practice Skills I – MECH0004
Coursework
Release Date: 17th March 2023
Submission Deadline: 28th April 2023 at 14:00.
Estimated Feedback Return: 20 days
Topics Covered: Applied Programming
I. Submit:
1. A single Jupyter Notebook document (with format .ipynb) with questions in ascending order. Explain in detail the physics and the mathematical steps behind each question in Markdown cells and write the code in Code cells that solves them. Remember to comment on your code, explaining your steps.
2. The (.csv) dataset file you collected during the Stirling Engine Data collection lab session.
II. Do not write down your name, or student number, or any information that might help identify you in any part of the coursework. Do not write your name or student number in the title of your coursework document file. Do not copy and paste the coursework questions into your submission – Simply rewrite information where necessary for the
sake of your argument.
III. For writing mathematical equations in Markdown cells, the linkherecould help.
IV. Aside from the data collection sessions, this is an individual report and you should work individually on each question and submit a single Jupyter Notebook document that has all your attempts for all questions.
V. For downloading your completed Jupyter file, use the “File” tab from Jupyter Notebook’s navigation bar, choose “Download As” option and then choose the “ .ipunb” type of format to download your submission.
This coursework counts towards 15% of your final MECH0004 grades and comprises of one problem with two questions. Question 1 is worth 25 marks and Question 2 is worth 75 marks. In total, the coursework has 100 marks.
---------------------------------------------------------------------------------------------------------------------------
On Academic Integrity (Read more about ithere)
Academic integrity means being transparent about our work.
Research: You are encouraged to research books and the internet. You can also include
and paraphrase any solution steps accessible in the literature and online content if you reference them.
Acknowledge others: We are happy when you acknowledge someone else's work.
You are encouraged to point out if you found inspiration or part of your answers in a
book, article or teaching resource. Read more about how to reference someone else's
workhereand how to avoid plagiarismhere.
Ask good questions to your peers: These include but are not limited to questions like
"What is the best mathematical method for this question?", "Should I review any books/materials/videos?", "Which Python function/method/command did you use for this problem?", "How was the structure of your Python code?".
Be helpful and ethical when answering questions from your peers: These include "I
think that it would be helpful to review X video, Y page of the slides/notes". "I found this good video online", "I used X Python function, structured that way".
Do not share and do not copy: We expect students not to share and not to
copy assessment solutions or Python code from their peers, even if partially. Do not publish MECH0004 assessment material: We expect students not to
share MECH0004 assessment materials at external online forums, including tutoring or "homework" help websites.
Students found in misconduct can receive a 0 mark in that assessment component and have a record of misconduct in their UCL student register. In some extreme cases, academic misconduct will result in the termination of your student status at UCL.
The Problem: Stirling Engine
A Stirling engine, formulated by Robert Stirling in 1816, is a heat engine that uses cyclic compression and expansion of a gas at different temperatures to convert heat energy into mechanical work at a certain frequency. An external heat source is used to vary the temperature of the gas and create a thermal difference, e.g., a hot cup of water or ice cubes. The gas expands when heated and compresses when cooled, thus generating motion through the changing temperature of the piston, which would in turn triggers the flywheel to start rotating.
A full cycle of the engine is shown in Figure 1. It can be noticed that the engine goes through four main states; state 1, state 2, state 3, state 4, until it starts again from state 1.
State
Figure 1: The full cycle of Stirling engine. Here we have: P(Pa) is the pressure, V(m3 ) is the
volume, Tc(K) is the temperature of the cold surface, and Th(K) is the temperature of the hot
surface. The main parts of the Stirling engine are: Flywheel, piston, air-tight cylinder filled
with gas, and the displacer.
Question 1: Ideal Stirling Engine [25 marks]
The ideal Stirling engine represents an engine with an ideal gas filled in the air-tight cylinder. In this question, you will analyse the dynamics of the ideal gas inside the air-tight cylinder and explain the physics and mathematics at each state of the engine’s cycle.
a) Suppose the gas inside the air-tight cylinder is an ideal gas, then the state variables are related by the ideal gas equation given by:
PV = nRT Eq. 1
Here, we have: V (m3) is the volume of the gas, P (Pa) is the pressure, T (K) is the
temperature, R = 8.314 ( . K) is the gas constant, and n (mole) is the number of gas
moles. Assuming that n = 1 mole for simplicity, discuss, in a Markdown cell, the gas’s pressures (P1, P2, P3, P4), volumes (V1, V2, V3, V4), and temperatures (T1, T2, T3, T4) at each state of the engine’s cycle, and write down their relevant equations. (7 marks)
b) Using the equations derived in (a), and assuming that P1 = 1 bar, V1 = 0.0005 m3, V2 = 0.0004 m3, Tc = 200 C, and Tℎ = 700 C, write a code that does the following:
i. Create two lists for the gas pressure and volume within one engine cycle, i.e., state 1 → state 2 → state 3 → state 4 → state 1. (2 marks)
ii. Plot of the P − V dynamics per one cycle. Remember to put all necessary information on the figure. (4 marks)
iii. In a Markdown cell, discuss the plot and explain in detail the cycle’s thermodynamics in each state. (2 marks)
c) The work done by/on a gas changing from an initial volume Vi to a final volume Vf is given by the general formula:
vf vf
wi→f = ∫ P dV = ∫ dV
Eq. 2
vi vi
i. In a Markdown cell, show that the work done by/on the gas in each state of the engine’s cycle is given by the following equations:
1→ 2 = R TC ln (), 2→ 3 = 0, 3→4 = R Tℎln (), 4→ 1 = 0.
Discuss the values and signs of each equation. (8 marks)
ii. Write a code that computes the total work, Tot, done by the gas per engine’s cycle where: Tot = 1→ 2 + 2→ 3 + 3→4 + 4→ 1 . (2 marks)
Question 2: Real Stirling Engine [75 marks]
All the values you have obtained in the previous question are for an ideal Stirling cycle with an ideal gas exists in its air-tight cylinder. However, the data you collected during your data collection session at MechSpace, was taken from a real engine that produces an approximate output.
After inserting different sensors into the Stirling engine and connecting them to an Arduino microcontroller, a dataset of four different physical quantities, similar to the below table, should have been collected during a certain period of time.
Number of Features
Time |
Upper Temperature |
Lower Temperature |
Trigger |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
In this question, you will be analysing this dataset and its features and explaining the physics behind them using Python programming language.
a) Explanatory Data Analysis:
To explore the datasets, perform the following data explanatory steps in your Jupyter notebook:
i. Import the necessary libraries. (3 mark)
ii. Import the data .csv file. (1 mark)
iii. Show the first ten observations of the dataset. (1 mark)
iv. Show the shape of the dataset. Add a comment to indicate the number of rows (readings/samples), and columns (features/attributes) your dataset has. (2 marks)
v. Generate a descriptive statistics of the dataset. (1 mark)
vi. How many missing data are there in each feature column? If there are missing values, drop all rows that have them. (2 marks)
vii. Extract the dataset features and rename them as new series. (4 marks)
viii. Convert the time series from milliseconds to seconds. (2 marks)
ix. Convert the temperature series from degrees Celsius to Kelvin. (2 marks)
x. Calculate the absolute temperature difference between the upper and lower surfaces. (1 mark)
xi. Visualise in subplots, using plot command, the behaviour of trigger, upper temperature, lower temperature, and the temperature difference as a function of time. Remember to add all relevant information to the plots. (6 marks)
xii. In a Markdown cell, explain in two sentences the pattern each plot exhibits.(1 mark)
b) Flywheel Kinematics:
The Stirling engine flywheel has n = 6 equally spaced spokes with length T (mm) and width d(mm) each. Once the thermal difference between the cold and hot surfaces of the air-tight cylinder exists, the flywheel is triggered and starts rotating about its fixed axis with an angular velocity rad(rad. sec−1). One of the features you collected of the Stirling engine is the “trigger” data, which corresponds to the infrared beam being broken by one of the spokes as it turns one complete revolution (say the red spoke in the figure on the right). Answer the following questions to analyse the dynamics of the flywheel:
Flywheel
i. Write a code that computes the time each revolution takes and store the results in a list. (8 marks)
ii. How many revolutions your Stirling engine had done? (1 mark)
iii. Compute the instantaneous angular velocity rad(rad. sec−1) at each revolution which is given by:
rad(rad. sec−1) = Eq3
and store the results in a list. (5 marks)
iv. Plot the instantaneous angular velocity rad(rad. sec−1). In a Markdown cell, explain its overall trend. (5 marks)
v. Convert the angular velocity rad(rad. sec−1) to RPM (rev. min−1) data and plot it. Explain the trend shown in the plot. (10 marks)
vi. Assume the spoke is reduced to its half-length. How does this affect the engine’s angular velocity (or the RPM)? (2 marks)
vii. Assume the spoke’s width is doubled. How does this affect the engine’s angular velocity (or the RPM)?(2 marks)
c) Heat Engine Efficiency
A cornerstone in thermodynamics is the analysis of the performance of heat engines. In the case of Stirling engine, heat is transferred from the hot surface to the engine. Some of this energy leaves the engine as a useful mechanical work that rotates the flywheel, and some of it leaves as heat transfer to the cold surface of the engine. Based on the first law of thermodynamics, the amount of heat emerging from the hot surface should equal to the sum of the resulting mechanical work and the heat transfer to the cold surface. If this heat is transferred fully to a mechanical work without any heat transfer to the cold surface, we say that the engine has an efficiency of 1. Similarly, if the amount of heat is transferred fully to the cold surface without any mechanical work, then the engine’s efficiency is 0.
To calculate the efficiency of your Stirling engine, you will be computing two efficiency values:
Carnot efficiency: which represents the theoretical maximum possible
efficiency which can be obtained by a given thermodynamic cycle. Carnot efficiency is given by:
Tc
Th
Where Tc(K) and Th(K) are the cold and hot surface temperatures, respectively.
Chambadal–Novikov efficiency: which gives a much more realistic estimate of
what can be attained from a given thermodynamic cycle. Chambadal–Novikov efficiency is given by:
ChamNov = 1 − √ Eq6
In your Jupyter notebook:
i. Create a function that has two inputs: Tc(K) and Th(K) and does the following:
1. Calculates the Carnot efficiency, and prints its maximum value.
2. Calculates the Chambadal–Novikov, and prints its maximum value.
3. Visualises, using Scatter plot, both efficiencies as a function of the thermal difference: ΔT = Th − Tc in a subplot figure. (13 marks)
ii. In a Markdown cell:
1. Explain the patterns seen in the efficiency plots.
2. Suggest two ideas to increase the Stirling engine efficiency.
3. Propose two ideas to optimise the engine’s design. (3 marks)
2023-04-15