Four Stroke Engine Simulator
Otto & Diesel Cycles — Animate • Learn • Practice • Quiz
1 Overview
The Four Stroke Engine Simulator brings the internal combustion engine to life with interactive animation of all four strokes: intake, compression, power, and exhaust. You can switch between the Otto cycle (petrol/spark ignition) and Diesel cycle (compression ignition), adjust compression ratio and RPM, and watch a live PV diagram trace the thermodynamic cycle in real time.
The simulator visualises piston motion, valve timing (intake and exhaust valves opening and closing), crankshaft rotation, and connecting rod kinematics. It calculates thermal efficiency, pressure, and temperature at each point in the cycle, helping you understand the relationship between compression ratio and engine performance.
2 Getting Started
- Select Fuel type: Petrol (Otto cycle) or Diesel to switch between spark-ignition and compression-ignition cycles.
- Adjust the RPM slider to control animation speed.
- Change the Compression Ratio (6:1 to 22:1) and observe how thermal efficiency changes.
- Click Play to start continuous animation or Step to advance one stroke at a time for detailed study.
- The canvas shows the engine cross-section (left) and live PV diagram (right).
3 Simulate Mode
The left canvas renders a detailed engine cross-section with animated piston, connecting rod, crankshaft, intake valve, and exhaust valve. Gas colour changes show the charge state: fresh mixture (blue), compressed charge (orange), combustion products (red), and exhaust (grey). The right canvas traces the PV diagram in real time, with the enclosed area representing net work output.
For the Otto cycle, efficiency = 1 - 1/r^(γ-1), where r is compression ratio and γ = 1.4. For the Diesel cycle, the cutoff ratio ρ introduces additional complexity. Readout cards display current stroke, crank angle, pressure, temperature, thermal efficiency, and cycle type.
4 Explore Mode
Study concepts across four categories: Fundamentals (4-stroke cycle, TDC/BDC, valve timing), Thermodynamic Cycles (Otto, Diesel, dual cycle, air-standard assumptions), Engine Components (piston, connecting rod, crankshaft, valves, cam), and Performance (thermal efficiency, MEP, brake power, volumetric efficiency).
5 Practice & Quiz
Practice generates problems on thermal efficiency, compression ratio, pressure/temperature calculations, and PV diagram interpretation. Quiz tests your understanding with 5 randomised questions.
6 Tips & Best Practices
- Use the Step button to advance one stroke at a time and carefully study valve timing, gas exchange, and PV diagram changes during each phase.
- Compare Otto and Diesel at the same compression ratio to see the difference in PV diagram shape and efficiency.
- Diesel engines use higher compression ratios (14-22) because they need to achieve auto-ignition temperature — increase the ratio and watch temperature rise.
- The enclosed area on the PV diagram represents the net work per cycle — larger area means more work output.
- A complete four-stroke cycle takes 720° of crankshaft rotation (two full revolutions).
- Watch the valve timing carefully — intake valve opens before TDC and closes after BDC for better volumetric efficiency.
How a Four-Stroke Engine Works — Interactive Simulator
The four-stroke internal combustion engine is the most widely used power source in automobiles, motorcycles, generators, and industrial machinery. Each complete power cycle requires four distinct strokes of the piston—Intake, Compression, Power, and Exhaust—corresponding to two full revolutions (720°) of the crankshaft. This simulator lets you visualize every stroke in real time, switch between petrol (Otto cycle) and diesel (Diesel cycle) operation, and adjust parameters like compression ratio and RPM to observe their effects on pressure, temperature, and thermal efficiency.
Understanding the Otto and Diesel Cycles
In a petrol engine, the Otto cycle governs the thermodynamic process. The air-fuel mixture is compressed isentropically, then ignited by a spark plug at top dead center (TDC), producing a rapid constant-volume pressure rise. The thermal efficiency depends only on the compression ratio: η = 1 − 1/rγ−1, where r is the compression ratio and γ is 1.4 for air. Typical petrol engines operate at compression ratios of 8:1 to 12:1, yielding efficiencies of 56–63%.
The Diesel cycle differs in its heat addition process: air alone is compressed to a high temperature (600–900 K), and fuel is injected under pressure, igniting spontaneously. This constant-pressure combustion introduces the cutoff ratio ρ, making the efficiency formula more complex. Diesel engines use higher compression ratios (14:1 to 22:1) and achieve better fuel economy, though the Diesel cycle efficiency for the same compression ratio is slightly lower than Otto due to the cutoff ratio penalty.
Key Engine Parameters
The compression ratio (r = V1/V2) is the ratio of cylinder volume at bottom dead center to top dead center. Higher compression ratios improve efficiency but increase mechanical stress and require higher octane fuel (petrol) or stronger construction (diesel). The mean effective pressure (MEP) represents the average pressure acting on the piston during the power stroke and directly relates to engine torque output. The simulator calculates these values in real time as you adjust the sliders.
Reading the PV Diagram
The pressure-volume (PV) diagram shows the thermodynamic state of the gas throughout the cycle. The enclosed area represents the net work output per cycle. In the Otto cycle, you’ll see two vertical lines (constant-volume processes) connected by two isentropic curves. In the Diesel cycle, the upper horizontal line represents the constant-pressure heat addition phase. Watch the PV diagram trace in real time as the piston completes each stroke.
Worked Otto-Cycle Efficiency — A Petrol Engine with Compression Ratio 10
Take a typical naturally-aspirated petrol engine: compression ratio r = 10, working fluid air (γ = 1.4 for the cold-air-standard analysis), intake conditions T1 = 300 K and P1 = 100 kPa, peak temperature T3 = 2000 K. Load the Otto preset and trace it through:
| Step | Process | Working | Result |
|---|---|---|---|
| 1→2 | Isentropic compression: T2 = T1·rγ−1 | 300 × 100.4 | T2 = 754 K |
| 2→3 | Constant-volume heat addition (combustion): qin = cv(T3−T2) | 0.718 × (2000 − 754) | qin = 894 kJ/kg |
| 3→4 | Isentropic expansion: T4 = T3·(1/r)γ−1 | 2000 × 0.10.4 | T4 = 796 K |
| 4→1 | Constant-volume heat rejection: qout = cv(T4−T1) | 0.718 × (796 − 300) | qout = 356 kJ/kg |
| cycle | Thermal efficiency η = 1 − qout/qin | 1 − 356/894 | η = 0.602 (60.2%) |
| shortcut | Otto efficiency: η = 1 − 1/rγ−1 | 1 − 1/100.4 | 0.602 ✓ |
Three lessons drop out: (i) efficiency depends only on compression ratio and γ — not on peak temperature or pressure; (ii) real petrol engines achieve about 30%, not 60%, because of finite heat-release time, exhaust enthalpy loss, friction, and pumping losses; (iii) the only way to raise Otto efficiency is to raise r, which is limited by knock — the limit at which fuel auto-ignites before the spark. That is why high-octane fuel allows higher compression and therefore higher efficiency.
The Four Strokes — What Actually Happens Each 720° of Crankshaft
One full cycle of a four-stroke engine takes two crankshaft revolutions (720°). At 3000 rpm that is one cycle every 0.04 s. Drag the simulator’s rpm slider to step through the timing:
| Stroke | Piston motion | Valves | What is happening |
|---|---|---|---|
| 1. Intake | TDC → BDC | Intake open, exhaust closed | Cylinder volume grows; atmospheric air-fuel mix is drawn in. Real engines open the intake valve ~10° before TDC for inertial scavenging. |
| 2. Compression | BDC → TDC | Both closed | Mixture is squeezed by ratio r. Temperature rises adiabatically; just before TDC, the spark plug fires (typically 10–30° BTDC). |
| 3. Power (expansion) | TDC → BDC | Both closed | Combustion is complete at ~10° ATDC; the high-pressure gas does work on the piston. This is the only stroke that produces useful torque. |
| 4. Exhaust | BDC → TDC | Intake closed, exhaust open | Burnt gas pushed out. Exhaust valve typically opens ~50° before BDC to let blowdown reduce pumping work. |
The crank-to-cam ratio is 2:1 (the camshaft runs at half engine speed), which is why every other revolution one valve is open. The cam timing diagram is the engineering reality behind the simulator’s mode tabs.
125 cc Motorcycle vs 2 L Sedan — Same Cycle, Different Scale
| Parameter | 125 cc motorcycle | 2.0 L sedan |
|---|---|---|
| Displacement (single-cycle volume) | 125 cm³ | 2000 cm³ (typically 4 cylinders × 500 cm³) |
| Compression ratio | 9.5 : 1 | 10.5 : 1 |
| Bore × stroke | 52.4 × 57.8 mm | ~84 × 90 mm per cylinder |
| Peak power | ~11 kW at 8500 rpm | ~110 kW at 6000 rpm |
| Peak torque | ~10 N·m at 6000 rpm | ~190 N·m at 4000 rpm |
| BSFC (brake specific fuel consumption) | ~340 g/kWh | ~250 g/kWh (more efficient combustion at lower rpm) |
The motorcycle gets ten times the specific power per litre by spinning twice as fast — but it pays for it in fuel consumption. Small-engine high-rpm strategies are common where light weight matters more than absolute efficiency.
Otto vs Diesel — Why They Are Different Cycles, Not Just Different Fuels
Set the simulator to Diesel mode and compare the PV diagram. The compression and expansion strokes are essentially the same; the heat-addition (combustion) stroke is the key difference:
- Otto cycle — constant-volume heat addition. Spark ignites a homogeneous air-fuel mixture; combustion completes in roughly 2–3 ms while the piston is near TDC, so volume is approximately constant. The PV diagram shows a near-vertical line at the top.
- Diesel cycle — constant-pressure heat addition. Air is compressed to ~16 : 1; near TDC, fuel is sprayed and auto-ignites. The injection event lasts longer than the spark, so the piston is already moving down while heat is still being added. The PV diagram shows a near-horizontal line at the top.
- Why diesels are more efficient. A higher compression ratio (16–22 vs 9–12 for petrol) gives a higher cold-air-standard efficiency (η ≈ 65% theoretical for Diesel at r=20 vs 60% for Otto at r=10). In practice, diesels deliver ~40% brake efficiency vs ~30% for petrol.
- Why diesels need higher compression. They have no spark plug — fuel must auto-ignite from the heat of compression alone. Air temperature at TDC must exceed about 850 K, which requires r ≥ 14 or so.
Selected References
- Heywood, J. B. — Internal Combustion Engine Fundamentals, 2nd ed., McGraw-Hill, Chapters 1, 5 and 9. The definitive engineering text for IC engines.
- Cengel, Y. A. & Boles, M. A. — Thermodynamics: An Engineering Approach, 9th ed., Chapter 9 (Gas Power Cycles).
- SAE J1995 — Engine Power Test Code — Spark Ignition and Compression Ignition — Gross Power Rating. Defines the conditions under which an engine’s “peak power” spec must be measured.
- ISO 1585 — Road vehicles — Engine test code — Net power. The European equivalent.
Explore Related Simulators
If you found this four-stroke engine simulator helpful, explore our Two Stroke Engine Simulator, Thermodynamics Simulator, Heat Transfer Simulator, and Stress-Strain Diagram for more hands-on practice.