Parameter Estimation with MATLAB code

5 views (last 30 days)
Luke
Luke on 3 Dec 2018
Answered: Prem Kumar Tiwari on 12 Dec 2018
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 ?

Answers (1)

Prem Kumar Tiwari
Prem Kumar Tiwari on 12 Dec 2018
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

Tags

Products


Release

R2016b

Community Treasure Hunt

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

Start Hunting!