Code Monkey home page Code Monkey logo

astusrush / amadia Goto Github PK

View Code? Open in Web Editor NEW
262.0 262.0 13.0 4.77 MB

Astus' Mathematical Display Application : A GUI for Mathematics (Calculator, LaTeX Converter, Plotter, ... )

License: GNU General Public License v3.0

Python 99.90% Makefile 0.07% Batchfile 0.03%
calculator chat-application control-systems differential-equations equation function-plotter gui-application keyboard-layout latex numpy plotter pyplot pyqt5 python python-calculator scientific-calculator sympy window-frame

amadia's People

Contributors

astusrush avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amadia's Issues

MacOS Installation Process

I've reviewed djbeadle's 2020 issue, and have seen a few of the same symptoms. That said, I thought I'd add my initial approach to installing AMaDiA on MacOS, in my case, Intel MacOS 13.6 (Ventura).

  • Launch the Terminal application and run the following steps within its console.
  • Install Xcode command line tools:

xcode-select --install

  • Install Homebrew (Instructions at https://brew.sh/).
  • After Homebrew installation is complete:
brew install git
brew install --cask anaconda # installs Anaconda 3
source ~/.zshrc # if using zsh
source ~/.bashrc # if using bash
conda install conda-forge::antlr4-python3-runtime
conda install -c conda-forge pyobjc
conda install -c conda-forge slycot
brew install mactex
eval "$(/usr/libexec/path_helper)" # or restart terminal
sudo tlmgr update --self
sudo tlmgr install dvipng
eval "$(/usr/libexec/path_helper)" # or restart terminal
vi ~/bin/AMaDiA/AMaDiA_Files/AMaDiA_Classes.py
:1083 # comment out, deprecated np.warnings
:1085 # comment out, deprecated np.warnings
:1128 # comment out, deprecated np.warnings
mkdir ~/bin
vi ~/bin/AMaDiA_INSTALL.sh
  • insert and save the following:
#!/usr/bin/env zsh
INSTALL_DIR=$HOME/bin
if [ ! -d “$INSTALL_DIR” ]; then
	mkdir -p $INSTALL_DIR
fi
cd $INSTALL_DIR
git clone https://github.com/AstusRush/AMaDiA

vi ~/bin/AMaDiA.sh

  • insert and save the following:
#!/usr/bin/env zsh
AMaDiA_DIR=$HOME/bin/AMaDia
cd $AMaDiA_DIR
git pull
if activate; then
        if python3 $AMaDiA_DIR/AMaDia.py; then
                echo "AMaDia executing"
        else
                echo “Error while launching AMaDiA, exiting…”
                exit 2
        fi
else
        echo “Error while launching Anaconda activate, exiting…”
        exit 1
fi

chmod o+x $HOME/bin/AMaDiA_INSTALL.sh
chmod o+x $HOME/bin/AMaDiA.sh
$HOME/bin/AMaDiA_INSTALL.sh
$HOME/bin/AMaDiA.sh

Results from examples:

  • s^3+5s^2+8s+4=0
    False: right side deviates by second3 + 5*second2 + 8*second + 4
  • roots(s^3+5s^2+8s+4)
    roots(s^3+5s^2+8s+4) = {-1: 1, -2: 2}
  • x²+3x-4=0
    [ {x: -4} , {x: 1} ]
  • x^20+5·x^19-3·x^18+2·x^17+18·x^17+2·x^16+19·x^15+2·x^14-19·x^13-99·x^12+x^11-14·x^10+3·x^9-15·x^8-12·x^7+70·x^6-104·x^5+x^4-3·x^3+x²+2·x-5=0
    <class 'ValueError'> in AMaDiA_Classes.py line 660
    x^20+5·x^19-3·x^18+2·x^17+18·x^17+2·x^16+19·x^15+2·x^14-19·x^13-99·x^12+x^11-14·x^10+3·x^9-15·x^8-12·x^7+70·x^6-104·x^5+x^4-3·x^3+x²+2·x-5=0 ==> [ {x: -6.04773571888917} , {x: -1.0250326906027} , {x: -0.519247737106139} , {x: 1.28374880067676} , {x: -1.10141297857819 - 0.692831199945115·I} , {x: -1.10141297857819 + 0.692831199945115·I} , {x: -0.182946451101471 - 0.517800980196802·I} , {x: -0.182946451101471 + 0.517800980196802·I} , {x: -0.552155232233211 - 0.930186898687355·I} , {x: -0.552155232233211 + 0.930186898687355·I} , {x: -0.0756886854576322 - 1.59356606867508·I} , {x: -0.0756886854576322 + 1.59356606867508·I} , {x: 0.351371712758973 - 0.914333003500366·I} , {x: 0.351371712758973 + 0.914333003500366·I} , {x: 0.44076366517051 - 0.33765852950478·I} , {x: 0.44076366517051 + 0.33765852950478·I} , {x: 0.80060470751489 - 0.375687281322787·I} , {x: 0.80060470751489 + 0.375687281322787·I} , {x: 0.973596934886756 - 1.57844845108437·I} , {x: 0.973596934886756 + 1.57844845108437·I} ]
  • integrate(sqrt(sin(x))/(sqrt(sin(x))+sqrt(cos(x))),(x,0,pi/2))
    ∫(√(sin(x))/(√(sin(x))+√(cos(x))),(x,0,π/2)) = 0.785398163397448
  • int {(0)(3)}int {(0)(x)}a^2da+x dx + int {(0)(3)}x^2*dx
    ∫{(0)(3)}∫{(0)(x)}a^2da+x dx + ∫{(0)(3)}x^2·dx = 20.25
  • ((3)(∫ d(x²)/dx+x dx)(2))/6
    ((3)(∫ d(x²)/dx+x dx)(2))/6 = 1.5·x^2
  • d(y(t))/dt=-λ·y(t)
    d(y(t))/dt=-λ·y(t) ==> {λ: -Derivative(y(tonne), tonne)/y(tonne)}
  • x'(t) *x(t)^2 = sin(0.2 + t)
    x'(t) ·x(t)^2 = sin(0.2 + t) ==> [ {x(tonne): -(sin(tonne + 0.2)/Derivative(x(tonne), tonne))^0.5} , {x(tonne): (sin(tonne + 0.2)/Derivative(x(tonne), tonne))^0.5} ]
  • ∫1dy+∫7x*dx=0
    ∫1dy+∫7x·dx=0 ==> {y: -3.5·x^2}
  • y''(x) = 0 , y(4)=1 , y'(1)=2
    y''(x) = 0 , y(4)=1 , y'(1)=2 ==> y(x) = 2.0·x - 7.0
  • d(x(t))/dt = 5x(t)-3 , x(2)=1
    <class 'AssertionError'> in AMaDiA_Classes.py line 957 :
    <class 'SyntaxError'> in AMaDiA_Classes.py line 802 : invalid syntax (, line 1)
    d(x(t))/dt = 5x(t)-3 , x(2)=1 ==> x(t) = 1.81599719049939e-5exp(5t) + 0.6
  • y(x)·(2x^4+y(x))·y'(x)=(1-4·x·(y(x))^2)·x^2
    Killed process after 3 hours on a 3.1 GHz Quad-Core Intel Core i7, 16GB RAM.
  • pdsolve(1 + (2·(d(u(x,y))/dx)/u(x,y)) + (3·(d(u(x,y))/dy)/u(x,y)))
    pdsolve(1 + (2·(d(u(x,y))/dx)/u(x,y)) + (3·(d(u(x,y))/dy)/u(x,y))) = Eq(u(x, y), F(3·x - 2·y)·exp(-2·x/13 - 3·y/13))
  • pdsolve(1 + (2*(d(u(x,y))/dx)) + (3*(d(u(x,y))/dy)))
    pdsolve(1 + (2·(d(u(x,y))/dx)) + (3·(d(u(x,y))/dy))) = Eq(u(x, y), -0.153846153846154·x - 0.230769230769231·y + F(3·x - 2·y))
  • Sum(1/(k-3),(k,4,8)) = 137/60
    <class 'tokenize.TokenError'> in AMaDiA_Classes.py line 956 : ('EOF in multi-line statement', (2, 0))
    (Sum(1/(k-3),(k,4,8)) ) - ( 137/60)
    14:25:41 :
    <class 'ValueError'> in AMaDiA_Classes.py line 660 : The function cannot be automatically detected for 0.
    Sum(1/(k-3),(k,4,8)) = 137/60 ==> True
  • z6 = 1
    <class 'ValueError'> in AMaDiA_Classes.py line 660 : The function cannot be automatically detected for z
    6 - 1.
    z^6 = 1 ==> [ {z: -1} , {z: 1} , {z: -0.5 - 0.866025403784439·I} , {z: -0.5 + 0.866025403784439·I} , {z: 0.5 - 0.866025403784439·I} , {z: 0.5 + 0.866025403784439·I} ]
  • z3 = -2+2*I
    <class 'ValueError'> in AMaDiA_Classes.py line 660 : The function cannot be automatically detected for z
    3 + 2 - 2*I.
    z^3 = -2+2·I ==> [ {z: -1.36602540378444 + 0.366025403784439·I} , {z: 0.366025403784439 - 1.36602540378444·I} , {z: 1 + 1·I} ]
  • 4 in ImageSet(Lambda(x, x**2), S.Naturals) # Checks if 4 is a square number
    <class 'AttributeError'> in AMaDiA_Functions.py line 314 : 'Quantity' object has no attribute 'Naturals'
    14:28:50 :
    <class 'AttributeError'> in AMaDiA_Classes.py line 802 : 'Quantity' object has no attribute 'Naturals'
    4 in ImageSet(Lambda(x, x^2), S.Naturals) # Checks if 4 is a square number ==> True
  • 1 if 4 in [1,2,3,5,6]+[4,8] else 0
    1 if 4 in [1,2,3,5,6]+[4,8] else 0 = 1
  • 1 if 4 in [1,2,3,4,5,6] and 4 not in [4,8] else 0
    1 if 4 in [1,2,3,4,5,6] and 4 not in [4,8] else 0 = 0
  • 22 if 2>3 else 23
    2·2 if 2>3 else 2·3 = 6
  • inverse_laplace_transform(1/s,s,x)
    inverse_laplace_transform(1/s,s,x) = Heaviside(x)
  • laplace_transform(exp(x),x,s)[0]
    laplace_transform(exp(x),x,s)[0] = 1/(second - 1)
  • convert_to(7foot+3inch,[m])
    convert_to(7foot+3inch,[m]) = 2.2098·meter
  • d(y(t))/dt=-y(t)·λ # LaTeX
    LaTeX output looks good.
  • y(t)= C1exp(-λt) # LaTeX
    LaTeX output looks good.
  • integrate(sqrt(sin(x))/(sqrt(sin(x))+sqrt(cos(x)))) # plot
    [-10. -9.97997998 -9.95995996 ... 9.95995996 9.97997998
    10. ] <class 'numpy.ndarray'>
    :4: RuntimeWarning: invalid value encountered in sqrt
    Integral(sqrt(sin(x))/(sqrt(sin(x)) + sqrt(cos(x))), x))
    Warning in AMaS for integrate(sqrt(sin(x))/(sqrt(sin(x))+sqrt(cos(x))))
    :2: RuntimeWarning: invalid value encountered in sqrt
    return (sqrt(sin(x))/(sqrt(sin(x))+sqrt(cos(x))))
    Warning in AMaS for integrate(sqrt(sin(x))/(sqrt(sin(x))+sqrt(cos(x))))
    /Users/cmholm/bin/AMaDiA/AMaDiA_Files/AMaDiA_Classes.py:1108: IntegrationWarning: The occurrence of roundoff error is detected, which prevents
    the requested tolerance from being achieved. The error may be
    underestimated.
    return scipy.integrate.quad(evalfunc, 0, X)
    <class 'ValueError'> in AMaDiA_Classes.py line 1065 : Invalid limits given: (array([-10. , -9.97997998, -9.95995996, ..., 9.95995996,
    9.97997998, 10. ]),)
  • sqrt(sin(x))/(sqrt(sin(x))+sqrt(cos(x))) # plot
    [-10. -9.97997998 -9.95995996 ... 9.95995996 9.97997998
    10. ] <class 'numpy.ndarray'>
    :2: RuntimeWarning: invalid value encountered in sqrt
    return sqrt(sin(x))/(sqrt(sin(x)) + sqrt(cos(x)))
    (note: plot appears to be correct)
  • (0<x)(x<1)+(x>1)·(x<3)·x+(3<x)·(sin((x-3)*8)/8+3) # plot
    <class 'TypeError'> in AMaDiA_Functions.py line 314 : Relational cannot be used in Mul
    <class 'TypeError'> in AMaDiA_Classes.py line 457 : unsupported operand type(s) for *: 'StrictLessThan' and 'StrictLessThan'
    <class 'TypeError'> in AMaDiA_Classes.py line 1039 : unsupported operand type(s) for *: 'StrictLessThan' and 'StrictLessThan'
    (note: no plot)
  • (abs(sin(x))>0.3)(abs(sin(x))<0.7)(-sin(x)+0.3(sign(sin(x))))+sin(x) # plot
    <class 'TypeError'> in AMaDiA_Functions.py line 314 : Relational cannot be used in Mul
    <class 'TypeError'> in AMaDiA_Classes.py line 457 : unsupported operand type(s) for *: 'StrictGreaterThan' and 'StrictLessThan'
    <class 'TypeError'> in AMaDiA_Classes.py line 1039 : unsupported operand type(s) for *: 'StrictGreaterThan' and 'StrictLessThan'
    (note: no plot)

