Performs a regression
from given data ('Data table' or Excel), to find the underlying
parameters in a set of multiple functions of
a single variable.
The functions are
y1 = a x + b and
y2 = a x² + b x + c,
and the parameters to be determined by fitting are, obviously,
a, b and c.
This is an application of the Python
'minimize' function, in the 'scipy.optimize' module, a part of the
Python 'SciPy' library.
Advantage is taken from: PHP,
for the web page; and Python for the numerical segment;
and 'gnuplot', for plotting.
Draws a plot of the original and
the adjusted data.
Computation structure — A PHP file
(this page: 'P-fitFuncs.php') calls (via
'action=...') an intermediate PHP file ('FitFuncs.php'), which
(through $_POST) sends the problem data as command line arguments to
a Python script. This last does the computing, and makes
'system' call(s) to 'gnuplot', for the final (temporary) webpage.
Files involved:
P-curFitODE.php (this one),
CurFitODE.php,
curFitODE.py.
Keywords: PHP, command line arguments,
Python script, gnuplot. |