Inspiration

Currently, all three of us are taking calculus at Purdue. Anthony discovered a Python library called SymPy which allowed us to compute common calculations in our calculus class. Furthermore, all of us had worked with Python in the past, and while our skills were quite rusty, it was a language we were somewhat familiar with.

What it does

Takes in a mathematical function as user input (can be a function of 1, 2, or 3 variables). It then allows the user to perform the calculus operations of differentiation and integration on it. The user can also choose to find the value of the function at a point or plot it if they wish.

How we built it

For the backend code, we worked in Jupyter Notebook and used Python as our programming language. We used the Python library SymPy, which included methods that could do the calculus operations we wanted it to do. By calling these methods when the user asked for a particular operation to be performed, we could store the result in a variable and print it out for the user to see. For the front end we used Tkinter which helps make simple GUI’s. This was a new process and had to be learned, and we decided to use pack() organization over grid and position as it was the easiest to learn and had the least amount of issues.

Challenges we ran into

First of all, none of us had worked with libraries much before. So we had to figure out how to import libraries and use them. At first we tried to use NumPy, but discovered that the library SymPy was more powerful. However, none of us had even heard of SymPy prior to the hackathon, so we had to learn the syntax of the library and how to properly implement it in the code. Additionally, none of us had worked with linking frontend to backend before. We initially attempted to use the Pyscript library for this. But while we were able to display the graph and take user input separately, we couldn’t figure out how to combine those two parts together. Next, we attempted to learn and use the Tkinter library. We watched tutorials and experimented to try and link the backend code with the user interface. Some of us also had issues with the various IDE’s running between using the command prompt, pycharm, and vs code. These issues required 5-6 hours worth of troubleshooting as python and pip, which are the two most fundamental processes for any code in python, were not working. This also led to many errors where commands weren’t able to run in the IDE terminal and only the command prompt as well as python and pip not being in the path and existing separately. When working with the GUI there were many issues. First of all, realizing which GUI package or program would work the best was difficult to find as we only had 1 day and needed the code to run and learn how to design the front end. We attempted to use html and javascript however it was hard to link to the original python code. We also attempted to explore GDK as well as the python library pyside6 which ran off of python and qt+ which was and IDE for C++ coding and none of us had experience with C++. There were a few other issues as well before we could get started. When we did start designing the GUI section there were issues with refreshing the windows, creating the windows, designing the radio button so that it would be top level instead of using just Tk in order to get it functioning as it didn’t work without it. There were also issues with getting the anchors to work as you need to precede them with tkinter. or the subsequent package name. There were also issues with getting the graph of the functions inbuilt and then getting those graphs to display as well as prompting the user for information.

Accomplishments that we're proud of

We were able to fully complete the backend portion of the project and meet all of our objectives despite never using (or even knowing about) SymPy before and being rusty on our Python skills. Additionally, we were also able to link part of the backend code to the frontend and created an elementary GUI for the calculator despite having zero experience with frontend development.

What we learned

We practiced coding in Python as we completed the project and greatly increased our skills on how to use it. We learned how to use the SymPy Python library in the process while also experimenting with libraries like NumPy and Pyscript (which we didn’t end up using in the final project). Lastly, we gained experience in frontend development in Python using the Tkinter library and learned how to connect the frontend with the backend. We also learned how to make GUI’s using only python through the use of Tkinter.

What's next for Calculus Calculator

We ran out of time to link the multivariable calculus section with the GUI, so that would probably be our next steps. We could also expand the backend section to include limit and series evaluation functionality, as they are also used somewhat extensively throughout calculus. Furthermore, the program doesn’t work when there is invalid user input, so we could account for that.

Built With

Share this project:

Updates