[sage-support] Re: is there assumptions in solve()?

2011-02-19 Thread Johan Grönqvist
2011-02-18 21:11, Dmitry Shkirmanov skrev: I tried it and received wrong answer. Let's consider for example the code: # reset() forget() var(a,b,c,d,f) assume(a-b0) expr=(a^2-b^2)*f expr2=sqrt(expr) print(expr2.full_simplify()) # It gives sqrt(a - b)*sqrt(a + b)*sqrt(f) But a-b0, so expression

[sage-support] Re: is there assumptions in solve()?

2011-02-19 Thread Dmitry Shkirmanov
sage: a=2; b=3; f=5 sage: assert(a-b0) sage: sqrt(a-b)*sqrt(a+b)*sqrt(f) 5*I sage: sqrt((a^2-b^2)*f) 5*I sage: Of course, you are right. But # sage: var(a,b,c,d,f) (a, b, c, d, f) sage: expr=sqrt((a-b)*(c+d)) sage: assume(a-b0) sage: expr.full_simplify() sqrt(-c - d)*sqrt(-a + b) # So

[sage-support] Re: is there assumptions in solve()?

2011-02-19 Thread Dmitry Shkirmanov
sage: expr2 = sqrt(a^2-b^2) sage: expr2.full_simplify() sqrt(a - b)*sqrt(a + b) I am sorry, there is a mistake. wrong answer gives # var(a,b,c,d,f) assume(a-b0) expr=sqrt((a^2-b^2)*f) expr2=expr.full_simplify() show(expr2) # -- To post to this group, send email to

[sage-support] Re: is there assumptions in solve()?

2011-02-18 Thread kcrisman
On Feb 18, 4:55 am, Dmitry Shkirmanov piminusme...@bk.ru wrote: I asked Sage to solve the system of the equations: # var(pasquare,pbsquare,costhetasquare,Ea,Eb,ma,mb,mc) assume(Eama) solution=solve([pasquare*pbsquare*costhetasquare==((-ma^2-mb^2+mc^2)/2 + Ea*Eb)^2, pasquare==Ea^2-ma^2,

[sage-support] Re: is there assumptions in solve()?

2011-02-18 Thread Dmitry Shkirmanov
After you get the output of the solve(), you can simplify() it to send it back to Maxima, and that might work to get the assumptions recognized. I tried it and received wrong answer. Let's consider for example the code: # reset() forget() var(a,b,c,d,f) assume(a-b0) expr=(a^2-b^2)*f