otto cycle
Objective: clear allclose allclc% inputsgamma=1.4% state variablesp1=101325t1=500t3=2300% engine parametersbore=0.1;stroke=0.1;con_rod=0.15;cr=12;% calculating the swept volume and the clearance volumev_swept=(p1/4)*bore^2*stroke;v_clearance=v_swept/(cr-1);v1=v_swept+v_clearancev2=v_clearancea=stroke/2;theta=linspace(0,360,100);%…