How can i find a parameter in a formula when i have three series od data and wanna to find best answer for fourth parameter?

조회 수: 1 (최근 30일)
I have three series od data for x,y and z I wanna find the fourth parameter m(like the best fit for it)in a Maxwell relaxation formula which that is:
z=2*m*x*y
and the series of other parameters are:
z=[0.0892 .158 0.890 1.26 2.47 3.64 6.71 11.6 18.1 27.7 42.0 65.4 97.5 141.0 196.0 283.0 440.0 661.0 863];
x=[0.05 0.628 0.0791 0.0995 0.125 0.158 0.199 0.25 0.315 0.396 0.5 0.628 0.79 0.995 1.25 1.58 1.99 2.5 3.15];
y=[1.42 1.78 2.25 2.83 3.56 4.49 5.65 7.08 8.79 11.01 13.87 17.46 21.8 27.16 33.75 42.34 53.53 67.03 84.11];
I will be grateful for helping me on this case.

채택된 답변

Star Strider
Star Strider 2014년 10월 25일
This works:
z=[0.0892 .158 0.890 1.26 2.47 3.64 6.71 11.6 18.1 27.7 42.0 65.4 97.5 141.0 196.0 283.0 440.0 661.0 863];
x=[0.05 0.628 0.0791 0.0995 0.125 0.158 0.199 0.25 0.315 0.396 0.5 0.628 0.79 0.995 1.25 1.58 1.99 2.5 3.15];
y=[1.42 1.78 2.25 2.83 3.56 4.49 5.65 7.08 8.79 11.01 13.87 17.46 21.8 27.16 33.75 42.34 53.53 67.03 84.11];
xy = [x; y];
fz= @(m,xy) 2.*m.*xy(1,:).*xy(2,:);
CF = @(m) sum((z - fz(m,xy)).^2);
m = fminsearch(CF, 1);
ze = fz(m, xy);
figure(1)
plot3(x, y, z, '+b')
hold on
plot3(x, y, ze, '-r')
hold off
grid on
view([30 40])
It estimates: m = 1.794 and seems visually to give a good fit.
  댓글 수: 8

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by