How can I build power function through point?

Please, help me! I have the coordinates of the curve y = [150 150 130 130 130 100 100 100 80 80 80 60], x = [52000 70000 74000 96000 100000 170000 220000 245000 530000 720000 810000 4900000]. This curve well described by power function. How can I build the same curve passing through the point A(68856, 210) and get it equation?

6 件のコメント

Jan
Jan 2019 年 1 月 16 日
編集済み: Jan 2019 年 1 月 16 日
This sounds like a homework question. If this is the case, please post what you have tried so far and ask a specific question concerning your code. By the way, these are your data:
Irene Dzhavadova
Irene Dzhavadova 2019 年 1 月 16 日
編集済み: Irene Dzhavadova 2019 年 1 月 16 日
Sorry I messed up x and y. I tried to approximate this graph in Curve Fitting Toolbox and there I found equation of it. Please help me raise this curve so that it passes through point A and get its equation.
curve2.jpg
results.jpg
Jan
Jan 2019 年 1 月 16 日
The screenshot is hard to read due to scaling.
Torsten
Torsten 2019 年 1 月 16 日
As model to fit, use
y = a*(x^b-210^b) + 68856
Irene Dzhavadova
Irene Dzhavadova 2019 年 1 月 16 日
Torsten, thank you very much for the answer!
But I have an additional question. If I will have not only point A, but several points, how can I approximate these several points and a raised curve?
Torsten
Torsten 2019 年 1 月 16 日
If points are added, you will have to fit your model again. As a result, you'll get different values for a, b and c.

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

 採用された回答

Sayyed Ahmad
Sayyed Ahmad 2019 年 1 月 16 日

0 投票

I would do something like this:
x = [52000 70000 74000 96000 100000 170000 220000 245000 530000 720000 810000 4900000];
y = [150 150 130 130 130 100 100 100 80 80 80 60];
p=polyfit(log(x),sqrt(y),2)
x1=linspace(min(x),max(x),100);
y1=polyval(p,log(x1)).^2;
plot(x,y,'r*',x1,y1,'b-')
I hope that is waht you looking for.
Poly.JPG

3 件のコメント

Irene Dzhavadova
Irene Dzhavadova 2019 年 1 月 16 日
編集済み: Irene Dzhavadova 2019 年 1 月 16 日
Sayyed Ahmad, many thanks! This is exactly how I want. But You solved part of the problem. Maybe you know how to raise this curve so it will pass through point A (68856, 210)? And if I will have not only a point A but a few points, how to approximate this points and raised curve?
Sayyed Ahmad
Sayyed Ahmad 2019 年 1 月 16 日
編集済み: Sayyed Ahmad 2019 年 1 月 16 日
you can shift it.
y(a)-(y1)=dy
y=f(x)+dy
but you could be only met one point. But If you do that, the deviation will increase. I don't want to recomend you this way.
I don't know what is the aim of this calculation. I will try to reduce the standard diviation with changing in the value n in polyfit.
p=polyfit(x,y,n)
n could be 1, 2, 3, 4, 5 and so on.
Try to change them to find out your acceptable p.
x = [52000 70000 74000 96000 100000 170000 220000 245000 530000 720000 810000 4900000];
y = [150 150 130 130 130 100 100 100 80 80 80 60];
for i=1:5
p=polyfit(log(x),sqrt(y),i)
x1=linspace(min(x),max(x),100);
y1=polyval(p,log(x1)).^2;
plot(x,y,'r*',x1,y1,'-')
hold on
end
Poly.JPG
Irene Dzhavadova
Irene Dzhavadova 2019 年 1 月 16 日
Sayyed Ahmad, thanks! I'll try this.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by