How to fit linear plateau equation ?

조회 수: 3 (최근 30일)
madhuri dubey
madhuri dubey 2018년 12월 8일
댓글: Bruno Luong 2018년 12월 10일
I want to fit linear equation with plateau condition.
y=a(x+n)+b
These are the data in which I Want to fit:
x=[0,80,100,120,150],
y=[1865,3608,4057,4343,4389]
I don not know how to find the plateau value of yield.
  댓글 수: 3
madhuri dubey
madhuri dubey 2018년 12월 8일
Ok the another data data set is
x= x=[0,40,80,100,120,150,170,200],
y=[1865,2855,3608,4057,4343,4389,4415,4478]
I don't know how to fit plateau condition in linear equation that is why i asked to help. The plateau condition are given here;
x < xc(Ymax) ;
y=yp, x >= xc(Ymax)
John D'Errico
John D'Errico 2018년 12월 10일
I give up.

댓글을 달려면 로그인하십시오.

채택된 답변

Bruno Luong
Bruno Luong 2018년 12월 10일
편집: Bruno Luong 2018년 12월 10일
You can use this FEX file (BSFK)
The code is by default use QUADPROG from MATLAB, but can also work with QPAS project by Adrian Wills for user who has not access to optimization toolbox as showed below:
x=[0,40,80,100,120,150,170,200];
y=[1865,2855,3608,4057,4343,4389,4415,4478];
opt = struct('KnotRemoval','none','sigma',1,'qpengine','qpas');
pp = BSFK(x,y,2,2,[],opt);
% prepare graphical data
xi = linspace(min(x),max(x));
yi = ppval(pp,xi);
xb = pp.breaks(2);
yb = ppval(pp,xb);
clf
plot(x,y,'or',xi,yi,'-b');
xline(pp.breaks(2));
text(xb,yb,sprintf('(%g,%g)',xb,yb));
  댓글 수: 3
John D'Errico
John D'Errico 2018년 12월 10일
Note that the upper line segment is not held constant in your solution, as it seems the OP wants.
Bruno Luong
Bruno Luong 2018년 12월 10일
I don't know exactly what he wants, I did not follow the thread closely.
I give the code if he is not happy then I hope he'll come back with further request.
If the plateau must be constant I can enfore the derivative to 0.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Least Squares에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by