Fitting data to a nonlinear model to estimate parameters
조회 수: 1 (최근 30일)
이전 댓글 표시
I am trying estimate two unknown parameters in a nonlinear model. The script that is have made works for some iterations but suddenly stops. The code is as follows:
ws; % some data with 8 columns and n rows
a = 0.0144; % constant
g = 9.81; % constant
k = 0.4; % constant
h = [30,40,50,60,70,80,90,100,106];
x0 = [100,-1];
options = optimoptions(@lsqnonlin,'Algorithm','trust-region-reflective');
for i = 1:size(ws,1)
v = ws(:,i);
fun = @(x) x(1)/k*(log(h/(a*x(1)^2/g))-x(2))-v;
x = lsqnonlin(fun,x0,[],[],options);
ustar(i) = x(1);
Psi_M(i) = x(2);
end
Is there a more effecient way of fitting the data to the model which also outputs the two unknown parameters?
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Interpolation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!