This engine would consist of a cylinder with one piston at each end facing toward each other, forming a combustion chamber in between them.
Each piston would be attached to its own linear motor/generator. The linear motor/generators would have to be very fast and precise, and would have to be able
to sense their exact position at any time.
The intake ports would be around one end of the cylinder so that they will be exposed when the 'intake' piston is all the way to the starting end. The exhaust ports would be the same size and shape as the intake ports, but would be at the opposite end of the cylinder, on the same side (if the ports are only on one side, and not all the way around, or on both sides).
The engine would have at least one spark plug in three separate locations: the intake end, the center, and the exhaust end. Multiple fuel injectors (for multiple fuels) would also be placed in the same areas as the spark plugs.
The main advantage of this engine is its ability to run using different cycles. By reprogramming the linear motors, fuel injectors, and spark plugs, this engine can run on a variety of cycles and fuels. It can even be electronically tuned.
The main disadvantage of this engine is that it will probably be not very efficient since it has to convert all of its energy into electricity, and it also has to use some of the created energy to run itself.
I know that there is probably one cycle or mode that would be the most efficient for generating electricity, but this would be good if you wanted to have a variable electric output, for example if this was in an electric car then the car would be able to have only one (small) battery.
Also this engine would be good for experimenting with.
If this engine also has some type of electric supercharger or a controllable turbocharger, then it would have more possibilities of running modes, such as a scavenged two-stroke mode.
This engine could come in a range of sizes for different power capabilities, or multiples of this engine could be used for a single application.
If this engine where to run like a naturally aspirated 4 stroke, then it would actually do 5 strokes per complete cycle (the 5th stroke is only to reposition the pistons for the intake stroke).
If you haven't figured out how this would run, or if you have any other questions, just ask me, and I will probably answer them (if I can).
Originally I wanted this engine to be mostly mechanical, like most engines are now, but I also wanted the pistons to be able to move different amounts at different times so that it could run on different cycles, but I couldn't figure out a good way to do that mechanically (by mechanical, I don't mean completely mechanical; it could have some small linear motors or linear actuators, or hydraulics and valves, or other technologies, etc.).