Experiment and Model not fitting well
이전 댓글 표시
filename = 'dotun2.csv';
%delimiterIn = ',';
headerlinesIn = 1;
A = importdata(filename,delimiterIn,headerlinesIn);
ndata = A.data(:,2);
ydata = A.data(:,1);
plot(ydata,ndata,'o')
xlabel 'n'
ylabel 'b'
f = optimvar('f');
g = optimvar('g');
fun = (ndata*18)/(0.1*2.8*10^7)+g*18.*exp(f*log(ndata/(0.1*284)));
obj = sum((fun - ydata).^2);
lsqproblem = optimproblem("Objective",obj);
x0.f = 0.45;
x0.g = 0.184;
show(lsqproblem)
[sol,fval] = solve(lsqproblem,x0);
disp(sol)
figure
responsedata = evaluate(fun,sol);
plot(ydata,ndata,'bo',responsedata,ndata,'o')
plot(ydata,ndata,responsedata,ndata)
%text(0.1,20, '0.1in 100C')
set(gca,'FontSize',30)
legend('Expt','Model', 'text','FontSize', 18)
xlabel ('\it d','FontSize',16,'FontWeight','bold')
ylabel ('\it F','FontSize',16,'FontWeight','bold')
set(gca,'FontSize',20)
set(gca, 'FontName', 'Cambria')
%title("Fitted Response")
axis([0 0.16 0 300])

댓글 수: 1
Torsten
2023년 1월 4일
Are you sure that your "fun" is adequate ? Shouldn't it asymtotically approach a fixed value as d grows ? Your "fun" grows without limit.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Model Order Reduction에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!







