MathGroup Archive 2004

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

Search the Archive

Re: How to code Conjugate Gradient Method

  • To: mathgroup at
  • Subject: [mg49751] Re: [mg49726] How to code Conjugate Gradient Method
  • From: Selwyn Hollis <sh2.7183 at>
  • Date: Fri, 30 Jul 2004 06:02:04 -0400 (EDT)
  • References: <>
  • Sender: owner-wri-mathgroup at

On Jul 29, 2004, at 7:45 AM, Justin wrote:

> I need to write the Conjugate Gradient Method with Mathematica. I
> wanna use this method to find the minimum of a function. I tried the
> FindMinum already but it seems like this function can't work well. It
> always says:
> FindMinimum::nnum: The function value not a number at ....
> The variables I used are all matrices. Does FindMinimum not work for
> matrix?
> Any guys has such an experience? If FindMinimum can't work, how to
> write the Conjugate Gradient Method?

I once tried to write a decent conjugate gradient code in Mathematica, 
but soon abandoned it, since the algorithm doesn't lend itself very 
well to functional programming.

Useless you really need to use conjugate gradient, you're probably 
better off recasting your problem in a form that allows you to use 
FindMinimum or NMinimize.

Selwyn Hollis
(edit reply-to to reply)

  • Prev by Date: Re: Pad a sign - and + to a list of lists
  • Next by Date: Re: pattern matching and droping elements from list of lists.
  • Previous by thread: How to code Conjugate Gradient Method
  • Next by thread: Problem with loops in Mathematica