Skip to content

Add an internal combustion engine simulation - #75

Merged
hovsep merged 1 commit into
mainfrom
claude/combustion-engine
Oct 5, 2026
Merged

hovsep merged 1 commit into
mainfrom
claude/combustion-engine

Conversation

@hovsep

@hovsep hovsep commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Requested by ovsep · project thread

Before: the only feedback-loop simulation of physical parts was the two-component battery and lightbulb.

After: simulation/combustion_engine is 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 5 shows 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

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
@hovsep hovsep self-assigned this Oct 5, 2026
@hovsep
hovsep merged commit 257c900 into main Oct 5, 2026
1 of 2 checks passed
@hovsep
hovsep deleted the claude/combustion-engine branch October 5, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[example] Internal combustion engine

2 participants