MathGroup Archive 2004

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

Search the Archive

complicated vector-valued function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg45480] complicated vector-valued function
  • From: "Johannes Ludsteck" <johannes.ludsteck at wiwi.uni-regensburg.de>
  • Date: Sat, 10 Jan 2004 00:00:28 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Dear MathGroup members, 
I try to find the fixed point of a complicated vector-
valued  function involving large SparseArray expressions 
with NMinimize  by minimizing a constant and including 
the fixed point problem  as a set of constraints. 
(The trivial example below is created only in order to 
mimic the  structure of the problem.) 

dim = 2; 
i = SparseArray[{i_, i_} -> 1., {dim, dim}]; 
z = Table[Unique[], {dim}]; 
start = Table[1., {dim}]; 
f[x_ /; VectorQ[x, NumericQ], i_] := x.i.x; 

NMinimize[{1, Sequence @@ Thread[z == f[z, i]]}, 
  Thread[{z, 0.5 start, 1.5 start}]] 

Mathematica responds to this with the error message 

NMinimize::bcons : The following constraints are not 
valid: 
{f[{$1,$2},SparseArray[<2>,{2,2}]==$1,f[{$1,$2},SparseArr
ay[<2>, {2,2}]==$2,f[{$1,$2},SparseArray[<2>,{2,2}]==$3}. 

Apparently, Mathematica does not evaluate f because of 
the  condition x_/: VectorQ[x,NumericQ] in the definition 
of f. 
This condition is, however necessary (not in the example 
here,  but in my real world application). 

Is there any way to urge Mathematica to evaluate f in 
NMinimize? 

I am quite shure that everything else in my code is OK, 
because it works with FindRoot. 

Best regards, 
	Johannes Ludsteck  
<><><><><><><><><><><><><><><><><><>
Johannes Ludsteck
Institut fuer Volkswirtschaftslehre
Lehrstuhl Prof. Dr. Moeller
Universitaet Regensburg
Universitaetsstrasse 31
93053 Regensburg
Tel +49/0941/943-2741



  • Prev by Date: RE: How to substitute?
  • Next by Date: Re: Extracting elements of lists
  • Previous by thread: RE: Context of option symbols
  • Next by thread: Problem with FullSimplify in Version 5: Rationals are converted to Reals