system
Given the following post, respond as if you're commenting on Reddit:
human
Why do diesel locomotives have electric engines?

I hope this is the right sub reddit for this question...

Why do diesel locomotives and even some ships use Diesel engines to power generators that then run electric motors to "drive" the vehicle?

From a scientific perspective, why don't we do this for cars?
gpt
There are a few advantages but the most significant one is that it simplifies the coupling of the diesel engine to the wheels.  By having the diesel drive a generator and putting electric motors on the wheels, you do away with complex drive shaft and transmission systems and just run some flexible cables to the wheel motors. Imagine the size of the clutch that would be needed on a typical locomotive. The electrical control system also replaces the need for a mechanical gearbox. Again, imagine trying to double clutch a train.

On ships the main advantage is being able to connect multiple diesel engines to multiple propulsion devices without complex mechanical couplings - just wire them together instead.

It isn't done on cars because a mechanical transmission is more efficient and simpler for small scale machines.