Thread Subject: Is there any way to know how much time left to finish the optimization (using lsqnonlin)?

Subject: Is there any way to know how much time left to finish the optimization (using lsqnonlin)?

From: Yao Li

Date: 18 Sep, 2009 01:23:01

Message: 1 of 4

Dear all,

I am running an intensive computational work for a nonlinear system optimization. I use lsqnonlin. Now it has been running for more than a couple of days. Is there any way I can know how much time left? Since it has already been running for a long time, I don't want to break it if it is almost towards the end.

Previously, I only use tic toc to get the rough time elapsed for each round. But this time the program is continuing running....

Any thoughts would be appreciated!

All my best,
Amber

Subject: Is there any way to know how much time left to finish the optimization (using lsqnonlin)?

From: Nasser Abbasi

Date: 18 Sep, 2009 01:38:22

Message: 2 of 4


"Yao Li" <yaoamber@gmail.com> wrote in message
news:h8undl$f3k$1@fred.mathworks.com...
> Dear all,
>
> I am running an intensive computational work for a nonlinear system
> optimization. I use lsqnonlin. Now it has been running for more than a
> couple of days. Is there any way I can know how much time left? Since it
> has already been running for a long time, I don't want to break it if it
> is almost towards the end.
>
> Previously, I only use tic toc to get the rough time elapsed for each
> round. But this time the program is continuing running....
>
> Any thoughts would be appreciated!
>
> All my best,
> Amber

Clearly this is something you have to program in yourself. Matlab has no way
to know this? How could it?

For example, if you have a convergence criteria, you can use that to display
the progress towards this limit, etc...

It sounds may be your program is stuck in some loop may be? :) use your OS
tools to see if matlab is still consuming more ram, or stuck at the same CPU
limit. This could give some clues.

For long running programs, it is very important to add logic to the code to
save its state every once in a while, and to add logic yourself to monitor
its progress. The definition of progress depends on the nature of your
program.

good luck

--Nasser

Subject: Is there any way to know how much time left to finish the optimization (using lsqnonlin)?

From: John D'Errico

Date: 18 Sep, 2009 03:56:01

Message: 3 of 4

"Yao Li" <yaoamber@gmail.com> wrote in message <h8undl$f3k$1@fred.mathworks.com>...
> Dear all,
>
> I am running an intensive computational work for a nonlinear system optimization. I use lsqnonlin. Now it has been running for more than a couple of days. Is there any way I can know how much time left? Since it has already been running for a long time, I don't want to break it if it is almost towards the end.
>
> Previously, I only use tic toc to get the rough time elapsed for each round. But this time the program is continuing running....
>
> Any thoughts would be appreciated!
>
> All my best,
> Amber

No. It is impossible to know how long an optimization
might take. However, Murphy's law tells you that it was
going to stop only seconds after you will break out of it
from frustration.

John

Subject: Is there any way to know how much time left to finish the optimization

From: Alan Weiss

Date: 18 Sep, 2009 12:33:06

Message: 4 of 4

Nasser Abbasi wrote:
> "Yao Li" <yaoamber@gmail.com> wrote in message
> news:h8undl$f3k$1@fred.mathworks.com...
>> Dear all,
>>
>> I am running an intensive computational work for a nonlinear system
>> optimization. I use lsqnonlin. Now it has been running for more than a
>> couple of days. Is there any way I can know how much time left? Since it
>> has already been running for a long time, I don't want to break it if it
>> is almost towards the end.
>>
>> Previously, I only use tic toc to get the rough time elapsed for each
>> round. But this time the program is continuing running....
>>
>> Any thoughts would be appreciated!
>>
>> All my best,
>> Amber
>
> Clearly this is something you have to program in yourself. Matlab has no way
> to know this? How could it?
>
> For example, if you have a convergence criteria, you can use that to display
> the progress towards this limit, etc...
>
> It sounds may be your program is stuck in some loop may be? :) use your OS
> tools to see if matlab is still consuming more ram, or stuck at the same CPU
> limit. This could give some clues.
>
> For long running programs, it is very important to add logic to the code to
> save its state every once in a while, and to add logic yourself to monitor
> its progress. The definition of progress depends on the nature of your
> program.
>
> good luck
>
> --Nasser
>
>
In addition, you can call one of the built-in plot functions to monitor
the progress of your optimization. It is too late for this particular
run, but next time you might want to try:
options = optimset('PlotFcns',{@optimplotresnorm,@optimplotfirstorderopt})
or use some of the other available plots. For more info, see
http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/lsqnonlin.html#f265106

Alan Weiss
MATLAB mathematical toolbox documentation

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
optimization Yao Li 17 Sep, 2009 21:24:03
nls Yao Li 17 Sep, 2009 21:24:03
lsqnonlin Yao Li 17 Sep, 2009 21:24:03
rssFeed for this Thread

Contact us at files@mathworks.com