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, 04 May 2021 13:55:38 +0200Strange error in integrationhttps://ask.sagemath.org/question/56942/strange-error-in-integration/<pre><code>
[roganov@aorus bin]$ ./sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.2, Release Date: 2020-10-24 │
│ Using Python 3.8.5. Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage: var('x')
x
sage: h = cos(1/2*x)*sqrt(4-x^2)
sage: integrate(h,x)
integrate(sqrt(-(x + 2)*(x - 2))*cos(1/2*x), x)
sage: integrate(h+x,x)
1/2*x^2
sage: integrate(cos(1/2*x)*sqrt(4-x^2)+x,x)
1/2*x^2
</code></pre>
roganovTue, 04 May 2021 13:55:38 +0200https://ask.sagemath.org/question/56942/Cannot evaluate symbolic expression to a numerical valuehttps://ask.sagemath.org/question/56672/cannot-evaluate-symbolic-expression-to-a-numerical-value/ I'm trying to do this:
```
(sqrt(10*y*(10-y))+sqrt(1000)*acos(sqrt(y/10))-15*sqrt(2*6.673*10^(-11)*50000000000)).roots( ring=RealField(100))
```
Unfortunately I get the error in the title.
Also any other way of solving the above equation numerically would be appreciated. I was able to do it in maxima using `find_root` but was hoping for a better function (one that doesn't require specifying an interval). I couldn't use find_root in sage because it returns the error 'unable to simplify to float approximation' and ofcourse `solve` doesn't return explicit solutions.Dr. BananaFri, 16 Apr 2021 17:06:47 +0200https://ask.sagemath.org/question/56672/Maxima wants to know whether %k1 is positive or negativehttps://ask.sagemath.org/question/56526/maxima-wants-to-know-whether-k1-is-positive-or-negative/Trying to solve a differential equation in Sage:
sage: de = -diff(y, x, 2) - G*M/y^2
sage: desolve(de, y, ics=[0, 1000])
I get a type error and a question:
TypeError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(%k1>0)', see `assume?` for more details)
Is %k1 positive or negative?
But when I use `assume(%k1>0)` I get a syntax error,
saying that there's something wrong with the percent sign.Dr. BananaWed, 07 Apr 2021 14:49:01 +0200https://ask.sagemath.org/question/56526/ArithmeticError: reduction modulo not definedhttps://ask.sagemath.org/question/56116/arithmeticerror-reduction-modulo-not-defined/I have tried performed modulo operation:
and I got this:
ArithmeticError Traceback (most recent call last) <ipython-input-1-b13f3c6e195a> in <module>
54 print(" po podziale x 2")
55 xP, yP = Pp.xy()
---> 56 uu = xQ % xP
57 print( f"uu mod = {(uu)} " )
/home/sc_serv/sage/local/lib/python3.8/site-packages/sage/rings/finite_rings/integer_mod.pyx in sage.rings.finite_rings.integer_mod.IntegerMod_abstract.__mod__ (build/cythonized/sage/rings/finite_rings/integer_mod.c:7287)()
493 R = IntegerModRing(modulus)
494 if (<Element>self)._parent._IntegerModRing_generic__order % R.order():
--> 495 raise ArithmeticError(f"reduction modulo {modulus!r} not defined")
496 return R(self)
497
ArithmeticError: reduction modulo 55066263022277343669578718895168534326250603453777594175500187360389116729240 not defined
i don't understand in python work
xQ = 0x5699b93fc6e1bd29e09a328d657a607b4155b61a6b5fcbedd7c12df7c67df8f5
xP = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798MiroslawThu, 11 Mar 2021 08:18:23 +0100https://ask.sagemath.org/question/56116/TypeError: 'tuple' object is not callable on notebook but not on terminalhttps://ask.sagemath.org/question/55874/typeerror-tuple-object-is-not-callable-on-notebook-but-not-on-terminal/Code :
x=var('x')
y=function('y')(x)
k= var('k')
assume(k>0)
harmonic2 = diff(y,x,2)+k*y == 0
desolve(harmonic2, y, ivar = x)
Error :
TypeError Traceback (most recent call last) <ipython-input-54-ef4195c42a80> in <module>
4 assume(k>Integer(0))
5 harmonic2 = diff(y,x,Integer(2))+k*y == Integer(0)
----> 6 desolve(harmonic2, y, ivar = x)
TypeError: 'tuple' object is not callable
Why does this happen when i tried it in notebook but when i tried it in notepad but it ran fine on the terminalmath1styearstudentWed, 24 Feb 2021 12:41:31 +0100https://ask.sagemath.org/question/55874/Tiny results of find roothttps://ask.sagemath.org/question/54012/tiny-results-of-find-root/ I was finding roots with a simple loop but got two odd results:
g(x) = (x^2)*cos(2*x)
for num in [-10..10,step=.1]:
try:
root=find_root(g,num,num+.1)
print(root)
except:
pass
-8.639379797371932
-7.0685834705770345
-5.497787143782152
-3.9269908169872405
-2.356194490192345
-0.7853981633974483
-7.755114791616843e-09
Are these two actual roots or a numerical error and how would I tell the difference?
7.755077210568017e-09
0.7853981633974483
2.356194490192345
3.9269908169872405
5.497787143782152
7.0685834705770345
8.639379797371932
cybervigilanteFri, 23 Oct 2020 23:21:35 +0200https://ask.sagemath.org/question/54012/Sage symbolic math simplification errorhttps://ask.sagemath.org/question/53345/sage-symbolic-math-simplification-error/In sagemath version 9.1, the code
product(1-q^x, x, 1, N)
returned
-(-1)^N*product(q^x - 1, x, 1, N)
while the correct result ought to be
(-1)^N*product(q^x - 1, x, 1, N)
What went wrong? Where did this sign change come from?ShoutOutAndCalculateMon, 07 Sep 2020 03:21:09 +0200https://ask.sagemath.org/question/53345/Why is Galois group computation failing?https://ask.sagemath.org/question/51944/why-is-galois-group-computation-failing/ L = NumberField(x^2 - x - 1, 'theta')
G = L.galois_group()
works
L = NumberField(x^3 - x - 1, 'theta')
G = L.galois_group()
gives me the error
TypeError: You must specify the name of the generator.
rain1Sat, 13 Jun 2020 12:42:27 +0200https://ask.sagemath.org/question/51944/Unexpected error in a notebookhttps://ask.sagemath.org/question/50980/unexpected-error-in-a-notebook/ I have a long notebook which works nicely. And, suddenly, when I call an already defined function I have this error message
unsupported operand parent(s) for -: 'Integer Ring' and '<class 'sage.plot.graphics.Graphics'>'
Could someone help me to understand what happen ? I cannot give the code here it is too hudge because I have tried to do as in Mathematica a self contain notebook.CyrilleFri, 24 Apr 2020 06:15:12 +0200https://ask.sagemath.org/question/50980/Random errors when using Singular via Sagehttps://ask.sagemath.org/question/50599/random-errors-when-using-singular-via-sage/Hello everyone,
I'd like to use Singulars capabilities in solving systems of polynomial equations, however I regularly obtain errors of Singular not recognizing the ring, that is created when executing the solve() command from the solve.lib Singular package. It seems somehow random to me, because the error only appears at about 30% of the time running to programm, so just giving it another try (without making any changes to the code) results in the desired result most of the time.
Here is my code:
C.<x, y> = PolynomialRing(QQ)
f = x^2 +y^2
epsilon = 1
# suggested by "rburing" to my question 'Passing functions to Singular'
# because I need to split f=f1+i*f2 in real and imaginary part
S.<x_1,x_2,y_1,y_2,i> = PolynomialRing(QQ)
F = f.subs({x: x_1 + i*x_2, y: y_1 + i*y_2}).reduce([i^2+1])
f1, f2 = F.polynomial(i).coefficients()
R = singular.ring(0,'(x_1,x_2,y_1,y_2)', 'lp')
g1 = singular.new(str(f1))
g2 = singular.new(str(f2))
g3 = singular.new('x_1^2 + x_2^2 +y_1^2+y_2^2 -' + str(epsilon) + '^2')
# creating the first ideal
I = singular.ideal(g1, g2, g3)
singular.lib("primdec.lib")
singular.lib("solve.lib")
# obtain the simplified components of the solution
components = I.primdecGTZ()
k1_1 = components[1][2][1]
k1_2 = components[1][2][2]
k1_3 = components[1][2][3]
singular.setring(R)
# creating a new ideal containing only the first component
H = singular.ideal(str(k1_1),str(k1_2),str(k1_3))
singular.setring(R)
# I now add another constraint to get two real solutions
# sphere around a point close to the solution
J = singular.ideal(H, '(x_1-0)^2 + (x_2+985/1393)^2 +(y_1-985/1393)^2+(y_2-0)^2 -1/10^2')
T = singular.solve(J)
singular.setring(T)
print(singular.eval('SOL'))
It might seem complicated to create that many Ideals but it is necessary because some of them are needed more often.
Executing it 10 times results in 2 to 3 errors of the following kind:
SingularError Traceback (most recent call last)
<ipython-input-55-da8b511c4e72> in <module>()
28 J = singular.ideal(H, '(x_1-0)^2 + (x_2+985/1393)^2 +(y_1-985/1393)^2+(y_2-0)^2 -1/10^2')
29 T = singular.solve(J)
-> 30 singular.setring(T)
31 print(singular.eval('SOL'))
/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/interfaces/singular.py in set_ring(self, R)
1097 if not isinstance(R, SingularElement):
1098 raise TypeError("R must be a singular ring")
-> 1099 self.eval("setring %s; short=0"%R.name(), allow_semicolon=True)
1100
1101 setring = set_ring
/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/interfaces/singular.py in eval(self, x, allow_semicolon, strip, **kwds)
657 # Singular actually does use that string
658 if s.find("error occurred") != -1 or s.find("Segment fault") != -1:
-> 659 raise SingularError('Singular error:\n%s'%s)
660
661 if get_verbose() > 0:
SingularError: Singular error:
? sage2437 is no name of a ring/qring
? error occurred in or before STDIN line 746: `setring sage2437; short=0;
Thanks for your help! Greetings PaulPaulEbertMon, 06 Apr 2020 18:07:09 +0200https://ask.sagemath.org/question/50599/NumberField NotImplemented Errorhttps://ask.sagemath.org/question/50052/numberfield-notimplemented-error/Hello!
I am currently trying to use NumberFields but I am getting random errors when using them.
I am trying to construct a NumberField by using
K=NumberField(x^2 +x+ 1, 'y')
or
K.<y> = NumberField(x^2+x+1)
Sometimes it works out just fine and other times i just get this NotImplemented Error:
Traceback (most recent call last):
File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1234, in execute flags=compile_flags), namespace, locals)
File "", line 1, in <module>
File "sage/modules/free_module_element.pyx", line 2023, in sage.modules.free_module_element.FreeModuleElement.__pow__ (build/cythonized/sage/modules/free_module_element.c:14871)
raise NotImplementedError
NotImplementedError
And after that I can't make it work anymore.
I tried resetting variables but that doesn't seem to be the problem.
Does anybody might have an idea what causes this issue?
CheersErratisTue, 25 Feb 2020 12:54:32 +0100https://ask.sagemath.org/question/50052/Why does solve() produces an error?https://ask.sagemath.org/question/49699/why-does-solve-produces-an-error/Why does solve() produces an error? `TypeError: The first argument must be a symbolic expression or a list of symbolic expressions.`
#!/usr/bin/env python
# coding: utf-8
# In[2]:
var('Ex Ey Ez')
# In[3]:
E=vector([Ex,Ey,Ez])
# In[4]:
var('Px Py Pz')
# In[5]:
P=vector([Px,Py,Pz])
# In[6]:
var('LAx LAy LAz LBx LBy LBz')
# In[7]:
LA=vector([LAx,LAy,LAz]); LB=vector([LBx,LBy,LBz])
# In[8]:
var('k QAx QAy')
# In[9]:
QA=QAx*LA+QAy*LB
# In[20]:
solve(E-P==k*(E-QA), [k, QAx, QAy])
# In[24]:
solve((E-P).cross_product(E-QA)==0, [QAx, QAy])portonTue, 28 Jan 2020 09:02:13 +0100https://ask.sagemath.org/question/49699/Condition of type: STORAGE-EXHAUSTEDhttps://ask.sagemath.org/question/49077/condition-of-type-storage-exhausted/ While doing some long calculations I got the error:
> Condition of type: STORAGE-EXHAUSTED
What does it mean? How do I get rid of it?mattiavThu, 19 Dec 2019 07:29:19 +0100https://ask.sagemath.org/question/49077/Error: Tried to use Sage's Python which was not yet installed.https://ask.sagemath.org/question/48855/error-tried-to-use-sages-python-which-was-not-yet-installed/ I get the following error when I try to run Sage.
$ sage
Error: Tried to use Sage's Python which was not yet installed.
If this was called from an spkg-install script for another package you should add $(PYTHON) as a dependency in build/pkgs/<pkg>/dependencies
I am using MAC. I did install both Python2 and Python3. I also upgraded my python to latest versions using
$ brew upgrade python@3
$ brew upgrade python@2
I do not understand the problem. Please help me. pantherFri, 22 Nov 2019 19:59:09 +0100https://ask.sagemath.org/question/48855/using cplex as a solver in sage - import error undefined symbol: CPXsetlogfilehttps://ask.sagemath.org/question/46606/using-cplex-as-a-solver-in-sage-import-error-undefined-symbol-cpxsetlogfile/Hi,
Ubuntu 18.04; Installed cplex_studio129.linux-x86-64.bin and then Sage 8.7 from source.
I chose source to allow me to "make" Sage again after linking the necessary CPLEX files as described at the very bottom of the page here:
doc.sagemath.org/html/en/thematic_tutorials/linear_programming
i.e. from
/home/klara/sage-8.7/local/lib
`ln -s /opt/ibm/ILOG/CPLEX_Studio129/cplex/lib/x86-64_linux/static_pic/libcplex.a .`
and from:
/home/klara/sage-8.7/local/include
`ln -s /opt/ibm/ILOG/CPLEX_Studio129/cplex/include/ilcplex/cplex.h .`
and finally, also from:
/home/klara/sage-8.7/local/include
`ln -s /opt/ibm/ILOG/CPLEX_Studio129/cplex/include/ilcplex/cpxconst.h .`
But now I get the following import error when running:
sage: p = MixedIntegerLinearProgram(solver='CPLEX')
ImportError: /home/klara/sage-8.7/local/lib/python2.7/site-packages/sage/numerical/backends/cplex_backend.so: undefined symbol: CPXsetlogfile
(By the way, after installing Sage but before linking and remaking I got the more basic import error:
`ImportError: No module named cplex_backend`)
Any hints as what to look into would be appreciated.
Thanks.
----------
Here is the Full Output of the error:
sage: p = MixedIntegerLinearProgram(solver='CPLEX')
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-d320ed52392f> in <module>()
----> 1 p = MixedIntegerLinearProgram(solver='CPLEX')
/home/klara/sage-8.7/local/lib/python2.7/site-packages/sage/misc/lazy_import.pyx in sage.misc.lazy_import.LazyImport.__call__ (build/cythonized/sage/misc/lazy_import.c:3690)()
352 True
353 """
--> 354 return self.get_object()(*args, **kwds)
355
356 def __repr__(self):
/home/klara/sage-8.7/local/lib/python2.7/site-packages/sage/numerical/mip.pyx in sage.numerical.mip.MixedIntegerLinearProgram.__init__ (build/cythonized/sage/numerical/mip.c:3931)()
449 self._first_variable_names = list(names)
450 from sage.numerical.backends.generic_backend import get_solver
--> 451 self._backend = get_solver(solver=solver,
452 constraint_generation=constraint_generation,
453 base_ring=base_ring)
/home/klara/sage-8.7/local/lib/python2.7/site-packages/sage/numerical/backends/generic_backend.pyx in sage.numerical.backends.generic_backend.get_solver (build/cythonized/sage/numerical/backends/generic_backend.c:20060)()
1647 raise ValueError("'solver' should be set to 'GLPK', 'Coin', 'CPLEX', 'CVXOPT', 'Gurobi', 'PPL', 'InteractiveLP', or None.")
1648
-> 1649 cpdef GenericBackend get_solver(constraint_generation = False, solver = None, base_ring = None):
1650 """
1651 Return a solver according to the given preferences
/home/klara/sage-8.7/local/lib/python2.7/site-packages/sage/numerical/backends/generic_backend.pyx in sage.numerical.backends.generic_backend.get_solver (build/cythonized/sage/numerical/backends/generic_backend.c:19611)()
1794
1795 elif solver == "Cplex":
-> 1796 from sage.numerical.backends.cplex_backend import CPLEXBackend
1797 return CPLEXBackend()
1798
ImportError: /home/klara/sage-8.7/local/lib/python2.7/site-packages/sage/numerical/backends/cplex_backend.so: undefined symbol: CPXsetlogfilebucks65Tue, 21 May 2019 13:36:42 +0200https://ask.sagemath.org/question/46606/Why do I get the OSError: [Errno2] when I try to run a .sage filehttps://ask.sagemath.org/question/46116/why-do-i-get-the-oserror-errno2-when-i-try-to-run-a-sage-file/Hello.
I'm new to SageMath and just installed it. Unfortunately I'm not too concerned with the importance of the information you might need to help me out - sorry for that.
So I have Windows 10 and I installed SageMath via These pre- built binaries if that's what it is called. I used the sagetex package to create a .sage file and I tried to run it with sage obviously. Therefore, I opened the Shell and typed
sage 'C:/Users/scheu/OneDrive/Desktop/sagetex.sage'
with sagetex.sage being my .sage file and I'm getting the following:
Traceback (most recent call last):
File "/opt/sagemath-8.6/src/bin/sage-preparse", line 245, in <module>
do_preparse(f)
File "/opt/sagemath-8.6/src/bin/sage-preparse", line 137, in do_preparse
with atomic_write(fname) as f:
File "/opt/sagemath-8.6/local/lib/python2.7/site-packages/sage/misc/temporary_file.py", line 422, in __enter__
fd, name = tempfile.mkstemp(dir=self.tmpdir)
File "/opt/sagemath-8.6/local/lib/python2.7/tempfile.py", line 314, in mkstemp
return _mkstemp_inner(dir, prefix, suffix, flags)
File "/opt/sagemath-8.6/local/lib/python2.7/tempfile.py", line 244, in _mkstemp_inner
fd = _os.open(file, flags, 0600)
OSError: [Errno 2] No such file or directory: '/home/sage/C:/Users/scheu/OneDrive/Desktop/Programme/LaTeX Files,Texmaker/Hilffiles/sagetex test/tmpfPP2mL'
By the way, I am sorry for putting the Code in my Question that way, I had just no idea how to Format this Code as one Code :(
Anyways, it says something I don't quite understand and I've already looked up the same Question, but it didn't help…
Thank you for your answers.LilanarusFri, 12 Apr 2019 21:44:50 +0200https://ask.sagemath.org/question/46116/Why does Sage Math crash instantly? / Running .sage files?https://ask.sagemath.org/question/46051/why-does-sage-math-crash-instantly-running-sage-files/ Hello.
First of all, I need to Mention that I am completely new to Sage Math and I have no idea what causes my problem(s), like seriousely, no idea.
When I start SageMath, it instantly crashes, I don't even touch anything. I'm running Windows 10 and I downloaded the binaries, a virtual box and this sage-8.6.tar.gz file. I am sure that I must be missing something but I don't know what.
Yesterday, I managed to get Sage to work, so in the terminal i could write simple commands like
sage:4+3
and later, I reinstalled python. Now it does not work anymore. My original aim was it to have sagetex in Latex, but for some reason running the .sage file which is created with every document using sagetex doesn't do anything and sage does not compile my document. And yes, I did follow the instructions how to make sagetex known to tex.
I have no idea how to continue, so many problems and i'm desperately trying to get things to work. (Feel like I downloaded half the Internet...) LilanarusMon, 08 Apr 2019 16:26:52 +0200https://ask.sagemath.org/question/46051/Wrong output by plotting with SageMath Version 8.4.rc1 (Trusted)https://ask.sagemath.org/question/45698/wrong-output-by-plotting-with-sagemath-version-84rc1-trusted/What is wrong? I got erroneous results by plots.
In: plot(sin(x))
Out: Graph - incorrect!
In: plot(bessel_J(0, x), x, -0, 1)
Out: Graph - incorrect!
I can send send you screenshots of both, but I don't how.myka32Thu, 07 Mar 2019 11:37:47 +0100https://ask.sagemath.org/question/45698/Error in false statementhttps://ask.sagemath.org/question/45623/error-in-false-statement/Hello
I write in SAGE the following
p=0+0*I
q=1/2+1/2*I
r=3/4+1/3*I
(real(p)==real(q))==false
and it returns "false", but it is true because 0 is not equal to 1/2. Why?creyesm1992Sun, 03 Mar 2019 17:10:55 +0100https://ask.sagemath.org/question/45623/Error in false statementhttps://ask.sagemath.org/question/45622/error-in-false-statement/I write in SAGE the following sentences
p=0+0*I
q=1/2+1/2*I
r=3/4+1/3*I
(real(p)==real(q))==false
As 0 is not equal to 1/2, this statement must be true, but SAGE says false. Why?creyesm1992Sun, 03 Mar 2019 17:09:17 +0100https://ask.sagemath.org/question/45622/__init__() takes exactly 5 arguments (4 given) error in contour plothttps://ask.sagemath.org/question/45446/__init__-takes-exactly-5-arguments-4-given-error-in-contour-plot/ I am trying to make a contour plot of a complex valued function. Let say it is g(z).
I have imported the complex root and ContourPlot command by doing following:
from sage.rings.polynomial.complex_roots import complex_roots
from sage.plot.contour_plot import ContourPlot
I have even successfully plot the 3d-Plot, but I encountered an error stating:
__init__() takes exactly 5 arguments (4 given)
My command is:
C=ContourPlot(lambda x,y:float(green(x+y*I)),(-5,5),(-5,5))
It seems that I did not miss the fifth argument, I tried to add in some commands, such as plot_points, but then Sage said it did not expect these commands..
What did I miss? Thank you!!JacobsonRadicalWed, 13 Feb 2019 12:03:37 +0100https://ask.sagemath.org/question/45446/How can I solve the following (linear) differential equation?https://ask.sagemath.org/question/45075/how-can-i-solve-the-following-linear-differential-equation/I want Sage to solve this equation:
$y'''-3y''+y'-5y=0$.
Both
y=function('y')(x)
desolve(diff(y,3)-3*diff(y,2)+diff(y,1)-5*y,y)
and
giac("desolve([y'''-3y''+y'-5y],y)").sage()
result in errors.ThrashThu, 17 Jan 2019 05:27:41 +0100https://ask.sagemath.org/question/45075/Why doesn't assume(x, 'real') exclude complex values when using plot(x^(1/3)) over a negative domain?https://ask.sagemath.org/question/44798/why-doesnt-assumex-real-exclude-complex-values-when-using-plotx13-over-a-negative-domain/ Running the following commands:
assume(x,'real')
plot(x^(1/3), -5, 5)
produces the following error:
verbose 0 (3630: plot.py, generate_plot_points) WARNING: When plotting, failed to evaluate function at 100 points.
verbose 0 (3630: plot.py, generate_plot_points) Last error message: 'negative number cannot be raised to a fractional power'
Shouldn't the assume command take care of this?
Thanks.
douglas.y.youngFri, 28 Dec 2018 04:04:18 +0100https://ask.sagemath.org/question/44798/Error when running a commandhttps://ask.sagemath.org/question/43337/error-when-running-a-command/Why does sage say that there is an error when I type a command and run it? (even I run 1+1, the error appear)
Here is how sage says:
ERROR: 'closed'
Communication with the Sage server is failing.
Here are some actions you could try to resolve this problem:
- check your internet connection,
- run this cell again,
- close and reopen this file,
- restart the project (in project settings, wrench icon),
- reload the browser tab or even restart your browser,
- delete some of the content in the project's ~/.local directory,
(locally installed Python libraries might interfere with running this worksheet)
pizzaSat, 11 Aug 2018 16:48:34 +0200https://ask.sagemath.org/question/43337/Unable to build sage with Python 2https://ask.sagemath.org/question/42970/unable-to-build-sage-with-python-2/I set `export SAGE_CHECK="yes"` to run tests on the spkgs before running `make -j5`. This gives me another build breaking error, despite using python 2 to build sage
Sage version: 8.3rc0
OS fedora 28 linux_86_x64
### Last section from ppl-1.2.p1.log or see [pastebin](https://pastebin.com/vtJYjqLQ):
In file included from ../../src/Pointset_Powerset_defs.hh:1454,
from ../../src/algorithms.hh:28,
from ../../src/ppl_include_files.hh:18,
from ../../src/ppl_header.hh:38,
from ../../tests/ppl_test.hh:27,
from equals1.cc:25:
../../src/Pointset_Powerset_templates.hh: In instantiation of 'Parma_Polyhedra_Library::Pointset_Powerset<PSET>::Pointset_Powerset(const Parma_Polyhedra_Library::Pointset_Powerset<QH>&, Parma_Polyhedra_Library::Complexity_Class) [with QH = Parma_Polyhedra_Library::Box<Parma_Polyhedra_Library::Interval<__gmp_expr<__mpq_struct [1], __mpq_struct [1]>, Parma_Polyhedra_Library::Interval_Info_Bitset<unsigned int, Parma_Polyhedra_Library::Test::Rational_Real_Open_Interval_Info_Policy> > >; PSET = Parma_Polyhedra_Library::NNC_Polyhedron]':
../../src/Pointset_Powerset_inlines.hh:262:43: required from 'bool Parma_Polyhedra_Library::Pointset_Powerset<PSET>::geometrically_equals(const
Parma_Polyhedra_Library::Pointset_Powerset<PSET>&) const [with PSET =
Parma_Polyhedra_Library::Box<Parma_Polyhedra_Library::Interval<__gmp_expr<__mpq_struct [1], __mpq_struct [1]>, Parma_Polyhedra_Library::Interval_Info_Bitset<unsigned int, Parma_Polyhedra_Library::Test::Rational_Real_Open_Interval_Info_Policy> > >]'
equals1.cc:44:50: required from here
../../src/Pointset_Powerset_templates.hh:66:29: internal compiler error: in type_dependent_expression_p, at cp/pt.c:25100
y_end = y.end(); i != y_end; ++i) {
~~^~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccb8H3zx.out file, please attach this to your bugreport.
make[7]: *** [Makefile:1245: equals1.o] Error 1
************************************************************************
Error testing package ppl-1.2.p1
********
****************************************************************number123Thu, 12 Jul 2018 18:34:50 +0200https://ask.sagemath.org/question/42970/RuntimeWarning [Sage 8.2 WSL]https://ask.sagemath.org/question/42959/runtimewarning-sage-82-wsl/Hi. I was pretty surprised to see Sage linux binaries worked on WSL right away. There's just 1 problem, which is:
```
RuntimeWarning: 'sin' and 'sout' swap memory stats couldn't be determined and were set to 0
```
Is there a fix to this?o6pThu, 12 Jul 2018 15:33:23 +0200https://ask.sagemath.org/question/42959/Unable to compile sagehttps://ask.sagemath.org/question/42894/unable-to-compile-sage/I've spent more than an hour trying to create a google account so that I can report serious problems I'm having with compiling the sagemath source code but google won't let me create an account. Its very unreasonable for sagemath to require users to create a google account just to get support. Why not use github or an independent website? Just because they are closely tied with google doesn't mean they have to force users to bend to their will.
Any way, the problem is that I get this error when trying to build sagemath on fedora 28:
Error building Sage.
The following package(s) may have failed to build (not necessarily
during this run of 'make all-start'):
* package: ppl-1.2.p1
log file: /home/user/sagemath/src/logs/pkgs/ppl-1.2.p1.log
build directory: /home/user/sagemath/inst/var/tmp/sage/build/ppl-1.2.p1
* package: zeromq-4.0.5.p2
log file: /home/user/sagemath/src/logs/pkgs/zeromq-4.0.5.p2.log
build directory: /home/user/sagemath/inst/var/tmp/sage/build/zeromq-4.0.5.p2number123Tue, 10 Jul 2018 21:41:42 +0200https://ask.sagemath.org/question/42894/Ploting ODE (unable to simplify to float approximation)https://ask.sagemath.org/question/42487/ploting-ode-unable-to-simplify-to-float-approximation/I wanted to to draw the slope field aswell as the solution for my ODE.
When I try to plot the solution i get a warning and an error.
verbose 0 (3749: plot.py, generate_plot_points) WARNING: When plotting, failed to evaluate function at 200 points.
verbose 0 (3749: plot.py, generate_plot_points) Last error message: 'unable to simplify to float approximation'
My Code:
----------
y = function('y')(x)
a,b,c,d=var('a b c d')
_C=var('_C')
a=1
b=0
c=0
d=1
de = diff(y,x) == (a*x+b*y)/(c*x+d*y)
h = desolve(de, y, ivar=x);
h=h.substitute(_C==0)
h
y = var('y')
x = var('x')
Plot1=plot_slope_field(((a*x+b*y)/(c*x+d*y)),(x,-10,10),(y,-10,10))
Plot2=plot(h,(x,0,5))
Plot1+Plot2MarsupilamieSun, 03 Jun 2018 20:53:10 +0200https://ask.sagemath.org/question/42487/Sage wont solve simultaneous equationhttps://ask.sagemath.org/question/42174/sage-wont-solve-simultaneous-equation/I tried asking this question earlier, but my profile still says I have asked 0 questions. I have tried solving this problem in different ways, but this is the closest I have gotten;
var('a b c d e f g h i')
X=matrix(3,3,[[0,1,0],[0,0,1],[1,0,0]])
P=matrix(3,3,[[a,b,c],[d,e,f],[g,h,i]])
Pdagger=P.transpose()
Xdagger=X.transpose()
Q=X*Pdagger
B=Q.solve_left(X)
eqns=[]
xlist=[]
for i in range(0,3):
for j in range(0,3):
eqns.append(B[i][j])
xlist.append(X[i][j])
final=[]
for k in range(0,9):
final.append(eqns[k]==xlist[k])
show(final)
sol=solve(eqns,[a,b,c,d,e,f,g,h,i])
show(sol)
I know there is a solution to this problem, and it is the identity, $PXP^{\dagger}=X$.
But the output:
Error in lines 19-19
Traceback (most recent call last):
File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1013, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 1, in <module>
File "/ext/sage/sage-8.1/local/lib/python2.7/site-packages/sage/symbolic/relation.py", line 976, in solve
raise TypeError("%s is not a valid variable." % repr(i))
TypeError: 2 is not a valid variable.
There is also probably a much more efficient way of specifying the problem, but I don't understand why this wont work. I would like to extend this problem to larger matrices as well, so autonomy is welcomed. However, I would appreciate any advice just on getting this error fixed.PatrickLewisThu, 26 Apr 2018 01:23:53 +0200https://ask.sagemath.org/question/42174/how to find the syntax errorhttps://ask.sagemath.org/question/41435/how-to-find-the-syntax-error/ Hi
Here's a short code (copy-paste) that gets me syntax error
i=3
while i>0 :
print i, 'looping'
i=i-1
"<ipython-input-7-8e7eba3f21a0>", line 4
i=i-Integer(1)
I retyped it a second time; now it works, but I don't see any difference.
i=3
while i>0 :
print i, 'looping'
i=i-1
Retyping only the line 4 with the error won't help, retyping the previous lines or restarting the kernel won't help either.
It's like a phantom error florinThu, 08 Mar 2018 12:58:58 +0100https://ask.sagemath.org/question/41435/