MacOS Install Notes & First Impressions

Context
I saw your post on /r/coolgithubprojects and I thought I'd chime in a with a few notes on how I got this running on McOS

Missing Packages
I did not have Anaconda installed and wanted to try and run the code without it. After installing the contents of requirements.txt I had to manually install the following packages:

  • PyQtWebEngine
  • packaging

I did not install antlr4 although there is a warning message letting me know it was not installed.

The try-except import statement in AMaDiA/AGeLib/__init__.py obfuscated what packages were missing, consider adding a print statement in the except statement as well.

try:
from AGeLib.AGeMain import *
except ModuleNotFoundError:
from AGeMain import *

First Impressions
The very first thing I ran in to was "how do I close the changelog?" I never figured that out, but I see that it disappeared the second time I ran the software.

At this point the application seems to be running, although I must admit most of it's mathematical capabilities are beyond me!

I tried out the plotter with some simple functions. I did notice some non-intuitive behavior when plotting things in the following orders:

  • x
  • x = 23

In this case the original plot of x does not recalculate or expand to fill the new space. Perhaps this is the intended functionality (to prevent unintentional recalculations of large plots) but I could not find a way to recalculate the equation to fill the new space on the graph.

This is a very cool project and I am going to keep it in mind for my calculating needs!

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.