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.Tue, 05 Nov 2019 22:28:50 +0100maximizing sum over feasible set of vectorshttps://ask.sagemath.org/question/48630/maximizing-sum-over-feasible-set-of-vectors/Let $[5]$ be the set of the first 5 positive integers. We let $\underline{\alpha} =(\alpha_A)_{A\neq \emptyset, A\subseteq [5]}$ consist of a vector with $31$ real entries, where each $\alpha_A$ is associated with a subset $A \subseteq [5]$.
Define $\displaystyle OBJ(\underline{\alpha})=\sum_{A\subseteq [5], A\neq \emptyset} \alpha_A \log(|A|)$, $\quad \displaystyle v(\underline{\alpha})=\sum_{A\subseteq [5], A\neq \emptyset} \alpha_A$, $\quad$ and $\quad \displaystyle E(\underline{\alpha})=\sum_{ {A,B}: A\cap B\neq \emptyset} \alpha_A \alpha_B$,
where the sum for $E(\underline{\alpha})$ is taken over all unordered pairs of disjoint nonempty sets $A$ and $B$, where $A, B \subseteq [5]$.
Also define $FEAS(1/4)$ to be the set of all such vectors $\underline{\alpha}$ with nonnegative real entries such that $v(\underline{\alpha})=1$ and $E(\underline{\alpha})\geq 1/4$.
I want to learn how to program the following optimization problem:
$$\displaystyle OPT(1/4):=\max_{\underline{\alpha} \in FEAS(1/4)} OBJ(\underline{\alpha})$$
I was told that I can do this in SageMath. I have some basic knowledge of how to use Sage. How could I create the set $FEAS(1/4)$? I think that from there I may be able to figure out how to maximize $OBJ(\underline{\alpha})$ over this set.merluzaTue, 05 Nov 2019 22:28:50 +0100https://ask.sagemath.org/question/48630/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/Need help finding maximum values over 3-d parameters?https://ask.sagemath.org/question/23603/need-help-finding-maximum-values-over-3-d-parameters/ If you look into my work so far I was trying to solve under a specific section of a function using the left-endpoint rule, since it can't be computed explicitly.
In this case e is the change of the function by x, and f is the change by y. And z is equal to the area under an equation from $a=0$, to $b=2\pi$, where the area is positive. You can see here: https://www.desmos.com/calculator/kv4auahtxx
I tried to make a 3-d parameter by making $m(x)=e$, $m(y)=f$, and $m(z)=q$, and tried to find the maximum values of e, and f. I've tried using sage's programming, but there is something wrong with what I did as seen here: https://cloud.sagemath.com/projects/180e8f3c-9dc5-424f-abcc-5267257c0d31/files/2014-07-22-203326.sagews
Is there a way of finding the maximum value of e, and f values? If it is done correctly both of them should be calculated as $e=0$, and $f=0$, since this should have the maximum value of $q$.
Krishnan ArbujaSun, 27 Jul 2014 22:24:10 +0200https://ask.sagemath.org/question/23603/How can I find the maximum of a two variable function?https://ask.sagemath.org/question/8875/how-can-i-find-the-maximum-of-a-two-variable-function/Hello everyone, I'm trying to find the maximum of the following function:
var('x,y')
func(x,y) = x*y - y^2
Is there any way I can find the maximum of that function (func) when 0 < x < 1 and 0 < y < 2 for example?
Thanks in advance :)asdrubalivanWed, 11 Apr 2012 22:35:03 +0200https://ask.sagemath.org/question/8875/