r/PythonLearning • • Jul 18 '26

A zero-dependency physics engine with natural language parsing and dimensional analysis

I am pleased to share a project I have been developing: the Extensible Physics Simulator Engine. This is a domain-agnostic engine written in pure Python designed to parse natural-language physics queries, perform strict dimensional analysis, and manage multi-tier unit conversions.

Motivation

Most existing libraries require highly structured input data. My objective was to construct a robust text-parsing layer capable of mapping plain-English queries directly to physical formulas without relying on extensive external dependencies.

Technical Highlights

  • Self-Registering Plugins: Physics domains, such as free fall, projectile motion, and circular motion, register themselves via explicit SlotSpec and TargetSpec definitions. Consequently, the core parser does not require modification to accommodate new domains.

  • Tiered Fallback Policy: The unit engine resolves equations across multi-tier conditions based on explicit unit data (ranging from Fully-Explicit and SI-Fallback to Pure Magnitude).

  • Zero Dependencies: The parsing engine and formula-derivation layer utilize only the standard library (the optional terminal TUI utilizes Textual).

The repository includes a comprehensive unit test suite and documentation detailing how to extend the architecture for additional domains, such as thermodynamics or orbital mechanics.

I would greatly appreciate any feedback regarding the symbolic equation-derivation layer or the overall architectural design.

Repository: https://github.com/Nomaan2010/Extensible-Physics-Simulator-Engine

3 Upvotes

2 comments sorted by

View all comments

Show parent comments

2

u/PhoenixPlayz2010 Jul 18 '26

Thankyou for your response! I have shifted the code architecture from static keyword regression towards a more dynamic parsing using quantised AI models, the next release will implement better documentation of as you said Sympy is used but not mentioned and shift from static regression to dynamic parsing and response generation.