Ask Your Question

Rutger's profile - activity

2022-06-27 19:50:23 +0200 commented question Compile errors Ubuntu on WSL with Conda

@ortollj Not really. This is just the distribution I have at my disposal. I don't think WSL has anything to do with the

2022-06-27 11:56:33 +0200 received badge  Student (source)
2022-06-26 12:51:35 +0200 edited question Compile errors Ubuntu on WSL with Conda

Compile errors Ubuntu on WSL with Conda I'm trying to compile sage9.6 on Ubuntu installed on Windows via WSL using Conda

2022-06-26 12:49:04 +0200 edited question Compile errors Ubuntu on WSL with Conda

Compile errors Ubuntu on WSL with Conda I'm trying to compile sage9.6 on Ubuntu installed on Windows via WSL using Conda

2022-06-26 12:26:05 +0200 edited question Compile errors Ubuntu on WSL with Conda

Compile errors Ubuntu on WSL with Conda I'm trying to compile sage9.6 on Ubuntu installed on Windows via WSL using Conda

2022-06-26 12:25:55 +0200 received badge  Organizer (source)
2022-06-26 12:17:50 +0200 asked a question Compile errors Ubuntu on WSL with Conda

Compile errors Ubuntu on WSL with Conda I'm trying to compile sage9.6 on Ubuntu installed on Windows via WSL using Conda

2019-10-03 15:20:41 +0200 commented question expand large expressions made of complex functions and variables

@slelievre much better, thank you

2019-10-03 15:20:11 +0200 received badge  Editor (source)
2019-10-03 15:11:11 +0200 asked a question expand large expressions made of complex functions and variables

I'm trying to use Sagemath notebook environment without much prior knowledge of Sage. What I tried to do was define some variables (R, a, x, y, x, t...) and then some functions expressed in these variables. The expressions get quite large and complex this way as they are functions built of other functions. Last line of my code I'm trying to expand a large complex-valued symbolic expression using the variables of the functions (so not their values). I use expand() and collectterms(x,y,z,t) to get a result that is sorted by powers of x,y,z,t. When I used this with less complicated expressions it seemed to work OK giving me some reassurance that my syntax should be correct. But when the expressions get larger (see my code below) the outcome isn't correct anymore. I get a result without error messages, but the result is not correct. For example : the code below gives me a result without any imaginary numbers, also the real part is wrong. Does anyone know what is going on here? Is my syntax wrong? Or does Sage fail without error when expressions get large? And if so: are there ways to do this correctly? Thanks in advance!

clos(R,a)=((1/(2*R))+R/2)*cos(a)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y
r_3(R,a,x,y,z,t)=-c_1*(1/5)+a_3(R,a)*x+ b_3(R,a)*t+ cc_3(R,a)*z+ d_3(R,a)*y
r_4(R,a,x,y,z,t)=-c_1*(1/5)+a_4(R,a)*x+ b_4(R,a)*t+ cc_4(R,a)*z+ d_4(R,a)*y
r_5(R,a,x,y,z,t)=-c_1*(1/5)+a_5(R,a)*x+ b_5(R,a)*t+ cc_5(R,a)*z+ d_5(R,a)*y

uu(R,a,x,y,z,t)=r_1(R,a,x,y,z,t)*r_2(R,a,x,y,z,t)*r_3(R,a,x,y,z,t)*r_4(R,a,x,y,z,t)+ r_1(R,a,x,y,z,t)*r_2(R,a,x,y,z,t)*r_3(R,a,x,y,z,t)*r_5(R,a,x,y,z,t)+ r_1(R,a,x,y,z,t)*r_2(R,a,x,y,z,t)*r_4(R,a,x,y,z,t)*r_5(R,a,x,y,z,t) + r_1(R,a,x,y,z,t)*r_3(R,a,x,y,z,t)*r_4(R,a,x,y,z,t)*r_5(R,a,x,y,z,t) + r_2(R,a,x,y,z,t)*r_3(R,a,x,y,z,t)*r_4(R,a,x,y,z,t)*r_5(R,a,x,y,z,t)

(uu(i,j,x,y,z,t)).expand().maxima_methods().collectterms(x,y,z,t)
2019-09-08 22:32:52 +0200 commented answer simplify not working correctly with conjugate?

Great, Thanks a lot!

2019-09-08 22:32:31 +0200 received badge  Scholar (source)
2019-09-08 20:02:43 +0200 asked a question simplify not working correctly with conjugate?

In my notebook environment when I do this :

var('v','a')
t=(I*a/2)*(v-conjugate(v))
(t**3).expand()

It gives me the correct result. However when I do :

(t**3).expand().simplify()

The answer I get is zero. Is this a bug, or is there something I don't understand about the simplify function? Additionally: Is there another, better way to simplify expressions with many conjugates?