Question: NonLinearFit - Operator mode

Hi!

Here below is the code I got problems:

#################################

Dens := proc(v)
local theta, r;
evalf[8](
    Int(
        Int(
            4*r/(1-0.84*cos(theta)^2)^(1/2)*exp(-r*(6.25-5.245*cos(theta)^2)^(1/2))
        , theta = 0. .. 2*Pi)
    , r = 0. .. v)
) assuming v>=0
end proc;

#
#

FitFinalDens := NonlinearFit(
  b*(1+a*u)/u*Dens(u/(1+a*u))
, depth
, veloc
, [u]
, initialvalues = [a = 1.4, b = 0.13]
, parameternames = [a, b]
, output = [leastsquaresfunction, residuals, parametervector]
, parameterranges=[a=1.1..3.0,b=0.02..0.8]
);

#################################

Then, I obtain two sort of errors:

First error message:

Error, (in Statistics:-NonlinearFit) invalid input: no implementation of NonlinearFit matches the arguments in call, 'NonlinearFit(0.13*(1.+1.4*u)*(int(int(4*r/..........

etc...

 

Second error message:

Error, (in Statistics:-NonlinearFit) complex value encountered

 

So, really I don't known how to correct the code.

I tried a lot  of things such as using  "value" command,  "Re" command, etc.

Do you have a solution?


Sincerely yours.

 

Jacqr

 

 

Please Wait...