Close
0%
0%

PROGRAMMING COSMIC DYNAMICS

NKTg Law — A Programmable Approach to Varying Inertia / Variable Inertia

Public Chat
Similar projects worth following
68 views
0 followers
### ? Project Overview Physics isn’t broken. It’s just never been programmed. For over 300 years, inertia has been treated as a constant. But in real systems — drones, robots, spacecraft — mass changes continuously. So what happens when inertia is no longer constant? ? This project introduces the **NKTg Law** by Nguyen Khanh Tung: NKTg = f(x, v, m) A computational framework based on **Varying Inertia / Variable Inertia**, where motion is not just described — it is executed in code. --- ### ? Not a Theory. A System. This project is part of the book *Programming Cosmic Dynamics*: * Implemented across 11 programming languages * Tested with real-world datasets (including ESA references) * Measured error margin: **0.208%** The goal is simple: > Turn physics into a programmable engine. --- ### ⚙️ Core Concept Instead of relying on static equations, the NKTg system

⚙️ Implementation Notes (NKTg Law)

Runtime Model

The system operates as a discrete-time loop rather than a continuous equation solver.

At each iteration:

  • Input state is sampled (x, v, m)
  • Mass variation (dm/dt) is either measured or estimated
  • Motion tendency is computed directly

This avoids solving differential equations and allows integration into real-time systems.

Data Flow

Input → Compute → Evaluate → React

  1. Read current state
  2. Compute momentum (p = m × v)
  3. Compute NKTg components
  4. Compare directional influence
  5. Output system response

This structure is intentionally simple to support embedded environments.

Why Not Differential Equations?

Traditional models rely on:

  • Continuous integration
  • Numerical solvers (RK4, Euler, etc.)
  • High computational cost

In contrast, NKTg uses:

  • Direct computation
  • Discrete updates
  • Low overhead

This makes it suitable for:

  • Microcontrollers
  • Real-time AI loops
  • Edge devices

Behavior Interpretation Layer

Instead of solving trajectories explicitly, the system evaluates tendencies:

  • Directional reinforcement
  • Resistance effects
  • Stability convergence

This allows decision systems (AI, controllers) to act immediately.

Integration Strategy

The model is designed to plug into existing systems:

  • Robotics → control loop replacement
  • AI → feedback signal generator
  • Simulation → lightweight physics core
  • Embedded → real-time motion estimation

No full physics engine is required.

Performance Considerations

  • O(1) per step computation
  • No iterative solver required
  • Minimal memory footprint
  • Suitable for Assembly-level optimization

System Philosophy

The goal is not to replace classical physics.

The goal is to make motion:

  • Computable
  • Executable
  • Integratable into software systems

Reference (Full System + Multi-language Code)

🔹 Leanpub

https://leanpub.com/NKTgLaw https://leanpub.com/NKTgLaw-vi https://leanpub.com/b/NKTgLaw-global

🔹 Google Play Books

https://play.google.com/store/books/details?id=CNLKEQAAQBAJ&pli https://play.google.com/store/books/details?id=buDMEQAAQBAJ https://play.google.com/store/books/series?id=Fa6gHAAAABC0sM

🔹 Amazon

https://www.amazon.com/dp/B0GTSBBRYR https://www.amazon.com/dp/B0GHZMSKYB https://www.amazon.com/dp/B0D6579Q3G

Keywords

NKTg Law • Varying Inertia • Variable Inertia AI that reacts like physical systems Autonomous vehicles with real-time physics engines Simulation that doesn’t approximate — it executes Space navigation beyond classical models

NKTg_image_Cover.png

Portable Network Graphics (PNG) - 753.33 kB - 04/15/2026 at 09:53

