<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Help with Optimization Workaround for Operator Form</title>
    <link>http://www.mapleprimes.com/questions/98866-Help-With-Optimization-Workaround-For</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Thu, 11 Jun 2026 22:01:21 GMT</lastBuildDate>
    <pubDate>Thu, 11 Jun 2026 22:01:21 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Help with Optimization Workaround for Operator Form</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Help with Optimization Workaround for Operator Form</title>
      <link>http://www.mapleprimes.com/questions/98866-Help-With-Optimization-Workaround-For</link>
    </image>
    <item>
      <title>method=nonlinearsimplex</title>
      <link>http://www.mapleprimes.com/questions/98866-Help-With-Optimization-Workaround-For?ref=Feed:MaplePrimes:Help with Optimization Workaround for Operator Form:Comments#answer98872</link>
      <itunes:summary>&lt;p&gt;The (Nelder-Mead) &lt;strong&gt;method=nonlinearsimplex&lt;/strong&gt; option of &lt;strong&gt;NLPSolve&lt;/strong&gt; may work for you.&lt;/p&gt;
&lt;p&gt;It does not require numerical derivatives, such as an explicit gradient of the objective. It does not seem to suffer the problem for which that cited workaround is devised. It allows an initial point to be specified (as you have done). And you have no bounds or constraints (which it does not allow).&lt;/p&gt;
&lt;p&gt;You wouldn't &lt;em&gt;have&lt;/em&gt; to use "operator form" with it, either.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;The (Nelder-Mead) &lt;strong&gt;method=nonlinearsimplex&lt;/strong&gt; option of &lt;strong&gt;NLPSolve&lt;/strong&gt; may work for you.&lt;/p&gt;
&lt;p&gt;It does not require numerical derivatives, such as an explicit gradient of the objective. It does not seem to suffer the problem for which that cited workaround is devised. It allows an initial point to be specified (as you have done). And you have no bounds or constraints (which it does not allow).&lt;/p&gt;
&lt;p&gt;You wouldn't &lt;em&gt;have&lt;/em&gt; to use "operator form" with it, either.&lt;/p&gt;</description>
      <guid>98872</guid>
      <pubDate>Fri, 12 Nov 2010 08:29:01 Z</pubDate>
      <itunes:author>pagan</itunes:author>
      <author>pagan</author>
    </item>
    <item>
      <title>number of arguments of EIG</title>
      <link>http://www.mapleprimes.com/questions/98866-Help-With-Optimization-Workaround-For?ref=Feed:MaplePrimes:Help with Optimization Workaround for Operator Form:Comments#answer98994</link>
      <itunes:summary>&lt;p&gt;Let's go back and look again at your posted code once more. Maybe there is a simple misunderstanding going on.&lt;/p&gt;
&lt;p&gt;When you write the following, what did you intend?&lt;/p&gt;
&lt;pre&gt;     G[1] := fdiff(EIG, [1], [X[1], X[7]]);
&lt;/pre&gt;
&lt;p&gt;Does `EIG` always expect two arguments, or seven arguments? If `EIG` expects seven arguments then you should call `fdiff` like this instead,&lt;/p&gt;
&lt;pre&gt;     G[1] := fdiff(EIG, [1], [X[1], X[2], X[3], X[4], X[5], X[6], X[7]]);
&lt;/pre&gt;
&lt;p&gt;Note that the Vector argument `X` of `objfgradient` contains the values of the components of the 7-dimensional "point" at which you want the partial derivatives computed numerically. For `EIG` to be called correctly from within `fdiff` then all the seven numerical scalar elements of the point in question would be needed.&lt;/p&gt;
&lt;p&gt;As an `fdiff` usage example, if one has a procedure/operator `f` that takes 5 arguments, then numerical estimation of the partial derivative with respect to the third argument -- evaluated at the given point [a,b,c,d,e] would be done with a call like &lt;strong&gt;fdiff(f, [3], [a,b,c,d,e])&lt;/strong&gt; .&lt;/p&gt;
&lt;p&gt;I see now that my original example, of a procedure that takes only two arguments, is ambiguous. The call &lt;strong&gt;fdiff(f, [1], [a,b])&lt;/strong&gt; could just as easily be misinterpreted as only requiring the first and last argument in that list [a,b]. But in fact all entries of the given point are needed, as fdiff must pass them along when it in turn calls `f`. Sorry for any confusion.&lt;/p&gt;
&lt;p&gt;If this is in fact the source of the problem then you'd also need to change the assignment to G[2], etc... Maybe something like this,&lt;/p&gt;
&lt;pre&gt;objfgradient := proc(X::Vector, G::Vector)
local Xlist, i, m;
   m := op(1,X);
   Xlist := convert(X,list);
   for i from 1 to m do 
      G[i] := fdiff(EIG, [i], Xlist);
   end do;
