Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: FindMinimum Problem

  • To: mathgroup at
  • Subject: [mg44707] Re: FindMinimum Problem
  • From: Jiang Xiao <jiang.xiao at>
  • Date: Fri, 21 Nov 2003 05:13:29 -0500 (EST)
  • Organization: Georgia Institute of Technology
  • References: <bpa1rv$19t$> <bpd1bi$c9c$> <bpffpl$lv6$> <bphuh2$1on$>
  • Sender: owner-wri-mathgroup at

yes, this works great, thank you guys.


Bobby R. Treat wrote:
> This works for me using version 5.0:
> foo[x_?NumericQ] := x^2 - a[0]*x /. First@
>       NDSolve[{a'[z] == x*z, a[1] == 1}, a, {z, -1, 1}]
> FindMinimum[foo[x], {x, -1, 1}]
> {-0.166667, {x -> 0.333333}}
> Jens-Peer had left out "First@", so foo took on List values like {2.5}
> rather than just the number 2.5. It's also important to make the range
> {z,-1,1} encompass the range where a minimum might be found --
> especially the two initial starting points, which were 1 and -1 in his
> post.
> The pattern x_?NumericQ matches x if it is numeric -- as it will be
> when FindMinimum tries to iterate to a solution. If you don't use that
> pattern, you get an error message when FindMinimum tries a symbolic x
> value (which it does, for some reason I can't fathom).
> Bobby
> Jiang Xiao <jiang.xiao at> wrote in message news:<bpffpl$lv6$1 at>...
>>thank you for replying, I tried it, but it still doesn't work.
>>what's the meaning of x_?NumericQ?
>>if I let foo[x_?NumericQ]:=x^2-x, findminimum can't get output either, 
>>but no problem with foo[x_]:=x^2-x.
>>Jens-Peer Kuska wrote:
>>>you ust make a function
>>>  Jens
>>>Jiang Xiao wrote:
>>>>Hi, all,
>>>>   recently I am dealing with a problem as following, findminimum(over x)
>>>>of a function f[a[0],x], where a[z] satisfies a differential equation
>>>>a'[z]=x*z say. The code is like:
>>>>the problem is that I can do it in mathematica 4.2, but can't in mathematica
>>>>5.0 now. Do anybody where is the problem?

  • Prev by Date: Re: Open and Close Groups, *one level at a time*?
  • Next by Date: Re: Alternative to bivariate Taylor series
  • Previous by thread: Re: FindMinimum Problem
  • Next by thread: filled plot on part of x-interval