Project

Data analysis

IC Engine Data analysis using Python

1. AIM : To read the data from the suitable file format and analyse the data,plot the graphs,calculate area under the given curve,power and specific fuel consuption.

2. OVERVIEW :

Data Analysis bascially requires 'Text Parsing' in order to make complex data to easy classification. Text Parsing is a programming task which splits the given sequence of values into smaller parts. Here a data file with different engine parameters are considered. In order to get data from large list of engine parameters, file parsing method is introduced.

Here, for the given input of engine data, the user can automatically obtain the required desired plot with its name and labels as mentioned in the given data file,

https://drive.google.com/file/d/1L8GY56d-M8mB1KfceM-xVhGNvnCIqxjm/view?usp=sharing

2.1 Working formula : -

A= Area under the P-V curve = Work done per cycle (MJ)

Power output = `A*n*10^6`W

n = Number of cycles per second

`n = N/60`for 2-stroke engine

N = Rotations per minute

`"SFC (Specific Fuel Consumption)" = "Fuel consumed in kg/hr" /"Power output i kW"`

3. BODY OF CONTENTENT :

Code :

import math
import matplotlib.pyplot as plt 
import numpy as np 

# importing the engine parameters

Crank = [] # column 1 units- DEG
Pressure = [] # column 2 units- Mpa 
Max_Pres = [] # column 3 units- Mpa
Min_Pres = [] # column 4 units- Mpa 
Mean_Temp = [] # column 5 units- K
Max_Temp = [] # column 6 units- K
Min_Temp = [] # column 7 units- K
Volume = [] # column 8 units- m^3
Mass = [] # column 9 units- kg
Density = [] # column 10 units- kg/m^3
Integrated_HR = [] # column 11 units- J
HR_Rate = [] # column 12 units- J/time 
C_p = [] # column 13 units- J/kg-K
C_v = [] # column 14 units- J/kg-K
Gamma = [] # column 15 -----
Kin_Visc = [] # column 16 units- m^2/s
Dyn_Visc = [] # column 17 units- N*s/m^2

line_count = 1

# Compatability check
try:
	open('engine_data.out')

except:
	print('File not recognised. Please provide 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_Pres.append(float(line.split()[2]))
		Min_Pres.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]))
		Integrated_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]))

		line_count = line_count + 1


# plotting

plt.plot(Volume, Pressure)
plt.title('Volume vs Pressure')
plt.xlabel('Volume (m^3)')
plt.ylabel('Pressure (Mpa)')
plt.grid()
plt.show()

plt.plot(Crank, Pressure)
plt.title('Crank vs Pressure')
plt.xlabel('Crank (DEG)')
plt.ylabel('Pressure (Mpa)')
plt.grid()
plt.show()

plt.plot(Crank, Mean_Temp )
plt.title('Crank vs Mean_Temp')
plt.xlabel('Crank (DEG)')
plt.ylabel('Mean_Temp (K)')
plt.grid()
plt.show()

4. OUTPUT RESUTS :

5. ERROR in compatability check :

Needs proper data file.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.