フィルターのクリア

Fitting a model of a membrane with fminsearch

1 回表示 (過去 30 日間)
shadan Kazempour Sabahi
shadan Kazempour Sabahi 2021 年 7 月 1 日
Hello guys,
I need to fit a model of a membrane with experimental datas and for that I am using fminsearch to calculate least squares. I have 15 inputs to fit.
The problem is I get this error:
my code for fitting is:
% Startwert
Lp = 10.9e-7;
%a=[7/60 -2227/50.400 4.0180 -3.9788 -1.9215 4.392 5.006];
a1=7/60;
a2=-2227/50.400;
a3=4.0180;
a4=-3.9788;
a5=-1.9215;
a6=4.392;
a7=5.006;
%n_a=numel(a)
%b=[29/20 97.453/50.400 -62.2680 -18.509 -12.156 9.15 43.17];
b1=29/20;
b2=97.453/50.400;
b3=-62.2680;
b4=-18.509;
b5=-12.156;
b6=9.15;
b7=43.17;
%n_b=numel(b)
%a_fit=zeros(1,n_a);
%b_fit=zeros(1,n_b);
initial=[a1 a2 a3 a4 a5 a6 a7 b1 b2 b3 b4 b5 b6 b7 Lp];
%Lp_fit=fminsearch(@error_function,Lp)
%fun=@(a,b,Lp)error_function(a,b,Lp);
a_fit=fminsearch(@error_function,initial)
%b_fit=fminsearch(@error_function,b)
and the error is:
Not enough input arguments.
Error in error_function (line 47)
Kt=(9/4)*(pi^2)*sqrt(2)*((1-lambda)^(-5/2))*(1 + ((a1)*(1-lambda)) - ((a2)*((1-lambda)^2))) + a3 - a4*lambda - (a5*(lambda)^2) +
(a6*(lambda)^3) + (a7*(lambda)^4);
Error in fminsearch (line 200)
fv(:,1) = funfcn(x,varargin{:});
Error in test (line 27)
a_fit=fminsearch(@error_function,initial)
>>
can someone guide me?

採用された回答

Matt J
Matt J 2021 年 7 月 1 日
We can't see your "error_function", but you need to check its syntax and make sure it only expects a single input argument.
  4 件のコメント
shadan Kazempour Sabahi
shadan Kazempour Sabahi 2021 年 7 月 4 日
thank you for the answer.
shadan Kazempour Sabahi
shadan Kazempour Sabahi 2021 年 7 月 4 日
Now a new problem apeared. fminsearch always gives me the same start value. not the optimized one, exactly the same value that I give as the start value. What could be the reason for that?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by