All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
LS DYNA – Python for Mechanical EngineersBy Enos LeslieMechanical Engineer2nd October 2024AIMThis project aims to write a code in Python to solve and plot an otto cycle and solve for its thermal efficiency. PROCEDUREThe Otto cycle is an air-standard cycle, we will assume the gamma value to be 1.4. At the initial…
Leslie Enos
updated on 02 Oct 2024
LS DYNA – Python for Mechanical Engineers
By Enos Leslie
Mechanical Engineer
2nd October 2024
AIM
This project aims to write a code in Python to solve and plot an otto cycle and solve for its thermal efficiency.
PROCEDURE
The Otto cycle is an air-standard cycle, we will assume the gamma value to be 1.4. At the initial condition, we set the values of T1 and P1 as 400K and 101.325 kPa, respectively. The geometric parameters—stroke, diameter, connecting rod length, and crank start/end angles—are defined within the program. Based on these parameters, the clearance volume (v_c) and swept volume (v_s) are calculated. The remaining states are determined using the adiabatic process and the ideal gas law. Similarly, the thermal efficiency is computed using the corresponding formulas. To plot the pressure-volume (P-V) diagram, the plt.plot command from the matplotlib.pyplot module is used. For the compression phase, the crank angle ranges from 180 to 0 degrees, and for the expansion phase, it ranges from 0 to 180 degrees. We will iterate 30 times, creating an empty set to store the calculated values using the append command.
PYTHON CODE
RESULTS
Thermal efficiency is: 0.6298928275128466
62.9%
CONCLUSION
The p-v diagram above was successfully created and the thermal efficiency of the engine was found to be 62.9%
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Week 3 - Solving second order ODEs
Python for Mechanical EngineersBy Enos LeslieMechanical Engineer23rd October 2024AIMThis project aims to write a code in Python to simulate the behaviour of simple pendulum using ODE and animate it. PROCEDUREInitially, the math, matplotlib, numpy, and scipy modules were imported for their respective functionalities.…
23 Oct 2024 01:09 PM IST
Week 2 Air standard Cycle
LS DYNA – Python for Mechanical EngineersBy Enos LeslieMechanical Engineer2nd October 2024AIMThis project aims to write a code in Python to solve and plot an otto cycle and solve for its thermal efficiency. PROCEDUREThe Otto cycle is an air-standard cycle, we will assume the gamma value to be 1.4. At the initial…
02 Oct 2024 03:07 PM IST
Week - 4 - Crash Box Simulation
LS DYNA – Crush SimulationBy Enos LeslieMechanical Engineer18th August 2024OBJECTIVEThe project aims to understand the crashworthiness of the crash box design and evaluate the effect of thickness on its energy absorption and structural integrity during an impact.PROCEDUREThe crush box is made up of a shell rectangular…
18 Aug 2024 06:16 PM IST
Bird Strike - Project - 2
LS DYNA – Bird StrikeBy Enos LeslieMechanical Engineer 09th August 2024Bird Strike in Aero EngineThis is a classic nonlinear transient dynamics problem similar to car crash and mobile drop. While accurate modelling of the problem requires advanced techniques such as SPH, this problem can be solved using generic…
11 Aug 2024 04:28 PM IST
Related Courses
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.