Preview

  • 1 × NKTg Core Engine Core computation module implementing NKTg Law (NKTg = f(x, v, m)) based on Varying Inertia / Variable Inertia.
  • 1 × Momentum Computation Module Calculates dynamic momentum (p = m × v) for real-time motion evaluation.
  • 1 × Mass Variation Analyzer Handles dm/dt and evaluates how changing mass affects motion behavior.
  • 1 × Motion Tendency Evaluator Determines system behavior (stability, amplification, damping) from NKTg components.
  • 1 × Real-Time Execution Loop Discrete-time loop for continuous computation in embedded or AI systems.

View all 10 components

  • First Working Model of NKTg Law This log documents the first executable version of the NKTg system.

    Nguyen Khanh Tung04/15/2026 at 10:03 0 comments

    Objective

    Build a minimal working loop to evaluate motion using:

    • Position (x)
    • Velocity (v)
    • Mass (m)
    • Mass variation (dm/dt)

    Implementation (Python Prototype)

    Initial prototype implemented in Python:

    def nktg_step(x, v, m, dm_dt):    p = m * v    nktg1 = x * p    nktg2 = dm_dt * p
        if nktg2 * nktg1 > 0:        state = "amplifying"    elif nktg2 * nktg1 < 0:        state = "damping"    else:        state = "stable"
        return nktg1, nktg2, state

    Observations

    • The system reacts immediately to changes in mass
    • No numerical solver required
    • Behavior classification is stable across test inputs

    Key Insight

    Instead of solving motion equations, the system evaluates motion tendency directly.

    This significantly reduces computational overhead.

    Next Steps

    • Extend to continuous loop simulation
    • Test with real datasets
    • Port to C++ for performance benchmarking

View project log

  • 1
    Build Instructions — Running NKTg Law (Basic Prototype)

     Build Instructions — Running NKTg Law (Basic Prototype)

  • 2
    Step 1 — Requirements

    You only need:

    • Python 3.x
    • A basic terminal / command line

    No external libraries required.

  • 3
    Step 2 — Create the Script

    Create a file:

    nktg_test.py

    Paste the following code:

    def nktg_step(x, v, m, dm_dt):    p = m * v    nktg1 = x * p    nktg2 = dm_dt * p
        if nktg2 * nktg1 > 0:        state = "amplifying"    elif nktg2 * nktg1 < 0:        state = "damping"    else:        state = "stable"
        return nktg1, nktg2, state
    
    
    # Example test
    x = 10
    v = 5
    m = 2
    dm_dt = -0.1
    
    result = nktg_step(x, v, m, dm_dt)
    
    print("NKTg1:", result[0])
    print("NKTg2:", result[1])
    print("State:", result[2])

View all 8 instructions

Enjoy this project?

Share

Discussions

Nguyen Khanh Tung wrote 04/15/2026 at 10:17 point

Is constant inertia an oversimplification in modern engineering systems?

  Are you sure? yes | no

Nguyen Khanh Tung wrote 04/15/2026 at 10:17 point

The core computation is relatively simple (momentum + mass variation + tendency evaluation), which makes it suitable for low-level environments.

I’m considering:

C++ optimization

Assembly implementation

Embedded systems (ESP32 / MCU)

For those experienced in performance-critical systems:

What would be the best direction to push this further?

  Are you sure? yes | no

Nguyen Khanh Tung wrote 04/15/2026 at 10:16 point

Best way to optimize NKTg Law for low-level systems?

  Are you sure? yes | no

Nguyen Khanh Tung wrote 04/15/2026 at 10:16 point

I’m exploring the NKTg Law as a computational model based on Varying Inertia / Variable Inertia.

Instead of solving differential equations, the system evaluates motion tendency directly in real time.

Do you think this kind of approach could replace or complement traditional physics engines in:

Robotics

Autonomous vehicles

Simulation systems

Curious to hear thoughts from others working on real-time systems.

  Are you sure? yes | no

Nguyen Khanh Tung wrote 04/15/2026 at 10:16 point

Can Varying Inertia replace traditional physics models in real-time systems?

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates