f



Help with fminsearch, fminunc

I'm having problems using these optimizers to optimize the output of a Simulink model.  Specifically, it's a trajectory model of a rocket with multiple burns. The burns are short, with long coast periods. The motor on-off times are measured in seconds, so run in the range 1000..100000.  

Fminsearch works fine for small numbers of burns, but chokes on larger ones.  A little digging shows that it builds its initial simplex by percentage offsets from the initial state, and the large steps sometimes make it miss the optimum entirely.  I've tried to limit the initial offsets, but without much success.

With fminunc, I have the opposite problem.  It tries to develop a gradient using divided differences, but the delta-x values it uses are way too small.  Like 100 ms out of a 1000 s burn.  When these times are sent to the Simulink model, it returns the same values for all cases.  So fminunc decides that the surface is flat, there is no gradient.  So it declares victory and returns.  Again, I've tried to force the function to use larger steps, by setting the DiffMinChange option, but fminunc seems to be ignoring it and using a step 100 times smaller.

I'm not a novice user of Matlab and Simulink. I've used fminsearch many times before, but not in cases where I had to tinker with the default settings.  I feel that I'm close to getting both optimizers tamed enough to work, but the solution remains just out of reach.  I'm hoping someone out there can give me a few magic words that will get me on the right path.  Thanks.
0
jcrens (282)
10/7/2011 2:12:08 PM
comp.soft-sys.matlab 210430 articles. 11 followers. lunamoonmoon (258) is leader. Post Follow

4 Replies
677 Views

Similar Articles

[PageSpeed] 48

"Jack Crenshaw" <jcrens@earthlink.net> wrote in message <j6n1bo$nfn$1@newscl01ah.mathworks.com>...
> I'm having problems using these optimizers to optimize the output of a Simulink model.  Specifically, it's a trajectory model of a rocket with multiple burns. The burns are short, with long coast periods. The motor on-off times are measured in seconds, so run in the range 1000..100000.  
>
> Fminsearch works fine for small numbers of burns, but chokes on larger ones.  A little digging shows that it builds its initial simplex by percentage offsets from the initial state, and the large steps sometimes make it miss the optimum entirely.  I've tried to limit the initial offsets, but without much success.
=================
 
I'm assuming the "burns" are the variables to be optimizied? If so, it sounds like a known limitation of FMINSEARCH. FMINSEARCH is really on theoretically gauranteed to work with 1 variable. It's known to have empirical success with a handful of variables, but there's no solid theory behind the multi-variable case.





> With fminunc, I have the opposite problem.  It tries to develop a gradient using divided differences, but the delta-x values it uses are way too small.  Like 100 ms out of a 1000 s burn.  
=======

That doesn't sound "way too small". Are you sure your objective function doesn't involve any rounding, floor, or ceil operations? That would be illegal for FMINUNC, since it would make your function non-differentiable?
0
mattjacREMOVE (3195)
10/7/2011 2:38:25 PM
"Matt J" wrote in message <j6n2t1$1s$1@newscl01ah.mathworks.com>...
>
> 
> > With fminunc, I have the opposite problem.  It tries to develop a gradient using divided differences, but the delta-x values it uses are way too small.  Like 100 ms out of a 1000 s burn.  
> =======
> 
> That doesn't sound "way too small". Are you sure your objective function doesn't involve any rounding, floor, or ceil operations? That would be illegal for FMINUNC, since it would make your function non-differentiable?
=============

Alternatively, your objective function could be poorly scaled. Why not measure the motor on/off times in minutes or even hours, rather than seconds, since they are always at least 15 minutes long..
0
mattjacREMOVE (3195)
10/7/2011 2:45:30 PM
"Matt J" wrote in message <j6n3aa$1qr$1@newscl01ah.mathworks.com>...
>
> Alternatively, your objective function could be poorly scaled. Why not measure the motor on/off times in minutes or even hours, rather than seconds, since they are always at least 15 minutes long..
===============

