pv diagram visualiser for otto cycle
Objective: %complete otto cycleclear allclose allclc%state variablesp1=101325;t1=500;gamma=1.4;t3=2300; %engine geometroc parametersbore=0.1;stroke=0.10;con_rod=0.15;cr=12;%swept vol and clearance volv_swept=(pi/4)*bore^2*stroke;v_clear=v_swept/(cr-1);v1=v_swept+v_clear;v2=v_clear; %state variables at point 2p2=p1*cr^gamma;t2=p2*v2*t1/(p1*v1);constant_c=p1*v1^gamma;v_comp=engine_kinematics(bore,stroke,con_rod,cr,180,0)p_comp=constant_c./v_comp.^gamma%at…