Exporting Differential Equations from Polymath to Excel

See Also: Exporting from Polymath to Excel  Nonlinear Equations Solver  Variables and Expressions 


The "Export to Excel"  function of Polymath is found in the drop-down Program menu at the top of the Differential Equations problem screen.  A problem should be exported after it has been completely entered successfully into Polymath and ready for solution. It is good practice to also solve the problem in Polymath so that the solution in Excel can be compared and verified.  Upon export, the problem in Polymath will be completely transferred into Excel.  This transfer automatically includes the translation of logical statements and the intrinsic functions from Polymath into equivalent functions within Excel.  This transfer is conveniently illustrated by using Example 1 of the Differential Equations Solver.  The transfer to Excel is carried out by either clicking on the Excel icon or selecting 'Export to Excel' from the Problem menu: 

 

 

 

The resulting problem is opened up in a new spreadsheet within Excel as shown below:

 

 

Note that all of the information from Polymath has been transferred including the variable names, the values, the Polymath equations, and the comments.  The actual ordinary differential equations, which are highlighted in red, are ready for a numerical solution. The initial conditions are colored cyanide. This initial condition of the independent variable is in the black box. This entire solution is entered into Excel with variable cell addresses; therefore, the complete solution can be copies to any other location with the spreadsheet book for execution.

 

A special Polymath ODE_Solver Add-In must be used to carry out the numerical integration.  You must insure that Ode_Solver Add-In is installed in your Excel software.  This is accomplished from the Tools/Add-In menu of Excel where Ode_Sover should be checked.

 

        Click here for more information on the Ode_Solver and its installation within Excel.

 

The solution is initiated by going to Tools/Polymath ODE... and then filling out the Solver window as shown below:

Note that you must place the initial conditions in the upper left box labeled ODE initial values vector (Y), and this can be simply accomplished by clicking in the empty box and them immediately taking the mouse from the upper cell to the lower cell for the initial conditions.  Similar operations identify the needed inputs to Ode_Solver.  Note that the "Intermediate cells to Store" is a vector of the additional problem variables to calculate during the solution, and it is optional. The "Adv." button lets you select the integration algorithm and adjust other solution variables.  Usually the default RKF45 is quite adequate for all problems.

 

Shortcut: The "Reload" button will set up the exported problem completely with the exception of the "Intermediate Cell to Store".  This button will also restore the settings for a previous integration as well.

A click on the Solver button will initiate the numerical integration.  The variables will change as the integration proceeds.  After the integration has reached the final value of the independent variable, "t" in this case, you will have the option of retaining the solution (OK) or  canceling the solution (Cancel). 

 

The problems solution will be provided in a worksheet on the Excel spreadsheet labeled "DEQ Solution". Make sure to "Exit" the Ode_Solver before you continue.  When you click on the solution worksheet, you find the details of the differential equations solution as shown below:

 

This output sheet is very similar to the Polymath Report reproduced below: 

You can also add the variable names to their appropriate cells by using your mouse by copying an pasting the names from the main program worksheet.  Advanced Excel users might want to consider using the "Rename" feature.

 

The remainder of the output sheet contains the variable information for each of the points requested for the integration. 

 

The plotting feature of Excel can be used to generate the needed curves from this output table.