Hi, how do I go about substituting the results from functions such as
minimize_constrained back into the function that was trying to
minimize? For example, if I have
x,y = var('x y')
f = x*y

(admittedly a trivial example) and I want to minimize the function
over the range x in [1,10] and y in [1,10], I would use
a = sage.numerical.optimize.minimize_constrained(f,[(1,10),(1,10)],
(5,5))

and get back
a = (1.0,1.0)

If I try the command
f((1.0,1.0))

I get an error and any similar attempt also gives me an error. If I
had a dictionary of values for the result of minimize_constrained, I
would use .substitute(). Functions like  optimize.linear_program by
default return a dictionary of values and functions like find_fit
offer the option of returning a dictionary of values (through the
solution_dict argument) but minimize_constrained doesn't seem to offer
anything similar.

I am dealing with functions with a nonconstant number of variables, so
I can't do anything like
.substitute(x=a[0])

Suggestions would be greatly appreciated,
Greg
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to