Plotting Otto cycle in matlab and find thermal efficency of the engine
Objective: clear all close all clc %defining input variables % problem is solved on per unit mass(kg) basis so no gamma=1.4 cr=6 r=8.314 n=1000/29 % state 1(before compression) parameters p1=100000 t1=300 % maximum pressure is at state 3 p3=3000000 % finding parameters at 1 v1=n*r*t1/p1 % finding parameters at 2 v2=v1/cr p2= p1*r^gamma…