Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Nesting NMaximize

  • To: mathgroup at smc.vnet.net
  • Subject: [mg60389] Re: Nesting NMaximize
  • From: "Valeri Astanoff" <astanoff at yahoo.fr>
  • Date: Thu, 15 Sep 2005 05:16:11 -0400 (EDT)
  • References: <dg8lln$rci$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Nesting NMaximize.

Here is a toy example that might inspire you :

In[1]:=f1[x_, p_] := a*x^2 + p*x + b;

In[2]:=para1 = {a -> -1, b -> 2};

In[3]:=maxi1[p_?NumberQ]:= x /. NMaximize[f1[x,p] /. para1,x][[2]];

In[4]:=f2[x_, q_]:=c*x^4 + q*maxi1[x]*x + d;

In[5]:=para2 = {c -> -3,d -> 4};

In[6]:=maxi2[q_?NumberQ]:= x /. NMaximize[f2[x,q] /. para2,x][[2]];

In[7]:=maxi2[1]

Out[7]=0.288675


hth

v.a.


  • Prev by Date: Replacement rule for a quotient
  • Next by Date: basic issue with do and :=
  • Previous by thread: Re: Replacement rule for a quotient
  • Next by thread: Re: Nesting NMaximize