フィルターのクリア

Data fitting using Linear Programming function

3 ビュー (過去 30 日間)
Sam
Sam 2011 年 11 月 12 日
Hello Everyone
I am new here, i had a question regarding linprog function. here is the description of the problem, below that is my attemtped code, please take a look at it, the problem i have is the constraint ap2 which should be 1.5, but putting it in a matrix form that would make the algorith work.
Now the reason i am here, is to seek assistance with this problem
suppose you want to fit the data set { tau(t); I(t); B(t)} available in the workspace, with the model
τau(t) = q1.(I^q2).(B^q3)
  1. Reformulate the problem as a linear optimization one and introducethe constraints α2 < 0, α3 = 1.5 (Hint: transform the data using ln).
  2. Write the corresponding Scilab algorithm using linpro
%Suppose we have the data {tau,I, B}
%initial values of the parameters, the parameters to be found
ap1=0.5;
ap2=-1;
ap3=1;
%the model equation Tau=ap1*(I^ap2)*(B^ap3);
% linearize by log
log(tau)=Y;
lap=log(ap1);
Y= lap+ap2*log(I)+ap3*log(B)
% the constraints are ap2<0; ap3=1.5;
%the objective c= Y-log(ap1)+ap2*log(I)+ap 3*log(B)
c=[1;log(I);log(B)] % linprog solves minimization problems
%alpha < 0
ub= zeros(2);
xsol=linprog(c,[],[],[],[],ub);
how can i otherwise approach the problem if my method isn't right.
Thank you a lot folks

回答 (1 件)

Sam
Sam 2011 年 11 月 15 日
Can anybody suggest how to approach this problem, please
I appreciate some suggestions

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by