ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 07 Sep 2020 23:23:58 +0200How to find the symbolic maximum of a 3D function?https://ask.sagemath.org/question/53364/how-to-find-the-symbolic-maximum-of-a-3d-function/I have a function of two real variables,
f(x,y) = a * (x * y - y^2) * exp( -b * x^2) * exp(b * x * y )
with the real parameters a and b, and five restrictions:
x>0;
y>0;
a>0;
b>0;
y<=x (y equal to or less than x)
In the 3d_plot, with a=b=1, i see there is only one local maximum, which is also the global maxium.
How can i get the formula, for x and y coordinate of the maximum, as function of the parameters a and b?
I tried assume() for the restrictions, but that does not work and is made for the other way, to tell what is already there, not what should be changed.
To get rid of the negative function values, i used
r(x,y) = max_symbolic(0, f(x,y))
and that works, but that is only a workaround for the not implemented restrictions.RolfFMon, 07 Sep 2020 23:23:58 +0200https://ask.sagemath.org/question/53364/Maximize nonlinear function with linear constraintshttps://ask.sagemath.org/question/46008/maximize-nonlinear-function-with-linear-constraints/I would like to have Sage maximize 60 * 5^{x0} *4^{x1} * 3^{x2}, where x0, x1, x2 are nonnegative integers such that
x0+x1+x2=2k-3
and
x1+2*x2 >= 3k-3,
where k is any nonnegative integer such that 3<= k <=20. I would like to create a loop so that Sage does this for me for each of these values of k.
I know that Sage has a tool called minimize_constrained, but I can't find a tool called "maximize_constrained". Please help! Thank you in advance :-)merluzaThu, 04 Apr 2019 01:13:14 +0200https://ask.sagemath.org/question/46008/min(f,g) where f and g take two variableshttps://ask.sagemath.org/question/8907/minfg-where-f-and-g-take-two-variables/Hi
Is it possible to create a function h(x,y) that would be the minimum (or maximum) of any two other 2-variable functions?
Like h(x,y)=max(f(x,y),g(x,y))? (this does not work)
This seems to be a rather useful function but I can't seem to find it.
any ideas?
Thanks
N.sagembThu, 19 Apr 2012 15:52:55 +0200https://ask.sagemath.org/question/8907/Defining a function and forcing max or min valuehttps://ask.sagemath.org/question/8896/defining-a-function-and-forcing-max-or-min-value/Hi,
Is it possible to define a funtion, say f, and have it be the maximum (or minimum) of another function and a constant?
Example (pseudo-script): if g(x)=log(abs(x)), let f(x)=g(x) if g(x)>0, and f(x)=0 for all g(x)<0
Thanks
N.C.sagembTue, 17 Apr 2012 09:08:11 +0200https://ask.sagemath.org/question/8896/