From the flow diagram below we see that four different systems are invoked to do an Ideal Adiabatic simulation. The main program m-file sea.m (stirling engine analysis) first defines the system to be simulated in terms of the set of global variables set up by the define set of functions, as described previously. It then invokes function adiabatic.m which in turn invokes function m-file adiab.m to solve the set of differential equations (function m-file dadiab.m) over a number of cycles until convergence is attained. Function adiab then fills in the solution matrix for a complete cycle (function m-file filmatrix.m) and displays various performance results (power, efficiency). Function adiabatic then invokes function m-file plotadiab.m to display various relevant plots. The differential equation set is solved by using the Classical Fourth Order Runge-Kutta method (function m-file rk4.m) which is which is described separately in a Technical Note on ordinary differential equations.

The dynamics of the solution algorithm lies in
the function m-file adiab.m,
which initialises the variables, invokes the Runge-Kutta function
over a number of cycles, checks for cyclic convergence, then fills
in the solution matrix. Notice that the function m-file volume.m includes only sinusoidal volume variations (function
sinevl) and the Ross Yoke-drive volume variations (function
yokevl). The nine functions of the set adiab are included
in the following seven m-files (refer to the diagram above): [adiabatic.m, adiab.m, dadiab.m, rk4.m, volume.m, filmatrix.m and plotad.m]. As before, these can be directly copied from ths
website and used in a system which has MATLAB installed. It is
intended that the user will modify and augment this system as
required for specific engine designs.