| Applying science to business management |
  
minimize
Format: minimize( f(x), x, x1, x2, x3 )
Arguments: (real) f(x) Function or expression to
be minimized
(node) x Name of the input variable in f(x)
(real) x1 Initial guess for the value of x or
lower limit on x
(real) x2 Optional central guess for x
(real) x3 Optional upper limit on x
Returns: (real) The value of x where f(x)
is minimized
Description: Minimize finds the value of x such
that f(x) is locally minimized. You must supply minimize
with either a single point guess for the value of x or a
set of three points that define the specific minimum you seek to
isolate. Minimize uses different methods to find the value
of x depending on which of these starting methods you
provide. If you provide values for x1, x2 and x3,
these points must meet the following conditions: f(x1)
> f(x2) and f(x3) > f(x2) and x1
< x2 < x3. If these conditions are met, minimize
will always find a solution. If you provide a value for x1
only, minimize will search for a solution. If minimize
fails to converge on a solution, try another value for x1.
To maximize a function, simply multiply it by -1 and use the minimize
primitive. E.g., minimize(-f(x),x,x1).
Minimize is an approximated function and is subject to
the tolerance set by precision.
Minimize creates a temporary variable named x. If a
node with this name already exists, it is replaced for all
evaluations of f(x) and is then restored to its original
state.
Note: If the expression f(x) is a tree node
rather than a function based on x, the reset primitive must be used to
cause the tree to recalculate on each iteration. Constants retain
their value from the first evaluation and return this value on
all subsequent evaluations. To cause the constant to be
reevaluated, use an expression similar to
minimize({reset,f},x,x1,x2)
rather than
minimize(f,x,x1,x2))
Examples: minimize((x-5)^2,x,0)
= 5
See Also: precision,
simplex, solve
|