MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Help with Nonlinear Fitting?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg43810] Help with Nonlinear Fitting?
  • From: "Lisa M. Downward" <lmd at physics.ucsc.edu>
  • Date: Tue, 7 Oct 2003 02:40:50 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hello,
   I am trying to fit some experimental data with a model that is 
represented by an integral,  the problem is the integral cannot be solved 
analytically and needs to be evaluated numerically.  I have used the 
following approach:

(define model)

model[T_]:= N[Integrate[(v/3) * Cp[x,T] * lambda[x,T], {x, 0.0001, 340/T}]

(for those of you who are not familiar with it, this is thermal 
conductivity data, where Cp is the specific heat and lambda is the mean 
free path)

(The functions Cp and lambda, are defined separately for readability, I 
have not included them here for brevity.)

Then i run a fit,

NonlinearRegress[data,model,{{g,0,10},{c1,0,10},{c2,0,10},etc.}]

According to the help files this should constrain the parameters to the 
range 0 to 10 (negative values are non-physical). When I run the fit 
without the constraints, at least one of the parameters always goes 
negative, and when I run the fit WITH the constraints, Mathematica seems 
to ignore the constraints and still makes at least one negative, but 
changes the starting values.  This is when I run it in Mathematica 4.1.  
When I try to run it on Mathematica 5.0, the fit won't even run at all.  
It doesn't seem to like the way the model is defined.  After searching 
through the help files, it seems there was a change in the  
NonlinearFit and NonlinearRegress algorithm between v4.1 and v5.0.  It 
seems as if they are phasing out NonlinearFit all together and now want 
us to use FindFit, but I can't get that to work either.  Has anyone else 
experienced this problem?  I would appreciate any suggestions.

Thank you,
   Lisa

-- 
Lisa M. Downward                        Office:     Nat Sci II 328
UCSC Physics Dept - Graduate Student    Office Ph:  (831) 459-3646
Santa Cruz, CA 95064                    
"It has just been discovered that research causes cancer in rats."


  • Prev by Date: RE: assigning a set of initial values
  • Next by Date: Re: Summation Problem w/ 5.0
  • Previous by thread: How can I submit the reference to a publication that used Mathematica?]]
  • Next by thread: Re: Help with Nonlinear Fitting?