Code Monkey home page Code Monkey logo

formulalab's Introduction

FormulaLab is under development, and NOT stable now!

FormulaLab

FormulaLab is a Python package that mathematically derives new formulas, searches in formulas, and connects your project code to Formulas Database (FD). FD is a smart and efficient way to list, reference, remark, and organize all of your collections of formulas in one place. FD can be connected to as many projects as you want - where editing and inserting is being done only once for all. The formulas in the FD does not have to be rewriten in different forms, one form is enough, and the rest is being derieved by FormulaLab. For example, Area = Pi * radius^2, if you ask for the radius, FormulaLab will solve it for you - no need for repetition in the FD which is very convienient and time saving when you have many equations.

Best For

  • Students who are working with many formulas and trying to derive and connect them to solve problems and study smartly.
  • Scientists and engineers who are working on research that requires a wide range of formulas to work with, search for, and reference to.
  • Developers who want to keep all of their math/physics/... formulas at one place for better maintenance and debugging.

Installation

FormulaLab depends on:

  • python +3.4
  • Sympy
  • Pandas
  • NumPy

To install FormulaLab:

pip install FormulaLab

Usages

>>> import FormulaLab as fl

>>> Physics_formulas = ['F = m*a', 'v = a*t']
>>> phy_search = fl.FormulaSearch(data=Physics_formulas)
>>> phy_search
   ID  Formula       Args
0   1  f = m*a  [m, a, f]
1   2  v = a*t  [a, v, t]

# Now, say you want to derive F as a function of t
>>> Force = phy_search.derive('F', 't')
>>> Force
[m*v/t]

# Now, you want to convert it to a python function
>>> Force_py = phy_search.function(Force[0])
>>> Force_py(m = 2, v = 3, t = 2)
3.0

# Now, you want to find the the value of "t" in a direct search (no subtitution)
>>> phy_search.find('t')
[v/a]

>>> phy_search.find('a')
[F/m, v/t]

# What if you want "a" as a function of "t" and "v", only in a direct search:
>>> phy_search.find('a', ['t','v'])
[v/t] 

# Now, you want to find `a` from the first equation that has ID=1
>>> phy_search.find('a',id=1)
[f/m]

Tutorals and documentations

visit FormulaLab

Author

Abdulaziz Alqasem
[email protected]

Credit

FormulaLab is bult upon SymPy

formulalab's People

Contributors

azizalqasem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

curioustauseef

formulalab's Issues

[enhancement] Add Support for Textual SymPy AST Format

This is an excellent tool, I really thought SymPy was capable of this sort of thing. However for more advanced equations, like differential equations, it does not exactly work, if I describe something like the time - independent - schroedinger - equation I dont have a way of putting it in, even if it cant do all the operations, would it work to maybe take the stringified version of the SymPy data e.g Eq(-hbar**2*Derivative(psi(x), (x, 2))/(2*m) + V(x)*psi(x), E*psi(x)) this can maybe be walked like an AST? Treat unknowns as functions?

Just a suggestion:
It looks like you are doing your own parsing, which is commendable, but maybe something like atoms() or free_symbols() would work better? Maybe specifying operations and their inverses in its own base-database (e.g derivative being the inverse of integral (noting that constants can be lost)?

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.