MathGroup Archive 1996

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

Search the Archive

help on critical points

  • To: mathgroup at smc.vnet.net
  • Subject: [mg4037] help on critical points
  • From: Jose Luis Lugo Goytia <lugo at hplara.iquimica.unam.mx>
  • Date: Tue, 28 May 1996 01:46:01 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

Could you please give me some advise?

I'm trying to find the critical points of a function
f:R^n -> R, I do the following:

In[1]:= gradiente[f_,var_]:=Outer[D,{f},var];

In[2]:= ceros[f_,vars_]:=  vars /. Solve[Numerator[Together[f]] ==
        Table[0,{i,1,Length[vars]}],vars];

and for example

In[3]:= ceros[gradiente[x^2 y - y^2 -2 x y,{x,y}][[1]],{x,y}] //N

Out[3]= {{1., -0.5}, {0, 0}, {2., 0}}

but if I define the function

In[4]:= PuntosCriticos[f_,vars_]:= 
               ceros[gradiente[f @@ vars,vars][[1]],vars] //N;


and apply it to the before example then obtain

In[4]:= PuntosCriticos[x^2 y - y^2 -2 x y,{x,y}]

                                       2      2 (0,1)
Solve::dinv: The expression (-2 x y + x  y - y )     [x, y]
     involves unknowns in more than one argument, so inverse functions can't
     be used.

ReplaceAll::reps: 
   {<<1>>} is neither a list of replacement rules nor a valid dispatch table,
     and so cannot be used for replacing.

                                        2         2 (0,1)
Solve::dinv: The expression (-2. x y + x  y - 1. y )     [x, y]
     involves unknowns in more than one argument, so inverse functions can't
     be used.

ReplaceAll::reps: 
   {<<1>>} is neither a list of replacement rules nor a valid dispatch table,
     and so cannot be used for replacing.

Out[13]= {x, y} /. 
 
                        2         2 (1,0)
>    Solve[{(-2. x y + x  y - 1. y )     [x, y], 
 
                    2         2 (0,1)
>       (-2. x y + x  y - 1. y )     [x, y]} == {0, 0}, {x, y}]



Could someone tell me where I have gone wrong? How can I do that?

Thanks

_______________________________________________________
Jose Luis Lugo Goytia
Instituto de Quimica,
Universidad Nacional Autonoma de Mexico
lugo at hplara.iquimica.unam.mx
lugo at barajas.fciencias.unam.mx
_______________________________________________________


==== [MESSAGE SEPARATOR] ====


  • Prev by Date: Dirty trick or legitimate style?
  • Next by Date: periodic function
  • Previous by thread: Dirty trick or legitimate style?
  • Next by thread: periodic function