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.Sun, 31 Jan 2021 22:11:52 +0100Why doesn't Sage return `True` for `e < 3`?https://ask.sagemath.org/question/55523/why-doesnt-sage-return-true-for-e-3/I would like to know why Sage does not return `True` if I type `e < 3` or `False` for `pi > 4`.
Is there a way to have that as output?vdeangelSun, 31 Jan 2021 22:11:52 +0100https://ask.sagemath.org/question/55523/can't solve inequality for independent variablehttps://ask.sagemath.org/question/52636/cant-solve-inequality-for-independent-variable/One of the frustrations I'm always having with Sage is how it tries to "solve" inequalities. For a random example:
sage: var('a b x')
sage: f = (a - b * x^2) / (x-1)
sage: solve(f > 0, x)
[[x < 1, b*x^2 - a > 0], [1 < x, -b*x^2 + a > 0]]
Which I knew already (since it's just the numerator).
Ok, so various signs and things matter, but the fact that it can't even tell me
x^2 > a/b
is frustrating. Is there a reason, or a way to convince Sage to actually "solve" these in some way?cdustonThu, 23 Jul 2020 17:26:30 +0200https://ask.sagemath.org/question/52636/SageMath is not solving this inequalityhttps://ask.sagemath.org/question/50287/sagemath-is-not-solving-this-inequality/I have the following inequality:
ineqal=T1Sol[0].rhs().numerator() > 0
ineqal
$$-\kappa m^{4} + 8 \pi m^{3} r - 4 \pi r^{2} > 0$$
So it's a quadratic, but I would imagine it's solveable. Find the zeros, check the sign on either side of them, and tell me where it's positive. If you need more info, yell at me about assumptions. But instead:
solve(ineqal,r)
$$\left[\left[-\kappa m^{4} + 8 \pi m^{3} r - 4 \pi r^{2} > 0\right]\right]$$
Sometimes I can trick it into behaving with some expand() or simplify_full(), but that seems not to be working here. Any ideas?thethinkerTue, 17 Mar 2020 21:51:29 +0100https://ask.sagemath.org/question/50287/Incomplete answer to inequalityhttps://ask.sagemath.org/question/50119/incomplete-answer-to-inequality/Consider the following inequality:
Q - `1 < (2*x + 3) < 9`
Ans - `x` lies between `(-1, 3)`
But sagemath is only returning `x > -1` as the answer, which is incomplete. Why is that?
sage:
sage: solve([ 1 < 2*x + 3 < 9 ], x)
[[x > -1]]
sage:ggSat, 29 Feb 2020 15:30:57 +0100https://ask.sagemath.org/question/50119/Obtain a particular solution for a system of inequalities whose variables can only take certain valueshttps://ask.sagemath.org/question/47447/obtain-a-particular-solution-for-a-system-of-inequalities-whose-variables-can-only-take-certain-values/I want to get a particular solution (assuming it exists) of a system of inequalities, with 4 variables, having that those variables can take only certain values. What I have so far is:
SRC = 64
a, b, c, d = var('a', 'b', 'c', 'd')
assume(a >= 1 and a <= 8)
assume(b >=4 and b <= 512)
assume(c >= 2 and c <= 128)
assume(d, 'integer')
eq1 = (SRC / a) * b <= 418
eq2 = (((SRC / a) * b) / c) / d <= 200
eq3 = ((SRC / a) * b) / c <= 480
res = solve([eq1, eq2, eq3], a, b, c, d=1)
for i in res:
print(i)
The first result I obtain is:
[a < 0, 0 < c, -d > 0, 25*a*c*d - 8*b > 0, -15*a*c + 2*b > 0]
As you can see, `a < 0`, but I have stated that `a` must be greater than `1`. Why this happens?
How can I obtain a particular solution (if it exists)?DanDanFri, 09 Aug 2019 12:07:47 +0200https://ask.sagemath.org/question/47447/Plotting an inequality in 3D regionhttps://ask.sagemath.org/question/33277/plotting-an-inequality-in-3d-region/
Ideally I would like to plot a region in 3D space which is defined by a bunch of inequalities. For example let us consider the region $R$ defined by $$ \{ (x,y, z): x \le 0 \text{ and } y \le 0 \text{ and } x+y \le z \} $$.
I am wondering what would be an easier way to do it.
With my limited knowledge I came up with these two approaches.
*Approach 1 :* Generate points in this region and plot them in 3D. Is there a way to extend the function in <code> region_plot () </code> that generates plot points for my needs?
*Approach 2 :* Concatenate implicit -3D plots of functions of the form $ x + y - (z+t) $, where $t$ is a small positive parameter, for different values of $t$. Then plot all these simultaneously.
I would appreciate any alternate way to do this or any improvements on these approaches.
Thank you for your time in advance.
DBSSun, 01 May 2016 18:36:45 +0200https://ask.sagemath.org/question/33277/Problem outputting inequalitieshttps://ask.sagemath.org/question/10640/problem-outputting-inequalities/The following code :
x, y, z = var('x, y, z')
x < y < z
outputs :
x < y
but the "< z" seems to be taken into account, as in :
x, y, z = var('x, y, z')
x = 1; y = 2; z = 0
x < y < z
which prints "False".
Analogous behavior with :
x, y, z = var('x, y, z')
# x = 1; y = 0; z = 0;
x < y or x < z
Is there a way to make Sage prints the entire expression ?
It seems like a bug when printing expression containing multiple inequalities.Eric GaulMon, 21 Oct 2013 08:43:27 +0200https://ask.sagemath.org/question/10640/