How to implement a solve block in a subroutine
- December 1, 2014
- 1 reply
- 2059 views
I need to fit data to a function with 5 variables and have Mathcad 15. The parameter estimation works fine with a solve block and Minerr in a straight program.
However, when a define a subroutine for the parameter estimation I get an error in the subroutine. I need the subroutine to automate the fitting of a large set of data with Minerr() and the constraints. I wrote an initial program with genfit() that works for large data sets in an Excel file, but I need the constraints that can be used with Minerr() because genfit() gives occasionally physically impossible answers.
2 files are attached, one with the solve block in the main program that works and another with the solve block in a subroutine that gives an error. There are no data to be fitted in the program because they are dynamically loaded from an Excel file. I would appeciate any help for solving my problem. I have not seen example files with solve blocks in a subroutine.
Thanks. Ulrich

