Results 1 to 3 of 3

Math Help - FindFit[]problem

  1. #1
    Newbie
    Joined
    Oct 2009
    Posts
    2

    Unhappy FindFit[]problem

    Hi,
    I want to make a fitting curve just like '' y=A+B*Log[x^n] '' from the experimental data, but it always doesnt work...

    Here it is:

    data = {{0 , 100}, {0.0008, 126.992}, {0.00195, 147.187}, {0.0033, 164.79}, {0.005, 181.877}, {0.007, 198.982}, {0.01, 219.833}, {0.015, 246.441},{0.02, 278.042}, {0.027, 308.821}, {0.037, 341.473}, {0.047, 362.767}, {0.06, 379.048}, {0.08, 394.5}, {0.1, 405.422}, {0.12, 412.5}, {0.14, 415}, {0.17, 418}, {0.2, 420}, {0.24,
    421}, {0.282, 422}}
    model = a + b Log[x^n]
    funk = FindFit[data, model, {a, b, n}, x]

    and this is the warning:
    FindFit::nlnum: The function value {Indeterminate, -133.123, -152.427, -169.504, -186.175, -202.944, -223.438, -249.641, -280.954, -311.433, <<11>>} is not a list of numbers with dimensions {21} at {a, b, n} = {1, 1, 1}.

    I used the order to prove the data is numerical, but have no idea what the nonrectangle means...
    Thanks a lot!
    [IMG]file:///c:/temp/moz-screenshot-2.jpg[/IMG]
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member
    Joined
    Aug 2008
    Posts
    903
    The first point is {0,100} and that's causing the indeterminate part with Log(0). Try changing it to a very small value like 10^{-8} or so.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Oct 2009
    Posts
    2
    thanks to shawsend, that problem has been solved.

    but I am a little dumb and here is another problem, if anybody is glad to get rid of it

    model = a + b x^n
    funk = FindFit[{{0, 100}, {0.0008, 126.992}, {0.00195, 147.187}, {0.0033, 164.79}, {0.005, 181.877}, {0.007, 198.982}, {0.01, 219.833}, {0.015, 246.441}, {0.02, 278.042}, {0.027, 308.821}, {0.037, 341.473}, {0.047, 362.767}, {0.06, 379.048}, {0.08, 394.5}, {0.1, 405.422}, {0.12, 412.5}, {0.14, 415}, {0.17, 418}, {0.2, 420}, {0.24, 421}, {0.282, 422}}, model, {a, b, n}, x]

    the warning shows:
    FindFit::njnum: The Jacobian is not a matrix of numbers at {a, b, n} = {1., 1., 1.}.

    if the value of n is given, e.g. n=0.1, I can get results( like a -> -41.9803, b -> 506.786), but the result is not good enough, even I try all the kinds of value of n (from o.o1 to o.3). so maybe let the software choose the value of parameter itself is the best way. but now the problem is about Jacobian, is something to do correct it ?
    Thanks again
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. MATHEMATICA FindFit experimental data
    Posted in the Math Software Forum
    Replies: 6
    Last Post: February 13th 2010, 03:50 PM
  2. findfit mathematica
    Posted in the Math Software Forum
    Replies: 1
    Last Post: December 13th 2009, 03:48 PM
  3. Problem with FindFit[]
    Posted in the Math Software Forum
    Replies: 2
    Last Post: October 13th 2009, 03:42 PM
  4. Mathematica FindFit - proper format question
    Posted in the Math Software Forum
    Replies: 8
    Last Post: September 27th 2009, 07:59 AM

Search Tags


/mathhelpforum @mathhelpforum