For the dynamic characteristics and speed-control logic of the diesel power unit, the MATLAB/Simulink environment is adopted to carry out modular design of the diesel engine simulation model. The modeling process follows the core principles of modular partitioning, standardized interfaces, and portability. An integrated simulation model is built around the intrinsic dynamic characteristics of the diesel engine, with each functional module independently computed to facilitate debugging and optimization. The model is encapsulated via unified interfaces, providing a standardized carrier for subsequent embedded automatic code generation.
The diesel engine model developed in this study is parameterized for a medium-speed, four-stroke marine diesel engine with the following key specifications: rated power of approximately 2000 kW, rated speed of 1000 rpm, cylinder configuration of eight cylinders in V-arrangement, bore of 280 mm, stroke of 320 mm, displacement per cylinder of approximately 19.7 L, and compression ratio of 14.5:1. This model is applicable to speed-control studies within the rotational speed range of 400–1000 r/min. Simulation results obtained outside this calibrated operating envelope should be interpreted with caution.
The diesel engine simulation model is decomposed into two core submodules—the governor and the turbocharger—according to the configuration of the power system. Additional dynamic modules, such as inertia, friction torque, and indicated torque, are integrated. The modeling is accomplished by combining theoretical equations with engineering data, thereby reproducing the diesel engine’s power output and transient dynamic response characteristics.
4.2. Turbocharger Model
The turbocharger sub-model is constructed based on aerothermodynamic equations and rotor dynamics equations to simulate the energy conversion and rotational speed response characteristics of the compressor and turbine. The speed response of the turbocharger rotor is governed by its dynamic equation:
In the equation, is the turbocharger rotational speed; is the moment of inertia of the turbocharger rotor; is the turbine torque; and is the compressor load torque.
The turbine torque is derived from exhaust energy conversion and its calculation formula is:
In the equation, is the turbine efficiency; is the exhaust adiabatic index, ; is the air gas constant; is the turbine pressure ratio; is the turbine inlet exhaust gas temperature; and is the exhaust mass flow rate.
The exhaust mass flow rate
flowing through the turbine can be determined from the nozzle flow characteristics as follows:
In the equation, is the effective flow area of the turbine nozzle, and is the nozzle flow coefficient under the corresponding operating conditions, which is related to the turbine pressure ratio.
The load torque
at the compressor end reflects the work consumed by the compressor in compressing air and its expression is given as:
In the equation, is the air mass flow rate at the compressor inlet; is the adiabatic index of air, ; is the compressor efficiency; is the compressor inlet air temperature; and is the compressor pressure ratio.
Both the compressor efficiency and the compressor pressure ratio are nonlinear parameters that vary dynamically with operating conditions. The data are obtained from the steady-state bench-test characteristic curves of the turbocharger.
The flow characteristics of the compressor are described by its flow function:
In the equation, is the volumetric air flow rate at the compressor inlet and is the air pressure at the compressor inlet.
The compressor torque model is established according to Equations (6) and (7).
4.3. Diesel Engine Prime Mover Dynamics Model
The diesel engine prime mover model addressed in this paper is primarily concerned with describing the variations in output torque and rotational speed as functions of rack displacement, rather than the specific details of internal combustion parameters. Under the dynamic operating conditions of the diesel engine, the angular acceleration of the crankshaft is jointly governed by the net driving torque and the moment of inertia. Based on the rigid-body rotation law, the power unit is treated as a single-degree-of-freedom rotational system and the dynamic equilibrium equation is formulated as Equation (8):
In the equation, is the equivalent moment of inertia of the diesel engine referred to the crankshaft; is the crankshaft angular speed; is the shaft system moment of inertia, set as ; is the diesel engine rotational speed; is the effective output torque of the diesel engine; is the braking torque of the load; and is the friction torque of the diesel engine.
The relationship between
and
is given as follows:
To achieve quantitative modeling of the effective output torque of the diesel engine, a mathematical relationship between the effective output torque and the combustion process, as well as the mechanical losses, is established based on the principle of fuel energy conservation. The effective output torque is derived by subtracting mechanical losses from the indicated torque, and its theoretical expression is given by Equation (10):
In the equation, is the indicated torque of the diesel engine; is the mechanical efficiency; is the lower heating value of the fuel; is the fuel supply per cycle; is the indicated thermal efficiency; and is the number of strokes of the diesel engine.
To achieve a quantitative conversion from the governor control signal to the fuel injection quantity, an empirical relationship between the single-cycle fuel supply and the governor control rod displacement is established based on the static characteristics of the diesel engine fuel governing mechanism, as follows:
In the equation, is the governor control rod displacement.
Under dynamic operating conditions of the diesel engine, the indicated thermal efficiency is significantly affected by the coupled influence of rotational speed and load; its variation directly determines the conversion efficiency from fuel energy to the indicated work. To achieve real-time quantification of the indicated thermal efficiency, an empirical model is obtained by fitting the steady-state test data of the target engine type using a two-dimensional quadratic function, as expressed in Equation (12):
In the equation,
is the rotational speed corresponding to the maximum indicated thermal efficiency, with a value of 802.8809; and
is the excess air coefficient corresponding to the maximum indicated thermal efficiency, with a value of 2.4168. The coefficients
,
and
can be determined through experimental measurements, as detailed in
Table 2.
The units for all key parameters are as follows: rotational speed in rpm, torque in N·m, mass flow rate in kg/s, pressure in Pa, temperature in K, and moment of inertia in kg·m2. The model assumes ideal gas behavior for intake air and exhaust gas, with constant specific heats ( for air, for exhaust gas). These assumptions are consistent with the mean-value engine modeling approach commonly adopted for real-time, control-oriented applications.
During the combustion process of the diesel engine, the excess air coefficient is a key parameter that characterizes the actual air-to-fuel ratio; its value directly influences the in-cylinder combustion efficiency and the heat release process. To achieve quantitative calculation of this parameter, the definition of the excess air coefficient is established based on the ratio of air mass flow rate to fuel flow rate, as expressed in Equation (13):
In the equation, is the actual intake air mass flow rate of the diesel engine; is the actual fuel injection mass flow rate; and is the theoretical air quantity required for complete combustion of the diesel fuel.
In the modeling of diesel engine dynamic operating conditions, the calculation of the excess air coefficient depends on the fuel-injection mass flow rate. To achieve the conversion from the single-cycle fuel supply to the fuel mass flow rate per unit time, a calculation formula for the fuel mass flow rate is established based on the cyclic operating characteristics of the engine, as presented in Equation (14):
To calculate the actual intake air mass flow rate per unit time of the diesel engine, a calculation formula for the intake air flow rate is established by combining the ideal gas equation of state and the engine gas exchange process, as follows:
In the above equation,
is the number of cylinders of the diesel engine;
is the displacement per cylinder;
is the air pressure in the intake manifold;
is the air gas constant;
is the air temperature in the intake manifold; and
is the volumetric efficiency of the diesel engine, which is expressed as:
Integrating Equation (8) yields the diesel engine rotational speed:
By interfacing the above sub-models and coupling their parameters, the complete simulation model of the diesel engine prime mover is constructed and encapsulated. Through real-time data exchange among the sub-models, the dynamic characteristics are simulated in a coupled manner. The diesel engine simulation model built in MATLAB/Simulink is shown in
Figure 6. Detailed Simulink block diagrams of each sub-module are provided in the
Supplementary Materials, Figures S1–S16.
Following the modular integration of the individual diesel engine sub-models, offline simulation validation is carried out based on MATLAB/Simulink. This validation is not intended to demonstrate absolute numerical agreement between the simulation model and the actual diesel engine—which depends on subsequent bench calibration experiments—but rather to verify the effectiveness at the following two levels from the perspective of control system development: (i) using the rotational speed dynamic response characteristics as the core evaluation metric, to verify whether the PID closed-loop speed controller enables the simulation model to accurately and rapidly track the target speed commands at different setpoints, thereby demonstrating the effectiveness of the control algorithm; and (ii) to verify whether the dynamic response trends of the simulation model conform to the general physical laws and engineering experience of diesel engines, thereby ensuring the fundamental credibility of the model as a controller development platform.
First, simulation validation under diesel engine startup conditions is conducted. Under zero initial load, a standard startup speed command is applied and the dynamic tracking process of the actual output speed relative to the theoretical reference speed is observed in real time, with key metrics such as the speed rise rate during the startup phase, steady-state settling time, and the peak overshoot being analyzed.
Figure 7 illustrates the rotational speed evolution after engine startup, which can be divided into two phases: 0–60 rpm corresponds to the high-pressure air-turning phase, lasting approximately 10 s; and 60–400 rpm corresponds to the firing phase. After ignition, the speed rises to a peak of approximately 440 rpm, then drops to about 360 rpm, and finally stabilizes at 400 rpm after minor oscillations under the action of the PID controller. The maximum speed overshoot throughout the entire process is approximately 10%; the steady-state settling time is approximately 25 s. During the startup phase, because a sustained deviation exists between the actual speed and the target speed, the integral term of the PID controller continues to accumulate, producing a large fuel command. As the speed approaches the target value, the fuel command fails to decrease promptly due to the lag effect of the integral term, resulting in the fuel supply exceeding the steady-state demand, and, consequently, causing overshoot. Subsequently, as the error signal reverses, the controller gradually reduces the fuel command and the speed decreases and stabilizes.
The simulation results indicate that the speed overshoot is within the engineering allowable range (≤10%), the steady-state settling time is consistent with the typical dynamic response characteristics of large low-speed diesel engine startup processes, and the actual speed can quickly recover after overshoot and remain stable near the reference speed without sustained oscillation or divergence. These results demonstrate that the diesel engine prime mover model exhibits reasonable dynamic response characteristics, and that the governor PID closed-loop control logic is effective, applicable, and capable of meeting the basic requirements of an actual diesel engine startup operation.
Simulation validation under multi-step speed command tracking conditions is then conducted. The control commands are sequentially increased from Level 1 to Level 5, simulating typical continuous speed-changing operations in actual practice. The deviation between the actual rotational speed and the corresponding reference speed at each command level is recorded in real time. By comparing the steady-state speed errors and the response delays during dynamic transitions at each steady operating point, the self-adaptive regulation capability of the model under variable-speed conditions is evaluated.
Figure 8 illustrates the rotational speed evolution of the diesel engine under speed command changes. During 0–30 s, the speed response under Level 1 command is shown, which is consistent with the startup speed evolution described above. During 30–45 s, under Level 2 command, the reference speed is 556 rpm. The actual speed initially rises to a peak of about 580 rpm, then drops to approximately 540 rpm, and finally stabilizes at 556 rpm. The maximum overshoot throughout this phase is about 4.3% and the steady-state settling time is approximately 10 s. During 45–70 s, under Level 3 command with a reference speed of 730 rpm, the actual speed increases monotonically, always remaining below the reference, with no overshoot observed, and eventually stabilizes at 730 rpm under PID control, with a settling time of about 25 s. During 70–85 s, under Level 4 command, with a reference speed of 850 rpm, the actual speed first rises to a peak of approximately 866 rpm, then decreases and stabilizes at 850 rpm, with a settling time of about 15 s. During 85–105 s, under Level 5 command, with a reference speed of 1000 rpm, the actual speed increases monotonically, remains below the reference without overshoot, and finally stabilizes at 1000 rpm under PID control, with a settling time of about 20 s. The simulation results show that after each speed command, the actual speed can quickly track the target speed, with small dynamic deviations and fast steady-state convergence; no significant oscillations or control instability are observed under any condition. It should be highlighted that the zero steady-state error shown in
Table 3 originates from the integral action of the PID governor controller; it cannot be regarded as evidence for physical fidelity of the diesel engine plant model. Controller tracking performance and plant-model physical validation are strictly distinguished throughout this paper. Since there is no publicly available benchmark dataset fully matching our 2000 kW marine diesel engine, physical calibration is not performed at the current stage. In future work, we will adopt the self-calibrating digital-twin framework proposed by Zhang [
20], which combines physics-based models and data-driven correction layers to reconcile simulation outputs with physical system behavior. The quantitative performance metrics for each command level in the offline simulation are summarized in
Table 3.
Based on the simulation verification results of the two typical operating conditions, it can be concluded that the rotational speed response of the diesel engine simulation model exhibits qualitatively reasonable dynamic behavior consistent with general engineering expectations for diesel engine speed-control studies. This supports the use of the model as a preliminary platform for controller algorithm development but does not constitute validation of the model’s absolute predictive accuracy against a physical engine. The PID governor-based closed-loop control exhibits satisfactory regulation performance, with both dynamic errors and steady-state deviations maintained within reasonable ranges. The overall accuracy, stability, and dynamic adaptability of the model meet the application requirements for subsequent embedded code generation and embedded target deployment.
It is necessary to emphasize again that the verification presented in this section has the following attributes: (1) Controller-level verification: It mainly demonstrates that the closed-loop PID controller can track speed commands within the simulation environment. This reflects the effectiveness of the control algorithm, rather than the absolute accuracy of the plant model; (2) Qualitative rationality verification: The dynamic response trends of the model (startup characteristics, overshoot magnitude, settling time range) conform to the general physical laws of diesel engines, making the model suitable for use as a controller development platform; (3) Quantitative accuracy pending verification: The quantitative accuracy between the model and a real engine has not yet been validated. Even if the closed-loop system achieves zero steady-state error, this does not imply that the underlying open-loop model matches a physical engine—quantitative calibration via bench tests will be addressed in future work; and (4) Load disturbance testing: The multi-step command test is a speed-reference tracking test, not a true variable-load or load-disturbance test. No explicit load torque profile, propeller load law, generator-load disturbance, or measured duty-cycle profile is introduced in the current tests. Therefore, the results do not demonstrate the model’s behavior under real load-varying conditions.