non linear parameter estimation least squares

3 ビュー (過去 30 日間)
Alex
Alex 2011 年 7 月 6 日
I have the following equation that i want to find the parameters c1, c2 and c3.
E = SUM(yj-(1/(c1*c2))*(c3-asinh(sinh(c3)*exp(c1*j*2*pi))))^2
yj is consecutive timings for a tennis ball, on a string revolving around a pole (the ball cannot change height)
I have found some help with this:
x = [ 1,2,3,4,5 ];
y = [ 2.2, 1.9, 1.7, 1.5, 1.4];
a11 = sum(x.^2); a12 = sum(x); a21 = sum(x); a22 = sum(ones(1,length(x)));
A = [ a11,a12; a21,a22] % the coefficient matrix of the minimization problem
c1 = 1;
c2 = 1;
c3 = 1;
diff_c1 = (c3-asinh(exp(2*pi*x.*c1).*sinh(c3)))/(c1^2*c2)+(2*x.*pi*exp(2*c1*x.*pi).*sinh(c3)*asinh(exp(2*c1*x.*pi).*sinh(c3)))/(c1*c2)
diff_c2 = (c3-asinh(exp(2*c1*x.*pi).*sinh(c3)))/(c1*c2^2)
diff_c3 = (exp(2*c1*x.*pi).*cosh(c2)*asinh(exp(2*c1*x.*pi).*sinh(c3))-1)/(c1*c2)
b1 = sum(diff_c1*y); b2 = sum(diff_c2*y); b3 = sum(diff_c3*y);
b = [ b1; b2; b3 ] % right-hand-side of the minimization problem
c = A \ b % solution of the minimization problem
xApr = 0 : 0.001 : 1; yApr = c(1)*xApr + c(2);
plot(x,y,'*g',xApr,yApr,'b');
Basically diff_c1,c2,c3 are the parts multiplied by the data values yj for least squares minimization, i think this is correct. b1,2,3 are these multiples.
I think the problem is I haven't got my '.''s in the correct place. I know that they are required to say do this for all x and y's but Im not sure exactly where they are required.
I have posted this here because I would also appreciate some help as to whether I am doing this the correct way - because I also require initial values of c1,2,3 which i have stated as 1 but again I am not sure if I have done that correctly
  1 件のコメント
bym
bym 2011 年 7 月 6 日
is there some reason you are not using function like lsqcurvefit ?

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by