Giter Club home page Giter Club logo

rocket-flight-simulation's Introduction

rocket-flight-simulation

Made a graphical demonstration for rocket flying, considering non-constant mass and air friction, turned out to look pretty cool

Theory

For such tasks involving non-constant mass I will be using the mesherskiy equation

image

"F.." means external forces, such as air friction and gravitation pull

image

Our rocket will have 2 phases:

- With fuel, meaning differing mass, drag from the fuel exhaustion

- Without fuel, constant mass, basically only air friction

After all those preparations we can finally make out final equations

image

After expanding it into a 3 equation system it turnes out to be non-linear differential equations, which i am not going to solve analytically However we can try them out with some test data, to later reffer to this as an expected result Note: I will be doing x/y reffering to horizontal/vertical plane, however in the code x\y is horizontal and z in vertical

PART 1

image

PART 2

image

Testing Theory

Im using this input to plot my data manually: plot_me("red", a =math.pi/4 , b = math.pi/2.38,fcons =700,fsp = 23000 , v =10)

it has a very horizontal trajectory, much like a real rocket

x1[t]

image

v1x[t]

image

x2[t]

image

v2x[t]

image

z1[t]

image

vz1[t]

image

z2[t]

image

vz2[t]

image

Compairing theory and my data, it seems as it is quite similar, which concludes as a success

I will include some actual plots, which my code can perform:

image

image

image

Note: after a closer look at the code, you could see that wind is indeed in the equation, HOWEVER, it shows wierd results, so it is better left at 0

image

image

TODO:

-Make dynamic graphs, add easy support for x/y/z[t]  as shown above (were done in a janky way)

-Fix the wind

HUGE THANKS TO Chelovechecheggg#5451 for helping

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.