calling maximize recursively
- To: mathgroup at smc.vnet.net
- Subject: [mg67540] calling maximize recursively
- From: garriott at gmail.com
- Date: Fri, 30 Jun 2006 04:14:22 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hello all.
I am trying to call an instance of Maximize[] within Maximize[].
Essentially I'm trying to perform a traditional Bellman's equation
optimization, where you maximize value[now] + value[later], and
value[later] is itself another maximization, and so on.
Here is a very simplified example of a recursive Maximize[] call. If
you can figure out a way to get this to work without deleting one of
the two Mazimize[]s then you'll save the day for me! (I am aware this
particular problem could be done far easier, but it's the setup here
that matters, not the particular problem.)
function1[x_] := x - x^2;
function2[bound_] := Maximize[ {function1[x], x<bound} , x ];
Maximize [ function2[bestbound] , bestbound ]
(if you import this in to mathematica it gives an error, because it
tries to pass bestbound as a pure variable to function2, rather than a
candidate value of bestbound to function2)
Please help,
Garrio