2019-12-11 16:46:09 -0500 commented question The annulus problem in linear programming Can you draw a picture to show the solution is wrong? Also can you try different algorithms? Also you can directly use scipy to solve the problem. 2019-12-11 16:21:21 -0500 commented question Solve set of equations with all unique values in sage You probably should use a SMT solver like z3. 2019-09-19 01:47:01 -0500 received badge ● Notable Question (source) 2019-06-09 12:44:02 -0500 received badge ● Famous Question (source) 2019-04-12 02:41:59 -0500 commented answer How to write a standalone cython script? Actually, I found that you can write a Cython program with .spyx extension and run it with sage. sage will compile it first and then run the compiled program. This is not efficient if we have to run the script many times. But it is fine for me since I am running a very long simulation and the compilation time of the program is negligible. 2019-04-11 11:10:44 -0500 asked a question How to write a standalone cython script? To use Cython in sage, according to the document, you can either write Cython code in a sage notebook, load a .spyx file from command line, or create a .pyx file and add it to the sage library. My question is, can we write a standalone cython script and run it with sage? Just like a normal sage standalone script. 2019-01-15 00:25:49 -0500 received badge ● Notable Question (source) 2019-01-07 08:37:35 -0500 received badge ● Popular Question (source) 2018-12-14 09:31:10 -0500 received badge ● Popular Question (source) 2018-12-07 00:28:58 -0500 received badge ● Nice Question (source) 2018-12-06 09:15:34 -0500 asked a question How to substitute differential operator? Let's say I am taking derivatives of an expression involving unknow function. var('x,a,b'); f=(x^(a+b)).function(x,a,b); h=function('h',nargs=1)(x); g=h(f(x,a,b)); dg=diff(g,x); dg  This gives the output (a + b)*x^(a + b - 1)*D[0](h)(x^(a + b))  How do I replace D[0](h)(x^(a + b)) with something like direvative_of_h(x^(a + b))? In this simple case, I can just do this manually using .operands, but if I have a rather complicated equation, how I can I do it? 2018-12-06 09:15:21 -0500 asked a question Substitute differential operators in an expression. Let's say I am taking derivatives of an expression involving unknow function. var('x,a,b'); f=(x^(a+b)).function(x,a,b); h=function('h',nargs=1)(x); g=h(f(x,a,b)); dg=diff(g,x); dg  This gives the output (a + b)*x^(a + b - 1)*D[0](h)(x^(a + b))  How do I replace D[0](h)(x^(a + b)) with something like direvative_of_h(x^(a + b))? In this simple case, I can just do this manually using .operands, but if I have a rather complicated equation, how I can I do it? 2018-05-20 00:15:55 -0500 received badge ● Popular Question (source) 2017-12-30 19:21:15 -0500 received badge ● Notable Question (source) 2017-12-30 19:21:01 -0500 received badge ● Famous Question (source) 2017-12-30 19:12:49 -0500 commented question How to solve this equation with double square root? This has two solutions in $\mathbb C$, $\pm \sqrt{2\sqrt{3}-3}/2$. 2017-12-30 19:00:00 -0500 asked a question How to solve this equation with double square root? I am trying to solve this equation in sage $$\sqrt{-4 \, z^{2} + 2 \, \sqrt{-4 \, z^{2} + 1} - 1} = 0.$$ But when I try the code var('z') eq = sqrt(-4*z^2 + 2*sqrt(-4*z^2 + 1) - 1) == 0 solve(eq,z)  I get [z == -1/2*sqrt(2*sqrt(-4*z^2 + 1) - 1), z == 1/2*sqrt(2*sqrt(-4*z^2 + 1) - 1)]  Is there any way to actually solve it in sage? 2017-11-03 12:15:06 -0500 received badge ● Notable Question (source) 2017-11-03 12:15:06 -0500 received badge ● Popular Question (source) 2017-10-19 04:02:44 -0500 received badge ● Popular Question (source) 2017-07-27 08:56:47 -0500 received badge ● Popular Question (source) 2017-06-21 02:36:32 -0500 asked a question How to simplify 1-cos(u)^2. I have tried sage: assume(0 p('src/build/cythonized/sage/structure/list_clone.c').substitute().save() File "/usr/lib/sagemath/relocate-once.py", line 51, in save with open(self.filename, 'wb') as f: IOError: [Errno 13] Permission denied: '/usr/lib/sagemath/src/build/cythonized/sage/structure/list_clone.c'  Is this going to be a problem? 2016-01-17 14:33:48 -0500 received badge ● Supporter (source) 2016-01-12 12:53:19 -0500 received badge ● Nice Question (source)