```
Efficiency = (Work Output) / (Heat Input)
```
where:
Work Output is the amount of work produced by the engine, measured in joules (J).
Heat Input is the amount of heat energy supplied to the engine, measured in joules (J).
To calculate the work output of a diesel engine, you can use the following formula:
```
Work Output = (Torque x Angular Displacement) / Time
```
where:
Torque is the twisting force produced by the engine, measured in newton metres (N·m).
Angular Displacement is the amount of rotation of the engine crankshaft, measured in radians (rad).
Time is the amount of time taken for the crankshaft to rotate through the angular displacement, measured in seconds (s).
To calculate the heat input to a diesel engine, you can use the following formula:
```
Heat Input = (Fuel Mass Flow Rate x Lower Heating Value)
```
where:
Fuel Mass Flow Rate is the amount of fuel consumed by the engine, measured in kilograms per second (kg/s).
Lower Heating Value is the amount of heat energy released when one kilogram of fuel is burned completely, measured in joules per kilogram (J/kg).
Once you have calculated the work output and heat input, you can substitute these values into the efficiency formula to calculate the efficiency of the diesel engine.
For example, if a diesel engine produces 200 N·m of torque, rotates its crankshaft through 2π radians in 1 second, and consumes 0.1 kg/s of fuel with a lower heating value of 42 MJ/kg, then its efficiency can be calculated as follows:
```
Work Output = (200 N·m x 2π rad) / 1 s = 1256.64 J
Heat Input = (0.1 kg/s x 42 MJ/kg) = 4.2 MJ/s
Efficiency = (1256.64 J / 4.2 MJ/s) = 0.299
Therefore, the efficiency of the diesel engine is 29.9%.
```