Ask Your Question

Andres Mejia's profile - activity

2019-12-16 12:59:25 +0200 received badge  Popular Question (source)
2017-09-26 22:14:01 +0200 received badge  Student (source)
2017-09-23 20:18:01 +0200 commented question Show a multivariable function is nonvanishing when it is subject to constraints

Maybe, but it is unclear how to extend this to the multivariable case.

2017-09-23 17:01:25 +0200 commented answer Call error for integers (when I haven't declared any.)

sigh I can't believe that I did not see this. Thank you

2017-09-23 17:01:09 +0200 received badge  Scholar (source)
2017-09-23 16:58:36 +0200 received badge  Editor (source)
2017-09-23 16:56:19 +0200 asked a question Show a multivariable function is nonvanishing when it is subject to constraints

say we have a function $f:\mathbb R^3 \to \mathbb R$ given by

$f(x,y,z)=\sin(x)\sin(y)\sin(z)$

suppose further that there constraints $x,y,z \in (0, \pi/2)$ and $z>x+y$.

Clearly this function is nonvanishing with these constraints. Is there a way to get sage to show this? I've tried fiddling around, but I'm not sure how to do it.

I've tried

    var('x,y,z')

assume(pi/2>x>0)
assume(pi/2>y>0)
assume(pi/2>z>x+y)

f=sin(x)*sin(y)*sin(z)

solve(f=0,x,y,z)

but this does not work ( I don't think I understand the solve function)

2017-09-23 03:20:04 +0200 asked a question Callback Error for integers (when I didn't declare any)

So, I declared some variables

assume(k,'real')
assume(pi/2>k>0)
assume(j,'real')
assume(pi/2>j>0)
assume(N,'real')
assume(N>0)

and I wanted to define a function (that I eventually want to solve for zeroes of.)

Basically, the function is

f=sin(2*k*2*pi/N)*sin((k+1)*2*pi/N)*sin((k-1)*2*pi/N)*sin((2*j+2)*2*pi/N)*sin^2(j*2*pi/N)*sin(6*pi/N)*sin(4*pi/N)*sin(2*pi/N)+sin(2*j*2*pi/N)*sin((j+1)*2*pi/N)*sin((j-1)*2*pi/N)*sin((2*k+2)*2*pi/N)*sin(k*2*pi/N)*sin(k*2*pi/N)*sin(6*pi/N)*sin(4*pi/N)*sin(2*pi/N)+sin((k-1)*2*pi/N)*sin((2*k+2)*2*pi/N)*sin(k*2*pi/N)*sin((2*j+2)*2*pi/N)*sin(j*2*pi/N)*sin(j*2*pi/N)*sin(12*pi/N)*sin(4*pi/N)*sin(2*pi/N)+sin((j-1)*2*pi/N)*sin((2*j+2)*2*pi/N)*sin(j*2*pi/N)*sin((2*k+2)*2*pi/N)*sin(k*2*pi/N)*sin(k*2*pi/N)*sin(12*pi/N)*sin(4*pi/N)*sin(2*pi/N)-sin((k-1)*2*pi/N)*sin((j-1)*2*pi/N)*sin((2*k+2)*2*pi/N)*sin((2*j+2)*2*pi/N)*sin(k*2*pi/N)*sin(j*2*pi/N)*sin(6*pi/N)*sin(2*pi/N)* sin(8*pi/N)-sin(12*pi/N)*sin(4*(pi/N))*sin(4*(pi/N))*sin((2*k+2)*2*pi/N)*sin((2*j+2)*2*pi/N)*sin(j*2*pi/N)*sin(j*2*pi/N)*sin(k*2*pi/N)*sin(k*2*pi/N)

But I'm getting

'sage.rings.integer.Integer' object is not callable

which just do not understand.

2017-09-23 03:17:11 +0200 asked a question Call error for integers (when I haven't declared any.)

I'm trying to define a pretty atrocious function (that I eventually want to solve for zeroes) in three variables, k,j,N.

I tried to just use

f=sin(2*k*2*pi/N)*sin((k+1)*2*pi/N)*sin((k-1)*2*pi/N)*sin((2*j+2)*2*pi/N)*sin^2(j*2*pi/N)*sin(6*pi/N)*sin(4*pi/N)*sin(2*pi/N)+sin(2*j*2*pi/N)*sin((j+1)*2*pi/N)*sin((j-1)*2*pi/N)*sin((2*k+2)*2*pi/N)*sin(k*2*pi/N)*sin(k*2*pi/N)*sin(6*pi/N)*sin(4*pi/N)*sin(2*pi/N)+sin((k-1)*2*pi/N)*sin((2*k+2)*2*pi/N)*sin(k*2*pi/N)*sin((2*j+2)*2*pi/N)*sin(j*2*pi/N)*sin(j*2*pi/N)*sin(12*pi/N)*sin(4*pi/N)*sin(2*pi/N)+sin((j-1)*2*pi/N)*sin((2*j+2)*2*pi/N)*sin(j*2*pi/N)*sin((2*k+2)*2*pi/N)*sin(k*2*pi/N)*sin(k*2*pi/N)*sin(12*pi/N)*sin(4*pi/N)*sin(2*pi/N)-sin((k-1)*2*pi/N)*sin((j-1)*2*pi/N)*sin((2*k+2)*2*pi/N)*sin((2*j+2)*2*pi/N)*sin(k*2*pi/N)*sin(j*2*pi/N)*sin(6*pi/N)*sin(2*pi/N)* sin(8*pi/N)-sin(12*pi/N)*sin(4*(pi/N))*sin(4*(pi/N))*sin((2*k+2)*2*pi/N)*sin((2*j+2)*2*pi/N)*sin(j*2*pi/N)*sin(j*2*pi/N)*sin(k*2*pi/N)*sin(k*2*pi/N)

but I'm getting:

TypeError: 'sage.rings.integer.Integer' object is not callable

why is this, I already had that

assume(k,'real')
assume(pi/2>k>0)
assume(j,'real')
assume(pi/2>j>0)
assume(N,'real')
assume(N>0)

so what can I do to fix this error?

2017-08-07 23:10:42 +0200 asked a question Is there a way to check whether or not this is a floating point error?

I have the following functions defined:

var('k,j,N')

s(k)=sin(4*pi*k/N)*sin(2*pi/N*(k+1))*sin(2*pi/N*(k-1))
w(k)=(sin(2*pi/N*(k-1))/sin(2*pi/N*k)*sin(4*pi/N))*sin(2*pi/N)
AA(N,j,k)=s(k)+s(j)+sin(2*pi*6/N)*sin(2*pi*2/N)/(sin(2*pi*3/N)*sin(2*pi/N))*(w(k)+w(j))-sin(4*pi*2/N)*sin(2*2*pi/N)/sin(2*pi/N)*(w(k)*w(j))-sin(2*pi*6/N)*sin(2*pi*2/N)/(sin(2*pi*3/N)*sin(2*pi/N))

assume(j>1,k>1,N>8*(j+k+1),N>10)

Now, if I use the solve function:

sage: solve(AA(N,j,k)==0,N)

I get the output

[sin(4*pi*k/N) == (sin(8*pi/N)*sin(6*pi/N)*sin(4*pi/N)^3*sin(2*pi/N)^2*sin(-2*(pi
- pi*j)/N)*sin(-2*(pi - pi*k)/N) - sin(2*pi*j/N)*sin(12*pi/N)*sin(4*pi/N)^2*sin(2*pi/N)*sin(-2*(pi
- pi*k)/N) - (sin(4*pi*j/N)*sin(2*pi*j/N)*sin(6*pi/N)*sin(2*pi/N)*sin(2*(pi
+ pi*j)/N)*sin(-2*(pi - pi*j)/N) + sin(12*pi/N)*sin(4*pi/N)^2*sin(2*pi/N)*sin(-2*(pi
- pi*j)/N) - sin(2*pi*j/N)*sin(12*pi/N)*sin(4*pi/N))*sin(2*pi*k/N))/(sin(2*pi*j/N)*sin(2*pi*k/N)*sin(6*pi/N)*sin(2*pi/N)*sin(2*(pi
+ pi*k)/N)*sin(-2*(pi - pi*k)/N))]

However, it is my hope that this equation has no solutions. Indeed, if I add to the assumption that AA(N,j,k)>0, I obtain a contradiction (inconsistent assumptions), but if I add AA(N,j,k)==0, I don't get inconsistent assumptions.

Is there a way to check if this is a floating point error, or if there really is a solution with my assumptions?

2017-07-29 05:02:34 +0200 asked a question Sage not returning roots of polynomimal

I have a polynomial

w=q^32 - q^30 + 3q^28 - 3q^26 + 6q^24 - 6q^22 + 9q^20 - 9q^18 + 12q^16 - 9q^14 + 9q^12 - 6q^10 + 6q^8 - 3q^6 + 3*q^4 - q^2 + 1

and I tried using solve(w==0,q).

But sage only returns

[0 == q^32 - q^30 + 3q^28 - 3q^26 + 6q^24 - 6q^22 + 9q^20 - 9q^18 + 12q^16 - 9q^14 + 9q^12 - 6q^10 + 6q^8 - 3q^6 + 3*q^4 - q^2 + 1]

why is this? I'm looking for complex roots.