On Saturday, November 22, 2014 8:06:23 AM UTC-8, Stephen Kauffman wrote: > > gradL > (gradL[0]).arguments() > (gradL[1]).arguments() > (gradL[2]).arguments() > s=[3,.5,.3] > (gradL[0])(*s) > (gradL[1])(*s) > (gradL[2])(*s) >
> (lam0*(x1 - 1.00000000000000) - log(x0) + log(-x0 + 1), lam0*x0 - log(x1) > + log(-x1 + 1), x0*x1 - x0 + 0.500000000000000) > (lam0, x0, x1) > (lam0, x0, x1) > (x0, x1) > -2.10000000000000 > 2.34729786038720 > ValueError: the number of arguments must be less than or equal to 2 > It looks like the elements in gradF are just symbolic expressions, in which case evaluation by positional arguments is deprecated and ill-defined (there are no guarantees about the order in which the arguments are read): sage: (x+y)(1,2) DeprecationWarning: Substitution using function-call syntax and unnamed arguments is deprecated and will be removed from a future release of Sage; you can use named arguments instead, like EXPR(x=..., y=...) See http://trac.sagemath.org/5930 for details. In your case, turning the expressions into "symbolic functions" might be the way to go: sage: f=(x+y).function(x,y,z) sage: f(2,5,11) 7 I need to be able to to be able to define this as a vector valued function > of a vector so that I can evaluate it using the entire argument set (lam0, > x0, x1) where the missing arguments are ignored for the corresponding > component. This is so I may def a function for scipy.optimize like: > Symbolic expressions can be quite slow for that. Look at fast_callable if you're running into speed problems. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
