Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Physics Simulation Concept: Visualizing Mass-Varying Motion with Qt and Python
Forum Updated to NodeBB v4.3 + New Features

Physics Simulation Concept: Visualizing Mass-Varying Motion with Qt and Python

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 111 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TheNKTLaw
    wrote last edited by
    #1

    Hello everyone,

    I would like to share a physics concept that might be interesting to simulate using Qt and Python, particularly for those interested in physics simulations or educational software.

    This concept is called the NKTg Law. It describes the motion of objects whose mass changes over time, such as rockets or certain orbital bodies. The model relies on two core quantities derived from position, momentum, and mass change:

    NKTg₁ = position × momentum

    NKTg₂ = (mass change rate) × momentum

    The idea focuses on tracking how the magnitudes of these quantities increase or decrease over time, offering a simplified analysis of dynamic systems.

    Possible Qt Use:
    I’m considering using Qt for:

    Creating a simple GUI to input initial conditions (position, mass, velocity, etc.).

    Visualizing the computed motion or plotting the evolution of these quantities using charts.

    Integrating with Python libraries (like NumPy/SciPy) for calculations, while Qt handles the user interface.

    Open Question:
    Has anyone here tried combining Qt with Python or C++ to build scientific or physics-related simulations?
    I’m curious if there are examples or best practices for building such a tool.

    Looking forward to hearing your thoughts!

    Z 1 Reply Last reply
    0
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote last edited by
      #2

      Interesting project. I mean sure, you can use Qt and/or python, but Qt utility would be mostly in data presentation. The core simulation engine would have little to do with the chosen platform. As for best-practices, I'd recommend reading a primer on simulations. Good sims maintain their own internal "clock/counter" and are deterministic is that you can reset the sim to a specific state by setting the clock value manually. Most people don't think about that unless they are familiar with sims.

      T 1 Reply Last reply
      1
      • Kent-DorfmanK Kent-Dorfman

        Interesting project. I mean sure, you can use Qt and/or python, but Qt utility would be mostly in data presentation. The core simulation engine would have little to do with the chosen platform. As for best-practices, I'd recommend reading a primer on simulations. Good sims maintain their own internal "clock/counter" and are deterministic is that you can reset the sim to a specific state by setting the clock value manually. Most people don't think about that unless they are familiar with sims.

        T Offline
        T Offline
        TheNKTLaw
        wrote last edited by
        #3

        @Kent-Dorfman Thank you for your very practical suggestion.
        You're right—Qt or Python would mostly serve for data display or the user interface, while the core simulation engine itself would not really depend on the chosen platform.

        Regarding best practices in simulation, I fully agree with your point about having an internal “clock” or “counter” to ensure determinism and the ability to restore the simulation to a specific state. This is indeed a fundamental principle in serious simulation systems.

        As for the NKTg Law, its formulas are inherently tied to time and the rate of change of mass (dm/dt). That’s why, during my experimental tests, I also pay close attention to specific time points to ensure accuracy and repeatability. In fact, the rate of inertia variation in NKTg itself naturally acts as an “internal clock” for the system.

        Thank you again for your valuable input—I’ll continue refining the simulation aspect further.

        1 Reply Last reply
        0
        • T TheNKTLaw

          Hello everyone,

          I would like to share a physics concept that might be interesting to simulate using Qt and Python, particularly for those interested in physics simulations or educational software.

          This concept is called the NKTg Law. It describes the motion of objects whose mass changes over time, such as rockets or certain orbital bodies. The model relies on two core quantities derived from position, momentum, and mass change:

          NKTg₁ = position × momentum

          NKTg₂ = (mass change rate) × momentum

          The idea focuses on tracking how the magnitudes of these quantities increase or decrease over time, offering a simplified analysis of dynamic systems.

          Possible Qt Use:
          I’m considering using Qt for:

          Creating a simple GUI to input initial conditions (position, mass, velocity, etc.).

          Visualizing the computed motion or plotting the evolution of these quantities using charts.

          Integrating with Python libraries (like NumPy/SciPy) for calculations, while Qt handles the user interface.

          Open Question:
          Has anyone here tried combining Qt with Python or C++ to build scientific or physics-related simulations?
          I’m curious if there are examples or best practices for building such a tool.

          Looking forward to hearing your thoughts!

          Z Offline
          Z Offline
          zvoopz
          wrote last edited by zvoopz
          #4

          @TheNKTLaw said in Physics Simulation Concept: Visualizing Mass-Varying Motion with Qt and Python:

          Open Question:
          Has anyone here tried combining Qt with Python or C++ to build scientific or physics-related simulations?

          Hello. I am currently writing Qt app that touches the similar aspects. It is a some kind of ballistic missile simulator. Its just a hobby but I enjoy of learning Qt and physics during development.

          Imagine UI starting window with interactive map where you choose a launch point, app draws a circle with certain range. Next user selects the impact point and the app based on coordinates calculates the distance and azimuth

          It is not finished yet but I have already achieved next goals.
          For perfect aiming I do need real time simulation with closed loop direction adjustment based on predicted path from current position and velocity vector.
          But for now I have already found a robust method of pre-launch estimation of pitch angle and receive full trajectory to analyse. I implemented thrust vector control and can guide my missile with both azimuth and pitch angle that determines apogee.
          Yes, the mass varies during fuel burning, drag varies based on altitude air density, I do account for curved Earth coordinate shift and Coriolis effect. The real challenge is to manage different frames to adjust angles of engine thrust relative to gravity or earth frame. For raw range vs deflection of thrust estimation my cpu needs 30+ seconds

          JonBJ 1 Reply Last reply
          1
          • Z zvoopz

            @TheNKTLaw said in Physics Simulation Concept: Visualizing Mass-Varying Motion with Qt and Python:

            Open Question:
            Has anyone here tried combining Qt with Python or C++ to build scientific or physics-related simulations?

            Hello. I am currently writing Qt app that touches the similar aspects. It is a some kind of ballistic missile simulator. Its just a hobby but I enjoy of learning Qt and physics during development.

            Imagine UI starting window with interactive map where you choose a launch point, app draws a circle with certain range. Next user selects the impact point and the app based on coordinates calculates the distance and azimuth

            It is not finished yet but I have already achieved next goals.
            For perfect aiming I do need real time simulation with closed loop direction adjustment based on predicted path from current position and velocity vector.
            But for now I have already found a robust method of pre-launch estimation of pitch angle and receive full trajectory to analyse. I implemented thrust vector control and can guide my missile with both azimuth and pitch angle that determines apogee.
            Yes, the mass varies during fuel burning, drag varies based on altitude air density, I do account for curved Earth coordinate shift and Coriolis effect. The real challenge is to manage different frames to adjust angles of engine thrust relative to gravity or earth frame. For raw range vs deflection of thrust estimation my cpu needs 30+ seconds

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote last edited by
            #5

            @zvoopz said in Physics Simulation Concept: Visualizing Mass-Varying Motion with Qt and Python:

            For raw range vs deflection of thrust estimation my cpu needs 30+ seconds

            I know nothing about all this physics, but if the rocket has to stop and spend 30 seconds calculating something that worries me... ;-)

            Z 1 Reply Last reply
            0
            • JonBJ JonB

              @zvoopz said in Physics Simulation Concept: Visualizing Mass-Varying Motion with Qt and Python:

              For raw range vs deflection of thrust estimation my cpu needs 30+ seconds

              I know nothing about all this physics, but if the rocket has to stop and spend 30 seconds calculating something that worries me... ;-)

              Z Offline
              Z Offline
              zvoopz
              wrote last edited by zvoopz
              #6

              @JonB said in Physics Simulation Concept: Visualizing Mass-Varying Motion with Qt and Python:

              @zvoopz said in Physics Simulation Concept: Visualizing Mass-Varying Motion with Qt and Python:

              For raw range vs deflection of thrust estimation my cpu needs 30+ seconds

              I know nothing about all this physics, but if the rocket has to stop and spend 30 seconds calculating something that worries me... ;-)

              You are right. But this is a pre-launch estimation that determines a hundred of launch trajectories to select the closest pitch angle further. The longest trajectories have a real flight time about 400 seconds with calculations time step 1/1000 of second. Flight-time correction calculations won't last long. Plus qDebug console output logs eat a lot of time

              1 Reply Last reply
              1

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved