how to find the equation that best fit this curve

14 ビュー (過去 30 日間)
Danilo NASCIMENTO
Danilo NASCIMENTO 2014 年 8 月 24 日
コメント済み: John D'Errico 2014 年 8 月 24 日
Hello guys
I want to find a equation that best fit this curve I'm sending attached. I tried a polynomial approximation but it does
not work
  1 件のコメント
Star Strider
Star Strider 2014 年 8 月 24 日
What process produced these data? How best can you describe that process?

サインインしてコメントする。

採用された回答

per isakson
per isakson 2014 年 8 月 24 日
編集済み: per isakson 2014 年 8 月 24 日
See SLM
Description: If you could only download one curve fitting tool to your laptop on a desert island, this should be it. [...] &nbsp SLM - Shape Language Modeling by John D'Errico
  1 件のコメント
John D'Errico
John D'Errico 2014 年 8 月 24 日
編集済み: John D'Errico 2014 年 8 月 24 日
:)
Ok, I'd also make sure I had a spare battery for my laptop. Do they sell solar powered laptops now?

サインインしてコメントする。

その他の回答 (3 件)

Roger Stafford
Roger Stafford 2014 年 8 月 24 日
編集済み: Roger Stafford 2014 年 8 月 24 日
The right side of this curve looks as though it is asymptotically approaching a descending straight line. The left side doesn't look as if is approaching infinity, but more like y = 38 (or thereabouts) at x = 0 with an infinite derivative at x = 0. It looks very much like one branch of a hyperbola. Try adjusting constants A and B to make the hyperbola
y = 38 - sqrt(A*x+B*x^2)
fit the curve. (Just a guess.)
  2 件のコメント
Star Strider
Star Strider 2014 年 8 月 24 日
My guess was:
f = @(b,x) (b(1).*x + b(2)) + exp(b(3).*x);
Never got data to fit it, though.
John D'Errico
John D'Errico 2014 年 8 月 24 日
Star - that one has the wrong behavior at x == 0. It won't fit well.

サインインしてコメントする。


John D'Errico
John D'Errico 2014 年 8 月 24 日
編集済み: John D'Errico 2014 年 8 月 24 日
There is an obvious singularity at x == 0. This suggests that a polynomial model will be useless, or at best poor. Polynomials do not have singularities, so you would need a high order polynomial. (When you try to fit a polynomial to a function with a singularity, it will do strange things. You will need to use a high order, and that in turn will be a problem.)
Likewise, my own SLM will have problems. Again, splines don't like singularities.
However, IF you swap the x and y axes, you will be able to gain a very nice fit, using a variety of tools. Essentially you will build a model of the form
x = f(y)
This model will have no singularities. A spline model (like SLM) will be trivial to fit. Polynomials will also work well enough in this inverse form since there will be no singularity.
To evaluate the model now is slightly harder, but still easy enough. For a polynomial mode, f(y), any given x to find y, use roots or fzero. Thus you would find the roots of the polynomial in y
f(y) - x == 0
If f(y) was built using SLM, then use SLMEVAL, which can invert a spline model.
If you insist on trying to fit a model of the form
y = f(x)
then you will need terms in the model that have a singularity in them. So a logical starting model might have terms like this:
y = a0 + a1/x + a2/x^2 + a2*x + ...
so a polynomial with some terms with negative exponents. My own polyfitn (also found on the file exchange) would work. Regardless, that model may be difficult to fit well using least squares because of the singularity.

Image Analyst
Image Analyst 2014 年 8 月 24 日
The Taylor series says that it will work if you include enough terms. The Taylor series can fit any continuous curve given enough terms, just like the Fourier series (which uses sines and cosines instead of polynomials). So you can use polyfit().

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by