π JaCAS: A Java Computer Algebra System π
π Functionalities:
- derivative at a point
- definite & improper integrals
- graphing
- series
- statistics functions (significance tests, linear regression, etc.)
- root tests
- and other various calculations...
π Here are some screenshots of our UI for the calculator:
π The Algebra class contains code for computing the zeros of a function, using one of Newton's algorithms. Using our derivative logic from the Calculus class along with the bisection step, we can compute the zeros of a Function object. The bisection step helps us find the roots of a function within a certain region, whose result is incorporated into the actual root calculating method.
π The Calculus class contains code logic for computing definite & impropoer integrals, derivative at a point, series (with respect to sums), and end behavior of a function. The definite integral method uses a for loop to iterate over a certain interval on the x-axis, and utilizes many, many midpoint Riemann sums to provide an extremely accurate result (a variation of the formula is shown below). The improper integral method makes use of the derivative & definite integral calculator in order to approximate the integral of a function as x approaches -β or +β. If the absolute value of the derivative is very close to 0 as
π The Function class defines all functions used for computations and other mathematical methods in binary pairs. On input, all functions are simplified to multiple Function objects that contain each other so that large functions can be simplified into binomial or monomial expressions. This creates a virtually recursive system since each function can invoke the compute() method on its parameters, which will then compute there parameters, and so on and so forth. This means that all variables, numbers, operations, and functions are stored as Function objects, making parsing from Reverse Polish Notation to a Function object very easy. The Function class also remembers all computations that it performs, so if the Function is computed at a certain point, it will simply return the previously calculated value without recalculating the value in order to save time.
π The graphing algorithm graphs all points of a function, or multiple functions, on a coordinate plane. It uses a while loop that evaluates each function on a defined interval in order to produce the graph. All the points are then connected with small line segments since this allows the graph to be more smooth and accurate. The grapher also includes generation for the coordinate axis and even gridlines that can be spaced apart at set intervals.
π The GUIv3 class contains code for generating the entire UI, sometimes using Netbeans and Visual Studio Code. The UI is developed using Java Swing, a desktop application library. All the code to integrate the backend with the frontend was made possible by java.awt.event.MouseEvent evt to detect mouse input. By writing listeners on all the buttons, we were able to detect and use input from the frontend. We developed 3 versions of the UI before arriving at our final version.
π The InfixParser class contains methods for parsing infix expressions like (x^2+1) into Reverse Polish notation. Reverse Polish notation is easier for our algorithms to process, so it is imperative that we correctly convert infix expressions. It needs to respect the order of operations, so we resorted to an algorithm invented by Edsger Dijkstra to do just this: The shunting yard algorithm(named for its resemblance to a train shunting yard) π. The infixparser class has some helper methods and one static method: parse(String infix). This method runs the shunting yard algorithm and returns the RPN version of the input string.
π This is just a class we use to test certain methods, logic, etc.
π The Statistics class is essentially split into 2 parts, linear regression significance tests. The linear regression part of the class contains code logic for certain statistics and equations, such as the least-squares regression line (LSRL), the correlation coefficient
π These classes define exceptions for invalid mathematical calculations or anything that makes function computation incorrect.
The ArithmeticException defines an arithmetic exception that is thrown when an invalid mathematical operation is done. For instance, dividing by zero would result in an ArithmeticException.
The OperatorOnlyException class defines a specific exception that will be thrown, when a Function object is only an operator and nothing else.
The InvalidInputsException class defines a specific exception that will be thrown, when a Function object is inputted incorrectly. The InvalidInputsException class defines a specific exception that will be thrown, when a Function object is inputted incorrectly.
The VariableDefinitionException defines a specific exception that will be thrown when a variable is not defined.













