Project

Data analysis using Python

AIM:

To perform Data Analysis with the given data for the engine by using Python Programming.

DATA ANALYSIS:

Data analysis is a process of inspecting, cleansing, transforming and modeling data with the goal of discovering useful information, informing conclusion and supporting decision-making.

Data analysis is a process of inspecting, cleansing, transforming and modeling data with the goal of discovering useful information, informing conclusion and supporting decision-making. Data analysis has multiple facets and approaches, encompassing diverse techniques under a variety of names, and is used in different business, science, and social science domains. In today\'s business world, data analysis plays a role in making decisions more scientific and helping businesses operate more effectively.[1]

Data mining is a particular data analysis technique that focuses on statistical modeling and knowledge discovery for predictive rather than purely descriptive purposes, while business intelligence covers data analysis that relies heavily on aggregation, focusing mainly on business information.[2] In statistical applications, data analysis can be divided into descriptive statistics, exploratory data analysis (EDA), and confirmatory data analysis (CDA). EDA focuses on discovering new features in the data while CDA focuses on confirming or falsifying existing hypotheses. Predictive analytics focuses on application of statistical models for predictive forecasting or classification, while text analytics applies statistical, linguistic, and structural techniques to extract and classify information from textual sources, a species of unstructured data. All of the above are varieties of data analysis.

Data integration is a precursor to data analysis,[according to whom?] and data analysis is closely linked[how?] to data visualization and data dissemination.

DATA VISUALIZER:

PROGRAM FOR THE PARTICULAR METHOD:

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

#IMPORTING THE REQUIRED PARAMETERS:

crank = []
pressure = []
Max_pres = []
Min_pres = []
Mean_Temp = []
Max_Temp = []
Min_Temp = []
Volume = []
Mass = []
Density = []
Integrated_HR = []
HR_Rate = []
c_p = []
c_v = []
Gamma = []
Kin_Visc = []
Dyn_Visc = []

line_count = 1

#CHECKING COMPATABILITY:
try:
	open(\'engine_data.out\')

except:
	print(\'File not recognized.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\')
		plt.ylabel(\'pressure\')
		plt.grid()
		plt.savefig(\'engine_data\')
		plt.show()

		plt.plot(crank, pressure)
		plt.title(\'crank vs pressure\')
		plt.xlabel(\'crank\')
		plt.ylabel(\'pressure\')
		plt.grid()
		plt.savefig(\'engine_data\')
		plt.show()

		plt.plot(crank , Mean_Temp)
		plt.title(\'crank vs Mean_Temp\')
		plt.xlabel(\'crank\')
		plt.ylabel(\'Mean_Temp\')
		plt.grid()
		plt.savefig(\'engine_data.\')
		plt.show()

		



OUTPUT PLOTS:

volume vs pressure:

crank vs pressure:

crank vs mean temperature:

POINTS TO REMEMBER:

  • The file name should be correct otherwise data will not be taken into account.
  • Name of the plots is declared with column names.
  • Column names are taken as the inputs.

COMPATABILITY CHECK:

The file is not recognized since we named it wrongly.This is the method of checking compatibility.

BASIC PERFORMANCE CALCULATIONS:

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

#IMPORTING THE REQUIRED PARAMETERS:

crank = []
pressure = []
Max_pres = []
Min_pres = []
Mean_Temp = []
Max_Temp = []
Min_Temp = []
Volume = []
Mass = []
Density = []
Integrated_HR = []
HR_Rate = []
c_p = []
c_v = []
Gamma = []
Kin_Visc = []
Dyn_Visc = []

line_count = 1

#CHECKING COMPATABILITY:
try:
	open(\'engine_data.out\')
except:
	print(\'File not recognized.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

		#PERFORMANCE CALCULATIONS:
		area = np.trapz(pressure,Volume)
		print(\'Area under P-V =\' , area)

		#POWER OUTPUT:
		rpm = 1500
		rps = 1500/60
		power_watt = area*rps*1000
		power_hp = power_watt/0.746
		print(\'power output of the engine = \',power_watt)
		print(\'power of the engine = \',power_hp)

		#CALCULATION OF SPECIFIC FUEL CONSUMPTION:
		sfc = (20*pow(10,-6)*3600)/ (0.08*power_watt)
		print(\'Specific Fuel Consumption = \' , sfc)


		
		



OUTPUT:

RESULT:

Thus the program is executed for data analysis thereby checking compatibility and performance calculations are done with the desired output.

REFERENCES:

https://en.wikipedia.org › wiki › Data_analysis
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.