Parameter Estimation with MATLAB code

2 ビュー (過去 30 日間)
Luke
Luke 2018 年 12 月 3 日
回答済み: Prem Kumar Tiwari 2018 年 12 月 12 日
Hallo,
I have written a function which calculates temperatur depending on input paramter. This Temperatur will be in vector form. Depending on input quantities, I will calcultes the temperatur.
function temp=fun_temp(param)
{
...................
}
end
I also have one another vector varible which is the actual temperatur vector for the same input. Now I want to estimate the parameter by comparing both the vector, one from above function and second from which I already have(actual).
%param = set of varible to be estimated
p = param.Continuous('x',2)
opts = sdo.OptimizeOptions('Method','lsqnonlin');
opts.MethodOptions.OptimalityTolerance = 1.5e-3;
opt_fun = @(p) fun_temp(p)
[param_opt,opt_info] = sdo.optimize(opt_fun,p,opts);
Actually this works with Paramter Estimation Toolbox of Simulink. I have Simulink model which calculates the Temperatur and by using this toolbox, i could find the optimal parameter. But Now I wanted to do same thing by NOT USING SIMULINK and just MATLAB to find the same paramter.
The above code throws a following error.
Error using sdo.optimize (line 115)
There are no design objectives to meet. The objective function argument of the optimize command must return a structure with at
least one objective to minimize or constraint to satisfy. See sdo.optimize for more information.
I dont know how this function works. Does any one know ?

回答 (1 件)

Prem Kumar Tiwari
Prem Kumar Tiwari 2018 年 12 月 12 日
The error is thrown because 'fun_temp' is not returning the value expected by sdo.optimize.
SDO Optimize - A good read to learn about what is expected out of optimization function passed as first argument to the sdo.optimize.
Type the following in your Matlab command window to see an example of how to write a cost function for sdo.optimize.
>> help sdoExampleCostFunction

カテゴリ

Help Center および File ExchangeControl Design in Simulink についてさらに検索

タグ

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by