Giter Site home page Giter Site logo

minatonamikaze02 / optimization-techniques-calculators Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 2.0 110 KB

A simple and easy-to-use CLI application that can be used to solve optimization math problems!

Python 100.00%
python math optimization-methods optimization optimization-algorithm scipy-optimize sympy

optimization-techniques-calculators's Introduction

Optimization-Techniques-Calculator

A simple and easy-to-use CLI application that can be used to solved optimization problems!

Overview

Currently supports the following optimization techniques

  • Newton Raphson
  • Secant Method
  • Fibonacci Search
  • Golden Section Search
  • Cauchy Gradient
  • Lagrange Interpolation
  • Least Squares
  • Downhill Simplex More to come

Why we did this?

We like math! ๐Ÿค“

How to use this

  • Clone this repository.
  • Run pip install -r requirements.txt.
  • Run the main with relevant options and arguments.

Options and Arguments

Arguments
type                       The value that specifies the optimization problem type
Accepted Types:
             SECANT                   'sec'
             NEWTON                   'newt'
             FIBONACCI                'fib'
             GOLDEN SECTION           'GS'
             DOWNHILL SIMPLEX         'DS'
             LAGRANGE INTERPOLATION   'lagin'
             LEAST SQUARE             'ls'
             CAUCHY GRADIENT          'CG'
Options:
  -f, --func TEXT           Function to be optimized (Enter the function in python style syntax).
  -x1, --first FLOAT        Leftmost of an interval (or) initial guess
  -x2, --second FLOAT       Rightmost of an interval
  -x3, --third FLOAT        Third value of x (applies only for lagrange interpolation)
  -i, --iter INTEGER        Number of iterations
  -e, --epsilon FLOAT       Epsilon (by default 10^-3)
  --help                    Shows the help message

Examples

$ python3 main.py newt -f "x**2 - 2" -x1 1 -i 10
>>> 1.414213562373095

Side Notes

  • It's not necessary for you to know the concepts to use these calculators, however it is recommended that you do.
  • This calculator was tested with various questions and the answers were pretty accurate (a lot of anomolies are to be expected).
  • Enter the function in python style syntax (eg: x**2 + 2*x + 3 instead of x^2 + 2x + 3).

Getting a wrong answer?

  • Re-check your input function (the syntax expected is slightly different -> updates).
  • Check the input values you've fed.
  • If you function string has spaces, try enclosing it in quotes.
  • See if your answer was obtained a few iterations prior.

Updates

  • Moved to click for better CLI experience.
  • Revamped the whole structure entirely.

How can you help?

  • Feel free to open issues/PR's for any bugs or improvements.
  • If you have any suggestions (new methods) feel free to open an issue regarding that!

optimization-techniques-calculators's People

Contributors

iamakash-06 avatar minatonamikaze02 avatar pd130102 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.