Project

Week 2 Air standard Cycle

*********** Comments by Grader ************

1. The formula for thermal efficiency is wrong. The correct formula is, '1 - (1/cr^(gamma - 1))'.

Marks have been deducted for the above reason.

SUGGESTION :

The other thing that you can do is to attach the code and images in projects.skill-lync.com and paste the link over here.

If you have any doubts please ask us on WHATSAPP or raise a ticket on FRESHDESK or even you can CALL us clarify all your doubts.

Please don't submit incomplete work as these challenges are made with an intuition of improving your understanding regarding the topic.

So attempt all challenges sincerely.

Thank you.

At first I defined the values of inputs (gamma,t3). Then the state variables (p1,t1) and Engine Geometric Parameter (bore,stroke,connecting rod,Compression Ratio).

After the I defined the formulas to calculate swept volume,clearance volume ,volume 1 volume 2.

Then for calculating the values for the second point in the otto cycle i defined the formulas for p2,t2,V_Compression and P_Compression. As the engine is in Compression cycle i gave the value stroke from 180 to 0.

Next for state variable 3, I defined the value of v3 and p3.Then I defined the formula to calculate the value for V_Expansion and P_Expansion.

Finally I defined the value of v4 and formula for p4.

Then I plotted the four points with red color. After that I used plot command to connect the first and second point using two arrays P_compression and V_Compression. Next I connected the 2nd and the third point with a vertical line as there is no change in the volume. Then i connected the 3rd and 4th point using the function to indicate volume is expanding. Then I connected the 4th and 1st point with a vertical line indicating that there is no change in the volume.Then I labelled the x and y axis with volume and pressure.

Then to calculate the thermal efficiency of the engine I used the formula

Where r is the compression ratio and γ is the specific heat ratio of the gas in the combustion chamber. As the value of γ for combustion products of the fuel/air mixture is often taken as approximately 1.3.I defined it as 1.3 and calculated thermal efficiency as 52.55%.

In the main Program I called a function named as engine_kinematics.

In the program of the function, I first defined the values of bore,stroke,compression ratio and the connecting rod.Then I defined the formulas to claculate crank pin radius and R. After that I defined the formulas to calculate swept volume and clearance volume. Then to defined the theta value I used a linspace command and defined from 0 to 720 with 720 no of divisions.

Finally to calculate the volume of compression I defined the final formula. I spilt the final formula into three terms and finally calculated the value of compression volume.

The error that I faced during this particular task is shown in the below image.

I searched online for the problem. I found out that while a function runs it has return some output but due to use of clear all command in the start of the command it did'nt return any value. So I deleated the first three lines and rectified the program.

clear allclose allclc%Otto Cycle%Input gamma = 1.4;t3 = 2300;%State Variablesp1 = 101325;t1 = 500;%Engine Geometric Parametersbore = 0.1;stroke = 0.1;con_rod = 0.15;cr = 12;%Calculating Swept and Clerance Volumev_swept = (pi/4)*bore^2*stroke;v_clearance = v_swept/(cr-1);v1 = v_swept + v_clearance;v2 = v_clearance;%State Variables for at state point 2p2 = p1*cr^gamma;t2 = p2*v2*t1/(p1*v1);constant_c = p1*v1^gamma;V_Compression =  engine_kinematics (bore,stroke,con_rod,cr,180,0);P_Compression = constant_c./V_Compression.^gamma;%State Variables for at state point 3v3 = v2;p3 = (p2*t3)/t2;constant_c = p3*v3^gamma;V_Expansion =  engine_kinematics (bore,stroke,con_rod,cr,0,180);P_Expansion = constant_c./V_Expansion.^gamma;%State Variables for at state point 4v4 = v1;p4 = p3*(v3/v4)^gamma;figure(1)hold onplot(v1,p1,'*','color','r');plot(V_Compression,P_Compression,'color','b');plot(v2,p2,'*','color','r');plot(v3,p3,'*','color','r');plot(V_Expansion,P_Expansion,'color','b');plot(v4,p4,'*','color','r');plot([v2 v3 ],[p2 p3],'color','b');plot([v4 v1 ],[p4 p1],'color','b');xlabel('Volume')ylabel('Pressure')specific_heat_ratio = 1.3;term1 = specific_heat_ratio-1;term2 = 1/cr^term1;Thermal_Efficiency = 1 - term2;% Defining a funcition for calcuating Volume of Compressionfunction [V_Compression] =  engine_kinematics(bore,stroke,con_rod,cr,start_crank,end_crank)bore = 0.1;stroke = 0.1;con_rod = 0.15;cr = 12;a = stroke/2;R = con_rod/a;v_s = (pi/4)*bore^2*stroke;v_c = v_s/(cr-1);theta = linspace(0,720,720);term1 = 0.5*(cr-1);term2 = R+1- cosd(theta);term3 = (R^2 - sind(theta).^2).^0.5;V_Compression = (1+term1*(term2-term3)).*v_c;end
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.