matlab y=a/x+b fitting sets b=y for x-> 0 instead of infinity

2 views (last 30 days)
I'm trying to fit my data to a y=a/x+b curve using the custom equation in cftool. However, it seems that in this format, it sets b equal to y for x going to zero (rather than infinity). Any tips?
(actual equation is y=a/x^1/3+b/x+c, used y=a/x+b in this question for simplicity)

Accepted Answer

Star Strider
Star Strider on 16 Aug 2015
No tips.
Your y is going to +Inf as x->0+ (that is x->0 from the positive direction) regardless. (It also goes to -Inf as x->0-.) You can’t escape either mathematical reality or gravity.
Nevertheless, congratulations for trying to!
  3 Comments
John D'Errico
John D'Errico on 16 Aug 2015
Edited: John D'Errico on 16 Aug 2015
I had to laugh at Star's response. +10
I might only add that in the results that you show, it has a and b with different signs. That invalidates the claim that c will be the upper bound for this function for positive x. Of course, it will still be the limit as x --> inf.
Star Strider
Star Strider on 16 Aug 2015
Edited: Star Strider on 16 Aug 2015
Thank you, John!
@zeb — I don’t understand what you’re attempting to model, but you may need to question the applicability of your model equation to your data, even though it is a quite good fit. (I don’t recognise it as any thermodynamics equation I’ve ever seen.) Your extrapolating to volume -> infinity may not be appropriate because you only have data over a limited range (I only see four points plotted).
It’s never a good idea to extrapolate beyond the region of fit.
What value does y converge to as x -> +Inf in the literature you’ve consulted? If you have those data and that value is not c, then your model may not appropriate for your data.
EDIT — The ‘b’ (or ‘c’, depending on the equation you’re referring to) parameter need not be larger (or smaller) than the largest (or smallest) any of your y-values. You’re fitting a regression equation, and your data by definition have some amount of noise (process noise, measurement noise, etc.), so the estimated parameters will estimate the asymptotes, producing a best fit to the data. It is reasonable to assume that the curve might never exactly equal any of the data used to fit it. The asymptotes are parameter estimates as are all the other parameters, and have to fit the data, not your expectations for them.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!