Math Help Forum

Math Help Forum Feed Site Feed

Go Back   Math Help Forum > Math Resources > Mathematics Software Discussion
Reply
 
Thread Tools Display Modes
  #1  
Old October 27th, 2009, 03:45 AM
Newbie
 
Join Date: Oct 2009
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
jingzheng is on a distinguished road
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]
Reply With Quote
Advertisement
 
  #2  
Old October 27th, 2009, 04:25 AM
Super Member
 
Join Date: Aug 2008
Posts: 601
Country:
Thanks: 46
Thanked 262 Times in 227 Posts
shawsend is a jewel in the roughshawsend is a jewel in the roughshawsend is a jewel in the roughshawsend is a jewel in the rough
Default

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.
__________________
"I am beset by the ironies in my life"
Reply With Quote
The following users thank shawsend for this useful post:
Donate to MHF
  #3  
Old October 27th, 2009, 04:57 AM
Newbie
 
Join Date: Oct 2009
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
jingzheng is on a distinguished road
Default

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
Reply With Quote
Reply

Tags
fitting curve findfit[]

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -7. The time now is 10:35 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
©2005 - 2009 Math Help Forum


Math Help Forum is a community of maths forums with an emphasis on maths help in all levels of mathematics.
Register to post your math questions or just hang out and try some of our math games or visit the arcade.