From: cliff O'cardha on
hi,
i have an objective function whose variables are time dependent and i have to run a model to get the data to put into the objective function. the structure is laid out below.

give parameter guess
run model with parameters
obj fun = sim data-exp data
run solver
so the opimiser has to run the model for every iteration to get the data for the obj function. has anyone any ideas on how to do this? any help would be greatly appreciated.
From: Torsten Hennig on
> hi,
> i have an objective function whose variables are time
> dependent and i have to run a model to get the data
> to put into the objective function. the structure is
> laid out below.
>
> give parameter guess
> run model with parameters
> obj fun = sim data-exp data
> run solver
> so the opimiser has to run the model for every
> iteration to get the data for the obj function. has
> anyone any ideas on how to do this? any help would be
> greatly appreciated.

Call your model simulation in the subroutine
where you have to supply the objective function
(dependent on the parameters supplied by the solver)
and hand
f(time_i) = sim_data(time_i) - exp_data(time_i)
to the solver.

Best wishes
Torsten.
From: Arnaud Miege on

"cliff O'cardha" <clifford.ociardha(a)ul.ie> wrote in message
news:i40j0c$73c$1(a)fred.mathworks.com...
> hi,
> i have an objective function whose variables are time dependent and i have
> to run a model to get the data to put into the objective function. the
> structure is laid out below.
>
> give parameter guess
> run model with parameters obj fun = sim data-exp data
> run solver
> so the opimiser has to run the model for every iteration to get the data
> for the obj function. has anyone any ideas on how to do this? any help
> would be greatly appreciated.

You can use Simulink Design Optimization:
http://www.mathworks.co.uk/products/sl-design-optimization/

Have a look at the following short video:
http://www.mathworks.co.uk/products/demos/sdo/Estimating-Parameters-of-DC-Motor/

HTH,

Arnaud


From: cliff O'cardha on
Torsten Hennig <Torsten.Hennig(a)umsicht.fhg.de> wrote in message <161481344.98769.1281610035774.JavaMail.root(a)gallium.mathforum.org>...
> > hi,
> > i have an objective function whose variables are time
> > dependent and i have to run a model to get the data
> > to put into the objective function. the structure is
> > laid out below.
> >
> > give parameter guess
> > run model with parameters
> > obj fun = sim data-exp data
> > run solver
> > so the opimiser has to run the model for every
> > iteration to get the data for the obj function. has
> > anyone any ideas on how to do this? any help would be
> > greatly appreciated.
>
> Call your model simulation in the subroutine
> where you have to supply the objective function
> (dependent on the parameters supplied by the solver)
> and hand
> f(time_i) = sim_data(time_i) - exp_data(time_i)
> to the solver.
>
> Best wishes
> Torsten.

Hi torsten, thanks for your reply. with regards to the problem how do i get around the initial guess. the solver requires an initial paremeter guess but i have to give the model an initial guess and the model has to be run before the solver so in a sense id have to give the model an initial guess and give the same guess into the solver. is there a way to get around this. sorry about annoying you.
From: Torsten Hennig on
> Torsten Hennig <Torsten.Hennig(a)umsicht.fhg.de> wrote
> in message
> <161481344.98769.1281610035774.JavaMail.root(a)gallium.m
> athforum.org>...
> > > hi,
> > > i have an objective function whose variables are
> time
> > > dependent and i have to run a model to get the
> data
> > > to put into the objective function. the structure
> is
> > > laid out below.
> > >
> > > give parameter guess
> > > run model with parameters
> > > obj fun = sim data-exp data
> > > run solver
> > > so the opimiser has to run the model for every
> > > iteration to get the data for the obj function.
> has
> > > anyone any ideas on how to do this? any help
> would be
> > > greatly appreciated.
> >
> > Call your model simulation in the subroutine
> > where you have to supply the objective function
> > (dependent on the parameters supplied by the
> solver)
> > and hand
> > f(time_i) = sim_data(time_i) - exp_data(time_i)
> > to the solver.
> >
> > Best wishes
> > Torsten.
>
> Hi torsten, thanks for your reply. with regards to
> the problem how do i get around the initial guess.
> the solver requires an initial paremeter guess but i
> have to give the model an initial guess and the model
> has to be run before the solver so in a sense id have
> to give the model an initial guess and give the same
> guess into the solver. is there a way to get around
> this. sorry about annoying you.

Proceed as follows:
1. Take a reasonable initial guess for the parameters
(without invoking the model) and call the solver.
2. In the first iteration the solver will hand
your initial guess for the parameters
to the function where you are to supply the residuals
f(i) = sim_data(t_i) - exp_data(t_i).
Now (and in all subsequent calls of the solver) you call your model with these solver-supplied parameters and
calculate sim_data(t_i) (which depend on the parameters).

So the model does not have to be run before the solver -
it has to supply sim_data(t_i) given a solver-supplied vector of parameters.

Best wishes
Torsten.