Nonlinear Fit
- To: mathgroup at smc.vnet.net
- Subject: [mg59855] Nonlinear Fit
- From: Kevin Towles <kbt22 at drexel.edu>
- Date: Wed, 24 Aug 2005 06:30:23 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I am trying to do a nonlinear fit of a function that contains a numerical integration. My problem is that when I call the nonlinear fit, it tries to evaluate within the nonlinear fit call. For example: Test=Function[{x1,a1}, NIntegrate[a*x^3,{x,0,100}] ]; NonlinearFit[data,Test[x,a],x,{a,0,1}] Here I have a variable x and a parameter a. This would return an NIntegrate error saying that 'NIntegrate is not numerical at x={50.}' because there is an unknown, a, in the integration. It tries this a couple times and then shuts off the functioning of NIntegrate for further calculations, making fitting this impossible. Is there a way to fit this kind of situation without having the test function evaluate prior to fitting occuring? Thanks for any help, Kevin Towles