Thanks for the kind words! And Bazyle I don't think very many people make their own CPU any more, but if you are interested there is a great page at **LINK**listing some of them.
> I am intrigued by the compression loop and even more intrigued by the expansion loop. So what is going on there?
If you assume that the inlet and exhaust ports are symmetrical, then it is always the case that either the port timings overlap each other, or there is a range of positions, crossing top dead centre and bottom dead centre, where neither port is open. This means there is no way to avoid at least a little bit of unwanted compression and expansion, without letting both ports open simultaneously.
I don't have a good intuition for whether you would be able to solve this by making the port locations or sizes asymmetrical – my guess is no, but it might be interesting to fiddle with.
I don't think this unwanted compression/expansion actually costs any *efficiency*, because the work extracted in one cycle of the engine is given by the volume enclosed by the pressure-volume diagram. The pressure spikes enclose no volume, so they waste no energy (i.e., the energy you spent compressing the air on the approach to top dead centre is given back when the air expands after you pass top dead centre). It does however slow down the engine: compare rolling a ball up and down a frictionless hill to rolling it along a flat plane. The ball loses kinetic energy going up the hill and regains it coming down the hill, but it still takes longer to travel any given distance because the average speed is lower.
> Can we persuade you to do one for a compound steam engine?
Quite possibly! There are 2 different directions I want to take this. One is to make it simulate more than just simple single-cylinder single-acting oscillating engines. It would be relatively straightforward to split out the part that computes port overlap areas, and turn it into a pluggable "valve operation" module, where you can select what type of valving the engine has. Making multiple-expansion engines should be relatively easy as well – you'd probably model it as a fixed-volume vessel connecting the exhaust port of one cylinder to the inlet port of the next, and all the air flow calculations remain pretty straightforward. Double-acting cylinders would be similarly straightforward.
Probably the most annoying parts of supporting different types of engine would be making the visualisation and the user interface handle all the different possibilities.
The other direction I want to take it is to have it take some constraints and goals, and then it would automatically fiddle with the engine parameters to try to optimise the engine. For example, with displacement below 5cc, with 20 psi air supply, find the most efficient engine that can supply at least 1 Watt, below 1500 rpm.
> Not stupendously difficult, pressure sensor on cylinder, slotted wheel on crankshaft and a data logger.
Yes, I think this would be very interesting to do. Sadly I'm much less competent as a machinist than as a programmer, so my engine build is progressing much more slowly than my simulator did. But I definitely want to try to plot a pressure-volume diagram from a real engine. I suspect the limiting factor will be finding an inexpensive high-frequency pressure sensor.