Or, if you know in advance that certain burns are going to be much longer than others (I'm not an aerospace engineer...), measure the longer ones in hours and the shorter ones in minutes.
0
mattjacREMOVE (3195)
10/7/2011 2:54:14 PM
On 10/7/2011 10:12 AM, Jack Crenshaw wrote:
> I'm having problems using these optimizers to optimize the output of a
> Simulink model. Specifically, it's a trajectory model of a rocket with
> multiple burns. The burns are short, with long coast periods. The motor
> on-off times are measured in seconds, so run in the range 1000..100000.
> Fminsearch works fine for small numbers of burns, but chokes on larger
> ones. A little digging shows that it builds its initial simplex by
> percentage offsets from the initial state, and the large steps sometimes
> make it miss the optimum entirely. I've tried to limit the initial
> offsets, but without much success.
>
> With fminunc, I have the opposite problem. It tries to develop a
> gradient using divided differences, but the delta-x values it uses are
> way too small. Like 100 ms out of a 1000 s burn. When these times are
> sent to the Simulink model, it returns the same values for all cases. So
> fminunc decides that the surface is flat, there is no gradient. So it
> declares victory and returns. Again, I've tried to force the function to
> use larger steps, by setting the DiffMinChange option, but fminunc seems
> to be ignoring it and using a step 100 times smaller.
>
> I'm not a novice user of Matlab and Simulink. I've used fminsearch many
> times before, but not in cases where I had to tinker with the default
> settings. I feel that I'm close to getting both optimizers tamed enough
> to work, but the solution remains just out of reach. I'm hoping someone
> out there can give me a few magic words that will get me on the right
> path. Thanks.

There are at least two options that regulate the size of steps for 
fminunc: DiffMinChange and DiffMaxChange. Depending on the version of 
MATLAB you have, you might need to set both. You might also need to set 
the TypicalX vector to something more typical of your problem than the 
default vector of ones.

If you have Global Optimization Toolbox (or Genetic Algorithm and Direct 
Search Toolbox) you can try the patternsearch solver with a large 
initial mesh size.

You could also rescale the problem to minutes or hours, as Matt suggested.

Good luck,

Alan Weiss
MATLAB mathematical toolbox documentation
0
aweiss (880)
10/7/2011 3:52:46 PM
Reply:

Similar Artilces:

Help Help Help Help Help
please,help us . we have a seious problem, we are designing a radio controlled car that is guided by the PC, to send the data wireless between the PC and the Car and vice versa. we use 2 transmitter/reciever circuits from 2 seperate radio controlled car each running with a different frequency (27 MHz & 40 MHz)and modify the functionality of each to do the disered work. but on mounting a transmitter(40MHz) and reciever(27MHz) on the car, and attach another transmitter(27MHz) and reciever(40MHz) to the PC; we found that on sending signals from the car to the PC on the transmitter & rec...

Help, Help on matlab
I am using wavelet1-D option in "wavemenu" graphic interface in matlab for denoising signals. And I got the following error when punching the "Residual" button. Any ideas why is that and how to fix it? ??? Undefined function or variable "minSize". Error in ==> wtbutils at 362 varargout = {minSize}; Error in ==> utstats at 25 minFontSize = wtbutils('utSTATS_PREFS'); Error in ==> wmoreres at 319 [infos_hdls,h_frame1] = utstats('create',fig,... Error in ==> utthrw1d at 1101 wmoreres('create&#...

help matlab help
how to automatical digitise profile to generate a vector model of the profile and how to use the digitised profile to sweep generate a graphical three dimensional model of the picture please give me some example ...........thanks very much..... ...

help!help!help!help!
I am a student.I am going to make a simulation of a robot (FANUC Robot M-16iB) under the matlab\simulink environment . It is a normal 6DOF robot.I want to realize any angle and any speed (under the max speed) and any position and orientation control. As I just starting to do this new field,I have no experience about it. Can you give me some simulation demo or examples for 6DOF robot? I am very eager to get these.Please write back to me as soon as possible,thank you! Sincerely, Connie&#12288;&#12288;&#12288;&#12288;&#12288;&#12288;&#12288; zhanglijuan920@sohu.c...

Help Help Help
Q1 I want to know how to show the 8 bit planes of the image?? Q2 And also find edges of image by showing both edge magnitude and direction?? ...

HELP HELP HELP
Hi! All, I am an Interactive Media Designer and know very less about asp but the basic concept behind. I got to make an online test(Exam) in asp which has a login (frm access database) panel. Can any one direct me to a free source so that I can simply pick the project and customize it. Thnaks in Advance Raj.Design In article <1112007306.454441.207430@f14g2000cwb.googlegroups.com>, raj.design@gmail.com enlightened us with... > Hi! All, > I am an Interactive Media Designer and know very less about asp but the > basic concept behind. I got to make an online te...

Help Help Help
Hello, I am a reluctant user of the website ntsearch.com. I accidentally download a Java program called "dict" from an ebook website to my XP and now every English words that I read from my computer has got a link with your web. I found it very frustrating when I noticed all the chinese characters I read from the web now become loads of question marks. I think it has a link with the program that I accidentally downloaded from that ebook website. How can I remove the so called "dict" program and other Java Scripts from my computer? This is very urgent and please answer my ...

Help!! Help!! Help!!
I wish to vectorize the following code: s = tf('s'); W = logspace(-1,2,50); COMBINATION = combn(W, 2); K = cell(length(COMBINATION), 1); K0 = 1 + (1/(2*s)) + 0.5*s/(0.2*s + 1); % PID controller to be approximated as PI gapValue = zeros(length(COMBINATION), 1); for i = 1:length(COMBINATION) K{i} = (COMBINATION(i,1)*(1 + (1/(COMBINATION(i,2)*s)))); % PI controller end for i = 1:length(COMBINATION) gapValue(i,1) = gapmetric(K0, K{i}); end where K0 is the Nominal transfer function and K is a cell array including transfer functions whose gap metric from K0 are...

HELP-HELP-HELP!!!!!!!!!!
On this site par example: http://communications.siemens.com/cds/frontdoor/0,2241,nl_nl_0_27443_rArNrNrNrN,00.html u have a 3d animation, like many other sites...but if i want to see this a new window opens and i see a icon with ared cross in it. also on sites with games i see this... What is my problem? I have winXP-Pro firewall is out and sec. is on low..... twan1@home.nl (Twan) writes: > On this site par example: > http://communications.siemens.com/cds/frontdoor/0,2241,nl_nl_0_27443_rArNrNrNrN,00.html > u have a 3d animation, like many other sites...but if i want to...

help help help
I need to refresh my C knowledge quickly. I will be reading code for simple industrial type controls like motor controllers, valve drivers, etc This software is pretty simple, 3000 lines max. The executable is embedded in flash on the processor chip. Actually I haven't seen it yet. I haven't looked at C or done any programming in ages. I'm looking for a simple programming suite that will run on my WinXP (NTFS) computer. Something that doesn't take really long to get up to speed with. Simple is better. I just need to practice and remember and do some simple experi...

HELP HELP HELP...
Hi everybody there. I have created a GUI in MATLAB's guide application. In the GUI I am appearing on the screen a frame from a camera by pushing a button. My problem that sometimes the application works fine, but some others something is going wrong and I get the following error message: ??? Assignment has more non-singleton rhs dimensions than non-singleton subscripts Error in ==> LEDsFinal>txtGrabFrame_Callback at 164 A(width, i, Blue) = abs(fread(portCMU, 1, 'uint8'))/255; What does the error message mean? What seems to be the problem? How can I overco...

Help Help Help
Hello, I am a reluctant user of the website ntsearch.com. I accidentally download a Java program called "dict" from an ebook website to my XP and now every English words that I read from my computer has got a link with your web. I found it very frustrating when I noticed all the chinese characters I read from the web now become loads of question marks. I think it has a link with the program that I accidentally downloaded from that ebook website. How can I remove the so called "dict" program and other Java Scripts from my computer? This is very urgent and please answer my ...

help help help
Sir, Am Avinash.T.J doing my btech AMRITA ...

help! help!! help!!! me
hello if x=linspace(1,100,n); p=linspace(100,80,n-1); how can I get A A=[ x(1) 1 0 0 0 0 0 0...0 0; x(2) 1 -x(2) -1 0 0 0 0...0 0; p(1) 0 -p(2) 0 0 0 0 0...0 0; 0 0 x(3) 1 -x(3) -1 0 0...0 0; 0 0 p(2) 0 -p(3) 0 0 0...0 0; 0 0 0 0 x(4) 1 -x(4) -1...0 0; 0 0 0 0 p(3) 0 -p(4) 0...0 0; ....................................... 0 0 0 0 0 0...x(i) 1 -x(i) -1...0 0; 0 0 0 0 0 0...p(i-1) 0 -p(i-1) 0 ...0 0; ......................................... 0 0 0 0 0 0....x(n-1) 1 -x(n-1) -1; 0 0 0 0 0 0....p(n-2) 0 -p(n-1) 0; 0 0 0 0 0 0.... 0 0 p(n-1) 0; ] "Jim lei" <redlightlike@mathworks.c...

Web resources about - Help with fminsearch, fminunc - comp.soft-sys.matlab

MATLAB Documentation - MathWorks Deutschland
MATLAB is a high-level language and interactive environment for numerical computation, visualization, and programming.

Particle Swarm Optimization (PSO) in Source Code Library
The source codes for Particle Swarm Optimization (PSO)

GNU Octave: Function Index
GNU Octave: Function Index

MATLAB Central
file exchange and newsgroup access for the MATLAB & Simulink user community

Resources last updated: 2/3/2016 1:11:14 AM