Ask Your Question

ablmf's profile - activity

2023-06-04 18:10:46 +0200 received badge  Famous Question (source)
2023-05-12 16:28:29 +0200 received badge  Notable Question (source)
2022-06-20 00:29:07 +0200 received badge  Notable Question (source)
2022-06-20 00:29:07 +0200 received badge  Popular Question (source)
2021-07-09 08:17:54 +0200 marked best answer How to evaluate the infinite sum of 1/(2^n-1) over all positive integers?

I have tried

s = sum(1/(2^x-1), x, 1, oo)
s.n()

But I got

cannot evaluate symbolic expression numerically

The sum does not have a simple form, but it is finite. So is there a way to evaluate it numerically in sage?

2021-07-04 03:28:00 +0200 received badge  Famous Question (source)
2021-07-04 03:28:00 +0200 received badge  Notable Question (source)
2021-07-04 03:28:00 +0200 received badge  Popular Question (source)
2021-04-02 21:33:07 +0200 received badge  Notable Question (source)
2021-04-02 21:33:07 +0200 received badge  Popular Question (source)
2021-02-03 18:26:13 +0200 received badge  Nice Question (source)
2020-12-30 10:04:51 +0200 received badge  Popular Question (source)
2020-07-15 19:41:22 +0200 received badge  Good Question (source)
2020-06-03 09:43:50 +0200 received badge  Notable Question (source)
2020-05-27 16:22:58 +0200 received badge  Famous Question (source)
2019-12-11 23:46:09 +0200 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 23:21:21 +0200 commented question Solve set of equations with all unique values in sage

You probably should use a SMT solver like z3.

2019-09-19 08:47:01 +0200 received badge  Notable Question (source)
2019-06-09 19:44:02 +0200 received badge  Famous Question (source)
2019-04-12 09:41:59 +0200 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 18:10:44 +0200 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 07:25:49 +0200 received badge  Notable Question (source)
2019-01-07 15:37:35 +0200 received badge  Popular Question (source)
2018-12-14 16:31:10 +0200 received badge  Popular Question (source)
2018-12-07 07:28:58 +0200 received badge  Nice Question (source)
2018-12-06 16:15:34 +0200 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 16:15:21 +0200 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 07:15:55 +0200 received badge  Popular Question (source)
2017-12-31 16:26:13 +0200 marked best answer How to simplify fractions?

I have the following expression $$ \frac{\left(-1\right)^{n} - 2 n - 1}{4 {\left(2 n + 1\right)}} $$ It clearly equals $$ \frac{\left(-1\right)^{n}}{4 {\left(2 n + 1\right)}} -\frac 1 4. $$

Is there anyway to make sage show this?

2017-12-31 02:21:15 +0200 received badge  Notable Question (source)
2017-12-31 02:21:01 +0200 received badge  Famous Question (source)
2017-12-31 02:12:49 +0200 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-31 02:00:00 +0200 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 18:15:06 +0200 received badge  Popular Question (source)
2017-11-03 18:15:06 +0200 received badge  Notable Question (source)
2017-10-19 11:02:44 +0200 received badge  Popular Question (source)
2017-07-27 15:56:47 +0200 received badge  Popular Question (source)
2017-06-21 09:36:32 +0200 asked a question How to simplify 1-cos(u)^2.

I have tried

sage: assume(0<u<pi/2)

But I still get

sage: simplify(1-cos(u)^2)
-cos(u)^2 + 1
2017-06-19 08:57:54 +0200 asked a question Finding zeros of zeta function.

I am trying to make the following code work.

t = var('t')
f = zeta(1/2+i*t).abs()
ff = fast_callable(f, vars=[t], domain=CDF)
print find_root(ff, 0, 40)

There are actually 6 roots between 0 and 40. But find_root could not find any of them. Is there any walkaround?

2017-06-06 15:55:54 +0200 marked best answer How to get series expansion of function with symbolic parameter.

Let $$h(t) = \frac{\sinh(t)}{t}.$$ Let $$ f_i(t) = h\left(\frac{t}{2^i} \right)^{2^i}, $$ where $i\ge 0$ is an integer.

Is there anyway to get a series expansion of $f_i(t)$ without replacing $i$ with a fixed integer?