GithubHelp home page GithubHelp logo

muskanmahajan37 / gravitational-potential-energy-calcuclator-in-cpp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wise-saint/gravitational-potential-energy-calcuclator-in-cpp

0.0 0.0 0.0 3 KB

Gravitational Potential Energy Calculator with % Error in the result.

C++ 100.00%

gravitational-potential-energy-calcuclator-in-cpp's Introduction

Gravitational-Potential-Energy-Calcuclator-in-CPP

Gravitational Potential Energy Calculator with % Error in the result.

As we all know area under the force ( F )and displacement ( x0 to x1 ) curve gives the work done in displacing the body from one to another point (x0 to x1). Therefore we will calculate the area under the F-x curve by doing the integration : W = ∫F. dx (x0 to x1) Since the G.P.E. at x1 is not zero. On taking the negative of this work done we will get the change in potential energy of the body ( G.P.E. at x0 -G.P.E. at x1). Since we can’t set x1 = ∞ in C++ (as we are writing code in CPP) we will set x1 for maximum possible value. In this way we aren’t getting the absolute potential energy of the body at the given point (x0). But we can get the approximate value of the potential energy at that point. Now, by using the formula : G.P.E = -GM1M2/x We will calculate the potential energy at x = x0. And, then we will compare these two values to calculate error in our first approach.

gravitational-potential-energy-calcuclator-in-cpp's People

Contributors

wise-saint avatar

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.