NULL;
end proc;
&lt;/pre&gt;
&lt;p&gt;acer&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Let's go back and look again at your posted code once more. Maybe there is a simple misunderstanding going on.&lt;/p&gt;
&lt;p&gt;When you write the following, what did you intend?&lt;/p&gt;
&lt;pre&gt;     G[1] := fdiff(EIG, [1], [X[1], X[7]]);
&lt;/pre&gt;
&lt;p&gt;Does `EIG` always expect two arguments, or seven arguments? If `EIG` expects seven arguments then you should call `fdiff` like this instead,&lt;/p&gt;
&lt;pre&gt;     G[1] := fdiff(EIG, [1], [X[1], X[2], X[3], X[4], X[5], X[6], X[7]]);
&lt;/pre&gt;
&lt;p&gt;Note that the Vector argument `X` of `objfgradient` contains the values of the components of the 7-dimensional "point" at which you want the partial derivatives computed numerically. For `EIG` to be called correctly from within `fdiff` then all the seven numerical scalar elements of the point in question would be needed.&lt;/p&gt;
&lt;p&gt;As an `fdiff` usage example, if one has a procedure/operator `f` that takes 5 arguments, then numerical estimation of the partial derivative with respect to the third argument -- evaluated at the given point [a,b,c,d,e] would be done with a call like &lt;strong&gt;fdiff(f, [3], [a,b,c,d,e])&lt;/strong&gt; .&lt;/p&gt;
&lt;p&gt;I see now that my original example, of a procedure that takes only two arguments, is ambiguous. The call &lt;strong&gt;fdiff(f, [1], [a,b])&lt;/strong&gt; could just as easily be misinterpreted as only requiring the first and last argument in that list [a,b]. But in fact all entries of the given point are needed, as fdiff must pass them along when it in turn calls `f`. Sorry for any confusion.&lt;/p&gt;
&lt;p&gt;If this is in fact the source of the problem then you'd also need to change the assignment to G[2], etc... Maybe something like this,&lt;/p&gt;
&lt;pre&gt;objfgradient := proc(X::Vector, G::Vector)
local Xlist, i, m;
   m := op(1,X);
   Xlist := convert(X,list);
   for i from 1 to m do 
      G[i] := fdiff(EIG, [i], Xlist);
   end do;
NULL;
end proc;
&lt;/pre&gt;
&lt;p&gt;acer&lt;/p&gt;</description>
      <guid>98994</guid>
      <pubDate>Mon, 15 Nov 2010 23:53:00 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
    <item>
      <title>fdiff?</title>
      <link>http://www.mapleprimes.com/questions/98866-Help-With-Optimization-Workaround-For?ref=Feed:MaplePrimes:Help with Optimization Workaround for Operator Form:Comments#comment98986</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/98866-Help-With-Optimization-Workaround-For#comment98903"&gt;@acer&lt;/a&gt; : I honestly don't understand very well how this fdiff function is working. I can evaluate the procedure EIG itself without any trouble at the initial point I provided, as well as at points close to it. Objf works just fine as well. It's the objfgradient, where the fdiff is contained, that I'm losing track of what's happening.&lt;/p&gt;
&lt;p&gt;EIG will not return a float value unless all 7 input variables are provided. Is that what's giving fdiff such a hard time?&lt;/p&gt;
&lt;p&gt;I've tried the DirectSearch package, but it doesn't seem to do as well at minimizing my function as Optimization, at least for my problem.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/98866-Help-With-Optimization-Workaround-For#comment98903"&gt;@acer&lt;/a&gt; : I honestly don't understand very well how this fdiff function is working. I can evaluate the procedure EIG itself without any trouble at the initial point I provided, as well as at points close to it. Objf works just fine as well. It's the objfgradient, where the fdiff is contained, that I'm losing track of what's happening.&lt;/p&gt;
&lt;p&gt;EIG will not return a float value unless all 7 input variables are provided. Is that what's giving fdiff such a hard time?&lt;/p&gt;
&lt;p&gt;I've tried the DirectSearch package, but it doesn't seem to do as well at minimizing my function as Optimization, at least for my problem.&lt;/p&gt;</description>
      <guid>98986</guid>
      <pubDate>Mon, 15 Nov 2010 22:56:06 Z</pubDate>
      <itunes:author>petrivka</itunes:author>
      <author>petrivka</author>
    </item>
  </channel>
</rss>