## 2 Methods and Tools
### Crankshaft Dynamics Model  
The thermodynamics model was coupled to the crankshaft dynamics model, which is configurable to predict the ICT for either stationary generators or propulsion applications. The engine crankshaft dynamics was modelled using a lumped parameter model, the detailed development of which is described in [37]. The lumped parameter model represents the entire engine crankshaft in a series of 16 discrete inertia disks or Degrees of Freedom (DOFs), as shown for the reference system in Figure 2. The DOFs 4-8 and 10-14 correspond to each of the 10 cylinders, whilst DOFs 1-3, 9, 15, and 16 correspond to the engine vibration dampers, chaindrive, flywheel and generator armature respectively. Each DOF is connected to its neighbouring DOF(s) using a spring and a damper element, that simulate the shaft's rigidity and structural damping. Furthermore, each DOF is connected with a damper element to a non-rotating frame of reference, simulating the friction in the shafting system's bearings. The following crankshaft dynamics model governing equation was derived by applying the angular momentum conservation on the engine shafting system:  
\[\mathbf{J\ddot{\Theta}}+\mathbf{C\dot{\Theta}}+\mathbf{K\Theta}=\mathbf{T}_{J}+\mathbf{T}_{C}+\mathbf{T} _{F}+\mathbf{T}_{L} \tag{17}\]  
where \(\mathbf{\Theta}\), \(\mathbf{\dot{\Theta}}\) and \(\mathbf{\ddot{\Theta}}\) are \(16\times 1\) vectors of the angular displacement and its respective first and second derivatives; \(\mathbf{J}\) is a \(16\times 16\) diagonal inertia matrix; \(\mathbf{C}\) and \(\mathbf{K}\) are \(16\times 16\) tridiagonal damping and stiffness matrices respectively; and \(\mathbf{T}_{J}\), \(\mathbf{T}_{C}\), \(\mathbf{T}_{F}\) and \(\mathbf{T}_{L}\) are \(16\times 1\) vectors of the variable inertia, cylinder combustion, engine friction, and engine load torques respectively. The inertia variation throughout the engine rotation is a result of the rotating and reciprocating motion of the engine pistons and the connecting rods [20]. As a result, the variable inertia vector elements corresponding to the engine cylinders (DOFs 4-8 and 10-14) are calculated using Equation (18) below, whilst all other elements corresponding to DOFs 1-3, 9, and 15-16 are set to zero [46]. Thus, the variable inertia torque is calculated according to the following equation:  
\[\mathbf{T}_{J,n}=M_{rec}\left[r^{2}-\left(\frac{\mathrm{d}s_{n}}{\mathrm{d}\theta_ {n}}\right)^{2}\right]\ddot{\theta}_{n}+M_{rec}\ \frac{\mathrm{d}^{2}s_{n}}{\mathrm{d}\theta_{n}^{2}}\ \frac{\mathrm{d}s_{n}}{\mathrm{d}\theta_{n}}\dot{ \theta}_{n}^{2} \tag{18}\]  
where \(M_{rec}\) and \(r\) are the reciprocating piston mass and crank radius respectively, \(s\) is the instantaneous piston displacement with respect to the Top Dead Center (TDC), and the subscript \(n\) refers to the DOFs corresponding to each cylinder. The cylinder combustion torque vector is arranged in a similar way as the variable inertia torque vector, where its elements corresponding to the engine cylinders are calculated using Equation (19), and all other elements are set to zero. The combustion torque for individual cylinders is therefore calculated according to the following equation:  
\[\mathbf{T}_{C,n}=\frac{\mathrm{d}s_{n}}{\mathrm{d}\theta_{n}}\ p_{n}A_{p} \tag{19}\]  
where by using the same notation as in the thermodynamics model, \(p_{n}\) is the in-cylinder pressure for the \(n\)th DOF corresponding to each cylinder, and \(A_{p}\) corresponds to the piston area. The engine friction torque is calculated as a function of the engine rotational speed, utilising the friction coefficients in accordance to the following equation [18]:  
\[\mathbf{T}_{F}=\mathbf{F\dot{\Theta}} \tag{20}\]  
where \(\mathbf{F}\) is a \(16\times 16\) diagonal matrix containing the friction coefficients. The engine load torque is calculated as a constant for the case where the engine is configured for a stationary generator [18], or as a function of the engine speed for the case where the engine is configured for propulsion applications [47].