How to get fine fitting of B-M equation with high nonliearity?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
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
.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Fit Postprocessing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!