Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
output global optimization temporary solution

Subject: output global optimization temporary solution

From: Marco Wu

Date: 5 Oct, 2011 23:36:30

Message: 1 of 4

Dear all,

 I am using the global optimization toolbox. And I have been waiting the output for two days. Would it be any method that I can ask the toolbox to output the temporary best solution? (Or hourly report) ** It does not need for the current run, I am asking whether I can write a couple lines of code to do this next time.

Thanks

Subject: output global optimization temporary solution

From: Alan Weiss

Date: 6 Oct, 2011 12:14:58

Message: 2 of 4

On 10/5/2011 7:36 PM, Marco Wu wrote:
> Dear all,
>
> I am using the global optimization toolbox. And I have been waiting the
> output for two days. Would it be any method that I can ask the toolbox
> to output the temporary best solution? (Or hourly report) ** It does not
> need for the current run, I am asking whether I can write a couple lines
> of code to do this next time.
> Thanks

I assume you are using GlobalSearch or MultiStart. There are several
methods of obtaining intermediate output. You can set iterative display:
http://www.mathworks.com/help/toolbox/gads/bsc59_4.html#bsc_y4i

You could use an output function to give intermediate results after each
global iteration, though not after set amounts of time:
http://www.mathworks.com/help/toolbox/gads/bsc59_4.html#bsk8qs0

Good luck,

Alan Weiss
MATLAB mathematical toolbox documentation

Subject: output global optimization temporary solution

From: Marco Wu

Date: 6 Oct, 2011 23:17:08

Message: 3 of 4

Thanks for your reply. I am using MATLAB 2010a. This 'OutputFcns' seems like not a property in 2010a version. Does any other way to do the same thing?

Thanks

Alan Weiss <aweiss@mathworks.com> wrote in message <j6k642$2vs$1@newscl01ah.mathworks.com>...
> On 10/5/2011 7:36 PM, Marco Wu wrote:
> > Dear all,
> >
> > I am using the global optimization toolbox. And I have been waiting the
> > output for two days. Would it be any method that I can ask the toolbox
> > to output the temporary best solution? (Or hourly report) ** It does not
> > need for the current run, I am asking whether I can write a couple lines
> > of code to do this next time.
> > Thanks
>
> I assume you are using GlobalSearch or MultiStart. There are several
> methods of obtaining intermediate output. You can set iterative display:
> http://www.mathworks.com/help/toolbox/gads/bsc59_4.html#bsc_y4i
>
> You could use an output function to give intermediate results after each
> global iteration, though not after set amounts of time:
> http://www.mathworks.com/help/toolbox/gads/bsc59_4.html#bsk8qs0
>
> Good luck,
>
> Alan Weiss
> MATLAB mathematical toolbox documentation

Subject: output global optimization temporary solution

From: Alan Weiss

Date: 7 Oct, 2011 12:03:15

Message: 4 of 4

On 10/6/2011 7:17 PM, Marco Wu wrote:
> Thanks for your reply. I am using MATLAB 2010a. This 'OutputFcns' seems
> like not a property in 2010a version. Does any other way to do the same
> thing?
>
> Thanks
>
> Alan Weiss <aweiss@mathworks.com> wrote in message
> <j6k642$2vs$1@newscl01ah.mathworks.com>...
>> On 10/5/2011 7:36 PM, Marco Wu wrote:
>> > Dear all,
>> >
>> > I am using the global optimization toolbox. And I have been waiting the
>> > output for two days. Would it be any method that I can ask the toolbox
>> > to output the temporary best solution? (Or hourly report) ** It does
>> not
>> > need for the current run, I am asking whether I can write a couple
>> lines
>> > of code to do this next time.
>> > Thanks
>>
>> I assume you are using GlobalSearch or MultiStart. There are several
>> methods of obtaining intermediate output. You can set iterative display:
>> http://www.mathworks.com/help/toolbox/gads/bsc59_4.html#bsc_y4i
>>
>> You could use an output function to give intermediate results after
>> each global iteration, though not after set amounts of time:
>> http://www.mathworks.com/help/toolbox/gads/bsc59_4.html#bsk8qs0
>>
>> Good luck,
>>
>> Alan Weiss
>> MATLAB mathematical toolbox documentation

Indeed, output functions were introduced in R2010b:
http://www.mathworks.com/help/toolbox/gads/rn/bslqdml.html

Instead, you can use an output function in the local solver that writes
the current point when the state is 'done':
http://www.mathworks.com/help/toolbox/optim/ug/f19175.html#f11494
http://www.mathworks.com/help/toolbox/optim/ug/f19175.html#f11022

For an example of an output function, see
http://www.mathworks.com/help/toolbox/optim/ug/brhkghv-56.html

Alan Weiss
MATLAB mathematical toolbox documentation

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us