Repository navigation
Add an internal combustion engine simulation - #75
Merged
Merged
Conversation
Twelve parts: fuel, current and rotation flow through the mesh, and the crankshaft's turn starts the next stroke, so the mesh runs until the tank is dry and then stops on its own. Closes #29 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WbQCnCrtf3EqpxJD24koiW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by ovsep · project thread
Before: the only feedback-loop simulation of physical parts was the two-component battery and lightbulb.
After:
simulation/combustion_engineis a four-cylinder, four-stroke engine in 12 components (crankshaft, ECU, alternator, battery, starter, fuel tank, fuel pump, ignition coil, four cylinders). Fuel, current and rotation each flow through the mesh, and the crankshaft's turn starts the next stroke, so one trip around the mesh is one stroke. You turn the key once: the starter cranks it, it catches and idles, the throttle opens, and when the tank is dry the crankshaft stops and the mesh stops by itself.-battery 5shows a battery too weak to start it.How: every part waits for one signal per input per stroke with
component.RequireInputs, so the short control path, the long fuel path and the electric path meet in the right stroke; each cylinder keeps its place in the four-stroke cycle in its state, offset so power strokes come in the firing order 1-3-4-2; indexed ports give the pump and coil one output per cylinder. Tests check it runs until the tank is dry, reaches its full-throttle speed, fires in order, and never starts on a flat battery.Closes #29
🤖 Generated with Claude Code
https://claude.ai/code/session_01WbQCnCrtf3EqpxJD24koiW
Generated by Claude Code