How to get fine fitting of B-M equation with high nonliearity?

조회 수: 1 (최근 30일)
L world
L world 2022년 8월 5일
댓글: Rena Berman 2022년 8월 23일
I have tried to fit Birch's equation like below:
but I could not get fine fit..
This is my code.
clc
clear all
data=[208.75 -171.04204447
227.72 -195.21101066
247.80 -212.78884133
269.03 -224.97316547
291.44 -232.75405432
315.06 -236.95077221
339.92 -238.24362657
366.05 -237.19727153
393.50 -234.28678793
422.28 -229.90809458
452.43 -224.39439701
483.98 -218.02503783
516.97 -211.03510699
];
V=data(:,1);
E=data(:,2);
ft=fittype( 'E0+9/16*(V0*B0)*Bp*((V0/V)^(2/3)-1)^3+(((V0/V)^(2/3)-1)^2)*(6-4*((V0/V)^(2/3)))', 'independent', {'V'}, 'dependent', {'E'}','coefficients',{'E0','V0','B0','Bp'})
[fitresult, gof] = fit( V, E, ft,'StartPoint',[-1 1 4 1])%, opts );
figure( 'Name', ' B-M' );
h = plot( fitresult, V, E );
legend( h, 'Energy vs Volume', ' B-M Equation of State', 'Location', 'NorthEast' );
xlabel('Volume (A^3)');
ylabel('Energy (eV)');
grid on
Please check my code for good fitting and wether there is error for a fit.
please someone give me any comments.
Best regards
  댓글 수: 5
Star Strider
Star Strider 2022년 8월 6일
The originally posted code:
clc
clear all
data=[208.75 -171.04204447
227.72 -195.21101066
247.80 -212.78884133
269.03 -224.97316547
291.44 -232.75405432
315.06 -236.95077221
339.92 -238.24362657
366.05 -237.19727153
393.50 -234.28678793
422.28 -229.90809458
452.43 -224.39439701
483.98 -218.02503783
516.97 -211.03510699
];
V=data(:,1);
E=data(:,2);
ft=fittype( 'E0+9/16*(V0*B0)*Bp*((V0/V)^(2/3)-1)^3+(((V0/V)^(2/3)-1)^2)*(6-4*((V0/V)^(2/3)))', 'independent', {'V'}, 'dependent', {'E'}','coefficients',{'E0','V0','B0','Bp'})
[fitresult, gof] = fit( V, E, ft,'StartPoint',[-1 1 4 1])%, opts );
figure( 'Name', ' B-M' );
h = plot( fitresult, V, E );
legend( h, 'Energy vs Volume', ' B-M Equation of State', 'Location', 'NorthEast' );
xlabel('Volume (A^3)');
ylabel('Energy (eV)');
grid on
I had that open intending to give it ago with ga (that I still may do) so I have it available.
.
Rena Berman
Rena Berman 2022년 8월 23일
(Answers Dev) Restored edit

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Fit Postprocessing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by