All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Aim : Your code should create a PV diagram Your should output the thermal efficiency of the engine. Solution : The code for the PV diagram is as follows : import math import matplotlib.pyplot as plt #inputs p1=101325 t1=500 gamma=1.4 t3=2300 #Geometric dimensions : bore=0.1 stroke=0.1 con_rod=0.15…
abhijeet dhillon
updated on 18 Jun 2022
Aim :
Your code should create a PV diagram
Your should output the thermal efficiency of the engine.
Solution :
The code for the PV diagram is as follows :
import math
import matplotlib.pyplot as plt
#inputs
p1=101325
t1=500
gamma=1.4
t3=2300
#Geometric dimensions :
bore=0.1
stroke=0.1
con_rod=0.15
cr=12
#volume computation
v_s=(math.pi/4)*pow(bore,4)
v_c= v_s/(cr-1)
v1=v_c+v_s
print(v_s)
#state point 2
v2=v_c
# p2v2^gamma =p1v1^gamma
p2=p1*pow(v1,gamma)/pow(v2,gamma)
rhs=p1*v1/t1
t2= p2*v2/rhs
print(t2)
#state point 3
v3=v2
rhs=p2*v2/t2
p3=rhs*t3/v3
#State 4
v4=v1
p4 =p3*pow(v3,gamma)/pow(v4,gamma)
plt.plot([v1,v2,v3,v4,v1],[p1,p2,p3,p4,p1])
plt.show()
We get the following graph :
The thermal efficiency is given by the following :
def enginekinematics(bore,stroke,con_rod,cr,start_crank,end_crank):
#inputs
p1=101325
t1=500
gamma=1.4
t3=2300
a=stroke/2
R=con_rod/a
sc=math.radians(start_crank)
ec=math.radians(end_crank)
n=10
dth=end_crank-start_crank/(n-1)
v_s=(math.pi/4)*pow(bore,4)
v_c= v_s/(cr-1)
v1=v_c+v_s
V=[]
for i in range(0,n):
theta=sc + i*dth
th1=0.5*(cr-1)
th2=R + 1 - math.cos(theta)
th3=pow(R,2) - pow(pow(math.sin(theta),2),0.5)
th3=pow(th3,0.5)
V.append((1+th1*(th2-th3))*v_c)
print(V)
return(V)
#inputs
p1=101325
t1=500
gamma=1.4
t3=2300
#Geometric dimensions :
bore=0.1
stroke=0.1
con_rod=0.15
cr=12
#volume computation
v_s=(math.pi/4)*pow(bore,4)
v_c= v_s/(cr-1)
v1=v_c+v_s
print(v_s)
#state point 2
v2=v_c
# p2v2^gamma =p1v1^gamma
p2=p1*pow(v1,gamma)/pow(v2,gamma)
rhs=p1*v1/t1
t2= p2*v2/rhs
vcompression=enginekinematics(bore,stroke,con_rod,cr,180,0)
constant=p1*pow(v1,gamma)
P_compression=[]
for v in vcompression:
P_compression.append(constant/pow(v,gamma))
print(t2)
#state point 3
v3=v2
rhs=p2*v2/t2
p3=rhs*t3/v3
#State 4
v4=v1
p4 =p3*pow(v3,gamma)/pow(v4,gamma)
plt.plot([v1,v2,v3,v4,v1],[p1,p2,p3,p4,p1])
plt.show()
We get the following :
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 2 Air standard Cycle
Aim : Your code should create a PV diagram Your should output the thermal efficiency of the engine. Solution : The code for the PV diagram is as follows : import math import matplotlib.pyplot as plt #inputs p1=101325 t1=500 gamma=1.4 t3=2300 #Geometric dimensions : bore=0.1 stroke=0.1 con_rod=0.15…
18 Jun 2022 12:07 PM IST
Bird Strike - Project - 2
Aim : The final submission must include the input file, animation, and a report. - Since this is a quite difficult and involved project, students are advised to log their debugging process and include it in the report. The log is a description of the solution process and challenges encountered along the way. …
17 Apr 2022 05:21 AM IST
Week 1 Understanding Different Battery Chemistry
Aim : 1.Prepare a table which includes materials & chemical reactions occurring at the anode and cathode of LCO, LMO, NCA, NMC, LFP and LTO type of lithium ion cells.Give your detailed explanation on it 2.Compare the differences between each type of Li+ion batteries based on their characteristics Solution :…
08 Mar 2022 03:21 PM IST
Week - 10 Hyperelastic Material Models
Aim : Given the material data below, calculate the Mooney Rivlin and Ogden material constants and compare the both using stress-strain data from a Dogbone specimen tensile test with 100 percent strain. The given data is the engineering stress-strain in MPa/(mm/mm). The comparison should be shown from the d3hsp file and…
27 Feb 2022 05:08 AM 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.