<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18999"></HEAD>
<BODY bgColor=#ffffff text=#000000>
<DIV><SPAN class=239084709-26012011><FONT color=#0000ff size=2 face=Arial>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="FONT-FAMILY: Arial; COLOR: blue; FONT-SIZE: 10pt; mso-ansi-language: EN-GB" 
lang=EN-GB>Hi Michaël,</SPAN><SPAN 
style="COLOR: black; mso-ansi-language: EN-GB" lang=EN-GB><?xml:namespace prefix 
= o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="COLOR: black; mso-ansi-language: EN-GB" lang=EN-GB><FONT size=3><FONT 
face="Times New Roman"> <o:p></o:p></FONT></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="FONT-FAMILY: Arial; COLOR: blue; FONT-SIZE: 10pt; mso-ansi-language: EN-GB" 
lang=EN-GB>Let me saying first (if necessary) I've good results using simplex 
routines (either fminsearch <SPAN 
class=239084709-26012011>macro </SPAN><SPAN class=239084709-26012011>or 
</SPAN>Nelder-Mead one).</SPAN><SPAN 
style="COLOR: black; mso-ansi-language: EN-GB" lang=EN-GB><o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="COLOR: black; mso-ansi-language: EN-GB" lang=EN-GB><FONT size=3><FONT 
face="Times New Roman"> <o:p></o:p></FONT></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="FONT-FAMILY: Arial; COLOR: blue; FONT-SIZE: 10pt; mso-ansi-language: EN-GB" 
lang=EN-GB>It is well known (and mentioned in the literature for example) that 
this algorithm is robust but slow ... but in some cases it's the last solution 
(for not saying the last chance) !</SPAN><SPAN 
style="COLOR: black; mso-ansi-language: EN-GB" lang=EN-GB><o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="COLOR: black; mso-ansi-language: EN-GB" lang=EN-GB><FONT size=3><FONT 
face="Times New Roman"> <o:p></o:p></FONT></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="COLOR: black; mso-ansi-language: EN-GB" lang=EN-GB><FONT size=3><FONT 
face="Times New Roman"> <o:p></o:p></FONT></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="FONT-FAMILY: Arial; COLOR: blue; FONT-SIZE: 10pt; mso-ansi-language: EN-GB" 
lang=EN-GB>Basically the purpose is to increase the convergence (and the 
optimization total duration) ... especially when each FEA (= 1 loop) need more 
than one hour !</SPAN><SPAN style="COLOR: black; mso-ansi-language: EN-GB" 
lang=EN-GB><o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="COLOR: black; mso-ansi-language: EN-GB" lang=EN-GB><FONT size=3><FONT 
face="Times New Roman"> <o:p></o:p></FONT></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="FONT-FAMILY: Arial; COLOR: blue; FONT-SIZE: 10pt; mso-ansi-language: EN-GB" 
lang=EN-GB>Commonly I noticed several decades (for not saying hundreds) of loop 
with Nelder-Mead</SPAN><SPAN style="COLOR: black; mso-ansi-language: EN-GB" 
lang=EN-GB><o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="COLOR: black; mso-ansi-language: EN-GB" lang=EN-GB><FONT size=3><FONT 
face="Times New Roman"> <o:p></o:p></FONT></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="FONT-FAMILY: Arial; COLOR: blue; FONT-SIZE: 10pt">Paul</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="FONT-FAMILY: Arial; COLOR: blue; FONT-SIZE: 10pt"></SPAN> </P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="FONT-FAMILY: Arial; COLOR: blue; FONT-SIZE: 10pt"><FONT 
color=#000000></FONT></SPAN><SPAN 
style="COLOR: black"><o:p></o:p></SPAN> </P></FONT></SPAN>
<HR tabIndex=-1>
</DIV>
<DIV><FONT size=2 face=Tahoma><B>De :</B> Michaël Baudin 
[mailto:michael.baudin@scilab.org] <BR><B>Envoyé :</B> mercredi 26 janvier 
2011 08:13<BR><B>À :</B> users@lists.scilab.org<BR><B>Cc :</B> 
Carrico, Paul<BR><B>Objet :</B> Re: [scilab-Users] Academic 
question<BR></FONT><BR></DIV>
<DIV></DIV>Hi,<BR><BR>Indeed, the Nelder-Mead algorithm is rather slow, as can 
be expected from an algorithm which does not rely on neither the gradient nor 
the Hessian (or any approximation to it).<BR><BR>You can use the optim function 
to solve your problem. In the optim help page :<BR><BR><A 
href="http://www.scilab.org/product/man/optim.html">http://www.scilab.org/product/man/optim.html</A><BR><BR>search 
for "Example: Optimizing with numerical derivatives".<BR><BR>The function does 
not have to be analytic : the only thing that is required is that the function 
can be evaluated.<BR><BR>Of course, the function should be smooth for the 
function to work better. <BR> * If f and its gradient are continuous, optim 
with the quasi-Newton and the limited BFGS algorithms should work well (i.e. try 
the "qn" and "cg" options).<BR> * If f is discontinuous, only Nelder-Mead 
can work (but is likely to have some problems to converge).<BR> * If f is 
continous but its gradient is discontinous, you may try the "nd" option. It is a 
special algorithms for functions in this class (e.g. min max_i f_i). Lemaréchal 
is an expert on this topic.<BR><BR>Try it and you will see !<BR><BR>Best 
regards,<BR><BR>Michaël<BR><BR><BR>Le 25/01/2011 12:38, Carrico, Paul a 
écrit : 
<BLOCKQUOTE cite=mid:55A12CBC06A8C9459DCE0BBEF8122FDC0498B0CC@exchsrv.AUXITROL1 
type="cite">
  <META name=GENERATOR content="MSHTML 8.00.6001.18999">
  <DIV><FONT size=2 face=Arial>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-GB><FONT 
  size=3><FONT face="Times New                   Roman">Dear 
  All,<O:P></O:P></FONT></FONT></SPAN></P>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-GB><O:P><FONT 
  size=3 face="Times New Roman"></FONT></O:P></SPAN></P>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-GB><FONT 
  size=3><FONT face="Times New                   Roman">For some times 
  I’m testing Scilab macros for optimization purposes ; “optimization” has to be 
  intended here as an inverse method for fitting parameters (i.e. so that finite 
  element analysis fit test measurements).<O:P></O:P></FONT></FONT></SPAN></P>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-GB><O:P><FONT 
  size=3 face="Times New Roman"></FONT></O:P></SPAN></P>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-GB><FONT 
  size=3><FONT face="Times New                   Roman">I tested basic 
  macros such as fminsearch for unbounded fitting as well as Nelder-Mead one for 
  bracketed parameters fitting. Basically the “cost function” is the normalized 
  Sum of the Square errors SSE from the FEA to the 
  measurements.<O:P></O:P></FONT></FONT></SPAN></P>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-GB><O:P><FONT 
  size=3 face="Times New Roman"></FONT></O:P></SPAN></P>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-GB><FONT 
  face="Times New Roman"><FONT size=3>In my FEA<SPAN 
  class=516203511-25012011>'s</SPAN> <SPAN class=516203511-25012011>the 
  </SPAN><SPAN class=516203511-25012011>variables </SPAN>can be material 
  parameters, spring stiffness’s, damping ratio and so on : the simplex method 
  is well adapted since the former <SPAN class=516203511-25012011>variables 
  </SPAN>are not analytically described in the cost function and since it’s not 
  necessary to calculate the gradient vector nor the Hessian matrix 
  …<O:P></O:P></FONT></FONT></SPAN></P>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-GB><O:P><FONT 
  size=3 face="Times New Roman"></FONT></O:P></SPAN></P>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
  lang=EN-GB><O:P></O:P></SPAN></P>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-GB><FONT 
  size=3><FONT face="Times New                   Roman">If this method 
  is robust nevertheless it remains rather slow 
  !<O:P></O:P></FONT></FONT></SPAN></P>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-GB><O:P><FONT 
  size=3 face="Times New Roman"></FONT></O:P></SPAN></P>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-GB><O:P><FONT 
  size=3 face="Times New Roman"></FONT></O:P></SPAN></P>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-GB><FONT 
  size=3><FONT face="Times New                   Roman">Is there a way 
  or another macro I can use to reduce the number of loops and the time 
  consuming consequently ?<O:P></O:P></FONT></FONT></SPAN></P>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-GB><O:P><FONT 
  size=3 face="Times New Roman"></FONT></O:P></SPAN></P>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><FONT 
  face="Times New Roman"><FONT size=3><I><SPAN 
  lang=EN-GB><U>Nota</U></SPAN></I><SPAN lang=EN-GB> : I was thinking in OPTIM 
  macro but from my understanding the cost function need to be twice 
  differentiable at least <SPAN class=516203511-25012011> </SPAN>(for 
  the <SPAN class=516203511-25012011>G</SPAN>radient and the Hessian ) i.e. 
  analytically link to the parameters … isn’t it 
  ?<O:P></O:P></SPAN></FONT></FONT></P>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-GB><O:P><FONT 
  size=3 face="Times New Roman"></FONT></O:P></SPAN></P>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-GB><FONT 
  size=3><FONT face="Times New                   Roman">Thanks in 
  advance for any advice (for a better 
  understanding)<O:P></O:P></FONT></FONT></SPAN></P>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-GB><O:P><FONT 
  size=3 face="Times New Roman"></FONT></O:P></SPAN></P>
  <P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN lang=EN-GB><FONT 
  size=3><FONT 
  face="Times New                   Roman">Paul<O:P></O:P></FONT></FONT></SPAN></P></FONT></DIV>
  <DIV> </DIV><PRE>--------------------------------------------------------------------------------


