To simulate Otto cycle and visualize its P-V diagram
Objective: #program for otto cycle simulation import math import matplotlib.pyplot as plt #engine parameters bore=0.1 stroke=0.1 cr=12 gamma=1.4 t3=2300 con_rod=0.15 #to calculate swept volume and clearance vs=(math.pi/4)*pow(bore,2)*stroke vc=vs/(cr-1) a=stroke/2 r=con_rod/a #function definition given by formula def engine_kinematics(bore,stroke,con_rod,cr,star_crank,end_crank):…