フィルターのクリア

Fitting data to a nonlinear model to estimate parameters

1 回表示 (過去 30 日間)
JVM
JVM 2018 年 3 月 6 日
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 件)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by