Le présent mail et ses pièces jointes sont confidentiels et destinés à la personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail par erreur, veuillez contacter immédiatement l'expéditeur et effacer le message de votre système. Toute divulgation, copie ou distribution de cet e-mail est strictement interdite.

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error, please contact the sender and delete the email from your system. If you are not the named addressee you should not disseminate, distribute or copy this email.


</PRE></BLOCKQUOTE><BR><BR><PRE class=moz-signature cols="72">-- 
Michaël Baudin
Ingénieur de développement
<A class=moz-txt-link-abbreviated href="mailto:michael.baudin@scilab.org">michael.baudin@scilab.org</A>
-------------------------
Consortium Scilab - Digiteo
Domaine de Voluceau - Rocquencourt
B.P. 105 - 78153 Le Chesnay Cedex
Tel. : 01 39 63 56 87 - Fax : 01 39 63 55 94

</PRE></BODY></HTML>

<pre>--------------------------------------------------------------------------------


Le présent mail et ses pièces jointes sont confidentiels et destinés à la personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail par erreur, veuillez contacter immédiatement l'expéditeur et effacer le message de votre système. Toute divulgation, copie ou distribution de cet e-mail est strictement interdite.

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error, please contact the sender and delete the email from your system. If you are not the named addressee you should not disseminate, distribute or copy this email.