All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Objective: Task is to write a script that does the following. Data visualizer: Your script should take column numbers as the input and plot the respective columns as separate images Each file should be saved by the name of the column The plot labels should be extracted from the file. If, I request for a plot between column…
Nashit Ahmad
updated on 10 Nov 2019
Objective: Task is to write a script that does the following.
Data visualizer:
Compatability check:
Basic performance calculation:
Brief:
In the field of automation, an automation engineer has to analyse all kinds of data in order to optimize the best values for the system. Here we have the engine geometery to compute the temperature, crank an all other elements to plot the ideal graph. And we are using file parsing method to get all the values. We have an .OUT data file where we get all the geometrey parameters and to proceed we have to wrte a script in python. Below is the image of DATA file we have.
Original Coding:
\"\"\"
Data analysis on engine geometery
\"\"\"
import matplotlib.pyplot as plt
import numpy as np
import math
# given all geometeric parametres
crank = []
pressure = []
max_press = []
min_press = []
mean_temp = []
max_temp = []
min_temp = []
volume = []
mass = []
density= []
inte_hr = []
hr_rate = []
c_p = []
c_v = []
gamma = []
kin_visc = []
dyn_visc = []
try:
open(\'engine_data.out\')
# Compatablity check
except wrong_imput:
print(\'File not recognized. Please provide a valid converge output file\')
for line in open(\'engine_data.out\'):
if \'#\' not in line:
crank.append(float(line.split()[0]))
pressure.append(float(line.split()[1]))
max_press.append(float(line.split()[2]))
min_press.append(float(line.split()[3]))
mean_temp.append(float(line.split()[4]))
max_temp.append(float(line.split()[5]))
min_temp.append(float(line.split()[6]))
volume.append(float(line.split()[7]))
mass.append(float(line.split()[8]))
density.append(float(line.split()[9]))
inte_hr.append(float(line.split()[10]))
hr_rate.append(float(line.split()[11]))
c_p.append(float(line.split()[12]))
c_v.append(float(line.split()[13]))
gamma.append(float(line.split()[14]))
kin_visc.append(float(line.split()[15]))
dyn_visc.append(float(line.split()[16]))
# Basic performance calculation
# plotting of PV diagram and pressure vs crank graph
plt.figure(1)
plt.plot(volume, pressure, linewidth = 3)
plt.xlabel(\'Volume [m^3]\')
plt.ylabel(\'Pressure [bar]\')
plt.title(\'PV diagram\')
plt.grid()
plt.show()
plt.figure(2)
plt.plot(crank, pressure, linewidth = 3)
plt.xlabel(\'Crank angle [deg]\')
plt.ylabel(\'Pressure [bar]\')
plt.title(\'Crank vs Pressure diagram\')
plt.grid()
plt.show()
# calculating area under PV plot
area = np.trapz(pressure, volume)
print(\'Area under PV diagram (m^2)\', area)
# calculating power output
rpm = 1500 # assuming the data
rps = rpm/60
power = area*rps*1000
print(\'Power output of an engine (W) is\', power)
# calculating Specific Fuel Consumption(SFC)
sfc = (20*pow(10,-6)*3600/(0.08*power))
print(\'specific fuel consumption (g/kwh) is\', sfc)
Output:
Now here we have the plot of PV diagram where curve behaves in a strange way that can be shown as below.
And another graph represent the crank vs maximum pressure plot which as shown below.
We have one more ouput where we got results as area under the P-V diagram. P is in column 2 and V is in column 8, Power output of this engine. Assuming the RPM is 1500 and the engine consumed 20 micro grams of fuel (per 1 stroke cycle) having its specific fuel consumption in g/KWh.
Conclusion:
Through data analysis we have plotted the graph with the desirable requirements. With having the ideal graph as PV where curve behaves randomly.
We have calculated the area under the curve PV, Power generation that engine and Specific fuel consumption.
--FIN--
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Week 3 Challenge : CFD meshing on Turbocharger
Objective: For the given model, check for the geometrical errors to make appropriate volumes. Create and assign PIDs as shown in the video. Perform surface mesh with the given target lengths as per PIDs. Blade stage-1 = 1 mm Blade stage-2 = 1 mm Impeller = 2 mm Shaft rotor = 1 mm Turbo casing = 5 mm…
18 Dec 2023 07:20 AM IST
Week 2 Challenge : Surface meshing on a Pressure valve
Objective: For the given model, check for the geometrical errors and perform Topology cleanup accordingly. Set three different target lengths as three different cases and mesh the model. Target length = 1mm, 3 mm, and 5 mm (i.e. 3 cases) Element type = Tria Apply any target length from the above…
07 Dec 2023 10:27 AM IST
External aerodynamics simulation over an Ahmed body.
Objective: As the body is perfectly symmetric, we can run the simulation by considering the only half body. This is the best practice where you can save on the number of cells and get the results faster as well. The geometry which is provided with the challenge needs a modification which you should…
19 May 2022 05:31 AM IST
1D Element Creation Challenge
Objective: Mesh the Given component with the Size of 5 Units. Create 1D elements on the following component with given cross-section and DOF a. Rod element:- Translational DOF should be Constrained with RBE2 link Cross-Section: BOX- Dimension a= 12 mm …
18 May 2022 02:51 PM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.