The Euler’s Graphical User Interface Spreadsheet Calculator for Solving Ordinary Differential Equations by Visual Basic for Application Programming

In the previous work on Euler’s spreadsheet calculator for solving an ordinary differential equation, the Visual Basic for Application (VBA) programming was used, however, a graphical user interface was not developed to capture users input. This weakness may make users confuse on the input and output since those input and output are displayed in the same worksheet. Besides, the existing Euler’s spreadsheet calculator is not interactive as there is no prompt message if there is a mistake in inputting the parameters. On top of that, there are no users’ instructions to guide users to input the derivative function. Hence, in this paper, we improved previous limitations by developing a user-friendly and interactive graphical user interface. This improvement is aimed to capture users’ input with users’ instructions and interactive prompt error messages by using VBA programming. This Euler’s graphical user interface spreadsheet calculator is not acted as a black box as users can click on any cells in the worksheet to see the formula used to implement the numerical scheme. In this way, it could enhance self-learning and life-long learning in implementing the numerical scheme in a spreadsheet and later in any programming language.


Introduction
Applying numerical methods in classroom purpose by using calculator can be tedious and boring due to their repetitive calculations. Hence, there is a series of papers which is working on applying numerical methods in classroom purpose by using a spreadsheet with or without using Visual Basic for Application (VBA) programming has been discussed. Moreover, by employing VBA programming, a spreadsheet calculator or solver with a user-friendly graphical user interface (GUI) has been developed in recent papers. For examples, by using VBA programming, a nonlinear equation GUI [1] has been developed.
Originally, without using VBA programming and GUI, solving the non-linear system by using Newton's method in a spreadsheet was discussed in the paper [2], whereas Kek and Tay [3] developed a solver for a system of linear equations in a spreadsheet. The interpolation solver using Newton's divided difference and Lagrange interpolation was explored in the studies [4] and [5] respectively. On the other hand, a bivariate approximation spreadsheet calculator [6] has been developed. On top of that, approximating the dominant and smallest eigenvalue using spreadsheet has been discussed in the works [7] and [8] respectively. Next, a numerical differentiation spreadsheet calculator [9]  developed. Then, a series of work on developing Richardson' extrapolation spreadsheet calculator or solver [10][11][12][13][14] can be discovered. Later, a Romberg Spreadsheet Calculator [15] has been created for numerical integration.
Furthermore, the tips on how to implementing the fourth-order Runge-Kutta (RK4) method on solving a single ODE and a system of ODEs in the spreadsheet were demonstrated in [16][17], respectively. While a spreadsheet calculator as discussed in [18][19] has been developed for solving a system of ODEs and a single ODE by using the RK4 method with VBA programming. A spreadsheet calculator [20] has been developed for solving a single ODE by Euler's method with VBA programming. Lastly, in [21] it has shown the tips on how to solve Laplace equation using a spreadsheet.
It is commented that the study [20] works on solving ODE by Euler's method with VBA programming, however, there is no GUI provided, so users may confuse the input and output. Besides, the existing Euler's spreadsheet calculator is not interactive as there is no prompt message if there is a mistake in inputting the parameters. On top of that, there are no users' instructions to guide users to input the derivative function. Hence, in this paper, we developed an interactive and userfriendly GUI for solving a single ODE by Euler's method with users' instruction and interactive prompt error message by using VBA programming.

Euler's method for Solving Ordinary Differential Equations
Consider a general form of the first-order ODE (1) as given below: Here, x is the independent variable, y is the dependent variable, n is the number of point values, f is the function of the derivation and h the fixed step size. The aim is to determine the discrete values of unknown function () yx whose derivative satisfies (1) and the corresponding initial value. In doing so, the interval x is discretized to be 0 1 0 Hence, Euler's method which is given by (2) gives the numerical approximation to determine the discrete values of the unknown () yx .

Numerical Example
A simple RL-electrical circuit consists of electrical current i (in amperes), resistance R (in ohms), inductance L (in Henrys), and electromotive force () Et (in volts) as shown in figure 1 below.

Solution
Step 1: Given Step 3: Apply the Euler GUI spreadsheet calculator which is given in the next section to obtain the numerical solution. Figure 2 shows the initial Euler GUI Spreadsheet calculator worksheet. It consists of the Input button, information of the solved ODE in the box and solution of the ODEs under the box.

Figure 2. Initial Euler GUI Spreadsheet calculator worksheet
Once the Input button is clicked, the default GUI will be popped up as shown in figure 3. Users may click the Compute button to recalculate the default typed ODE and its full solution will be given in figure 2. To input a new ODE, users may click the Clear button to clear the default parameters. To close the GUI, users may click the Close button. The top portion of the GUI displays the general form of the IVP of the first-order ODE with its intervals as well as the Euler's method formula. On the other hand, the left portion enables users to define the independent and dependent variables of the ODE to be solved, the right-hand side derivative function of the ODE, the range to be solved, initial condition and a step size h. Users are also allowed to choose the desired accuracy of calculations (number of decimal places used in the calculations) by selecting the drop down box of Accuracy. If  The parameters to be entered in order to solve the numerical example in section 3 are shown in figure  4. The full solutions of the numerical example in section 3 is displayed in Excel worksheet as given in figure 5. Notice that the GUI is not acted like a black box where students cannot learn the process of the Euler's method for solving an ODE. This is because users can click in any cell in figure 5 to see the formula used in order to solve an ODE by Euler's method. For example, users can click in cell D17 and its formula appears on top of the formula bar as shown in figure 5. This will enhance the self-learning and life-long learning of the students since in class students are taught how to solve the numerical methods using calculator only. For beginners who just learn numerical methods without the knowledge of programming, Excel may serve as a beginning step for them to implement and visualize the numerical scheme as the nature of Excel is in tabular form and users can see its immediate formula and results in the worksheet.  On top of that, the GUI is interactive as the defined variables and the inputted function are not tally, an error message will pop out as seen in figure 7. Besides, if the starting or ending points of the interval to be solved is not provided, but Compute button is clicked, then an error message as seen in figures 8-9 will appear. Furthermore, if the initial condition is not entered, whereas Compute button is clicked, again another error message will pop out as displayed in figure 10. Lastly, if Compute button is clicked without a step size h then users will be prompted by a corresponding error message as pictured in figure 11.

Conclusion
An interactive Euler's GUI spreadsheet calculator for solving a single ODE has been developed by using VBA programming. We hope that this Euler's GUI spreadsheet calculator can serve as a numerical tool to help educators to prepare their marking scheme and students to obtain full solution quickly and easily. Once users click on any cell in the solution which is given in Excel worksheet, they can see the corresponding formula used to solve an ODE by using Euler's method. Thus, this Euler's GUI spreadsheet calculator is not only a black box which let students obtaining the full solution without understanding its procedure, but will enhance self-learning and life-long learning process of the students toward to implement the numerical scheme in Excel spreadsheet and in any programming language later on.