### JavaScript Graphing Calculator

With this calculator you can find the best fit function for a set of data. Unlike a typical "graphing calculator" with a solve function that can solve equations for just one unknown, this calculator can solve equations for multiple unknowns.

The process of fitting a function to a set of data involves four distinct steps:

This web page walks you through those steps. It uses the Simplex method to optimize more than one parameter at the same time. The idea is that you can fit any function as long as you have at least as many items of data as you have parameters. (Typically we try to have several more pieces of data than parameters.)

If you don't have any data, you can always solve an equation for one parameter. If that is what you want to do, then skip Step 1 and indicate that you don't want to use data.

The first thing we need is a set of data. Either enter your own data or check out one of the predefined data sets listed below for examples.

 Quick Plot

Press Quick Plot to take a quick look at the data. If they look OK, you are ready to choose a function.

You can enter your own equation using the variables you have defined or select one of the predefined equations to solve. In each case, there should be one or more parameters (such as m and b, or a and k) and one or more variables (such as x, y, T, or t).

If you are using data, then at this point the variables must be from columns of your data, and the job is to solve for the parameters that make the best fit for a given function. But if you are not using data, then what is a "parameter" and what is a "variable" doesn't really matter.

Once you have chosen a function and assigned variables, you are ready to solve for the parameters.

If you only want to optimize some of the parameters, add a second '=' at the end of the line for all parameters you wish to optimize. Note that without reasonable starting conditions, you may get "bogus" solutions! In addition, if only one parameter is allowed to optimize, you don't really need any data at all.

Graphing Options

.