Challenge

Week 6 - Data analysis

Aim:

Calculate the area under the P-V diagram. P is in column 2 and V is in column 8.

Calculate the power output of this engine. Assume that RPM is 150

This engine consumed 20 micro grams of fuel (per 1 stroke cycle). Calculate its specific fuel consumption.

Program code:

import matplotlib.pyplot as plt
import numpy as np

ct=1
crank=[]
pressure=[]
temperature=[]
volume=[]
for line in open('engine_data.out'):
	if '#' not in line:
		crank.append(float(line.split()[0]))
		pressure.append(float(line.split()[1]))
		temperature.append(float(line.split()[4]))
		volume.append(float(line.split()[7]))
		ct=ct+1

plt.plot(crank,pressure)
plt.xlabel('crank')
plt.ylabel('pressure')
plt.show()
plt.plot(crank,temperature)
plt.xlabel('crank')
plt.ylabel('temperaure')
plt.show()
plt.plot(volume,pressure)
plt.xlabel('volume')
plt.ylabel('pressure')
plt.show()

print(ct)

# area calculation
P=1000000*np.array(pressure)
V=np.array(volume)
area=np.trapz(P,V)
print("Area under PV diagram:Work Done=",area,'Jouls')

#power calculation
power=(area*(1500/60))/1000
print("Engine power:",power,'KW')

#sp fuel consumption 
sfc=20*pow(10,-6)*3600/power
print("specific fuel consumption:",sfc,'g/kw.h')

OUTPUT:

Crank angle Vs pressure plot:

Crank angle Va Temperature plot:

PV Diagram plot:

Area under PV diagram:Work Done= 500.586 Jouls


Engine power: 12.514KW


specific fuel consumption: 0.005753 g/kw.h

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.