I've created the following auxiliary function which outputs some data to a file, calls an external FORTRAN program which reads the data. Mathematica then reads the output from the FORTRAN code, and then performs a calculation, a least squares sum.
By itself the function works fine, if I give it a value of say Lse[1,1], I get a reasonable output. So far so good. However, I would like to use a standard Mathematica routine like "Minimize" to find optimal values for the input parameters x and y to minimize the least squares sum in the last line.
that gives an error. It actually writes "x" and "y" to the data files which crashes the FORTRAN code.
Any suggestions how to get around this?