[sage-support] Dvorak Keyboard

2008-09-19 Thread Q

I am running VMware Sage on my Windows box, is there a way to change
the keyboard layout that Sage uses from Qwerty to Dvorak? Or would it
be located somewhere in the VMware Player software? Or should I just
convert to Linux?

Thanks,
David

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Dvorak Keyboard

2008-09-19 Thread Q

sudo dpkg-reconfigure console-setup

worked great, problem sloved thanks for the help.

David

On Sep 19, 7:36 pm, Q <[EMAIL PROTECTED]> wrote:
> I am running VMware Sage on my Windows box, is there a way to change
> the keyboard layout that Sage uses from Qwerty to Dvorak? Or would it
> be located somewhere in the VMware Player software? Or should I just
> convert to Linux?
>
> Thanks,
> David
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] AttributeError: object has no attribute 'eigenvalues'

2009-11-04 Thread q

I was trying to find the eigenvalues of a matrix.
I tried the example from the tutorial (http://www.sagemath.org/doc/
tutorial/tour_linalg.html):

sage: A = matrix([[0, 4], [-1, 0]])
sage: A.eigenvalues ()

And I got this error:

"AttributeError: 'sage.matrix.matrix_integer_dense.Matrix_integer_de'
object has no attribute 'eigenvalues'"

Can someone please explain this to me?

I'm using Ubuntu 9.04, sage version 3.0.5 which I installed from the
synaptic package manager.

Thanks,

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: AttributeError: object has no attribute 'eigenvalues'

2009-11-05 Thread q

Thanks for the replies everyone.

I tried it, and as someone mentioned, the space between eigenvalues
and () doesn't make a difference.

So I tried updating. I installed the binary distribution, but got the
"Illegal instruction" error at startup. So I tried the

rm spkg/installed/mpir* spkg/installed/atlas*
make

as given in the FAQ, but it still didn't work- I still got the
"illegal instruction". So I tried installing from source. I got the
"illegal instruction" error again, tried

rm spkg/installed/mpir* spkg/installed/atlas*
make

and again got "illegal instruction."

So then I thought, I'll just reinstall the 3.05 from Ubuntu's package
manager and install the patch. I deleted (well, I think) all of the
new sage stuff I installed, and reinstalled 3.05. But now when I type
"sage" into the terminal I get "/usr/local/bin/sage: No such file or
directory".

I have no idea where to go from here.

I'm using an 8 year old HP with a Pentium 4 CPU, it's 32 bit i686 with
Ubuntu 9.04.

I'm just going to give up, because doing all this took me many hours,
and I had to learn/try a lot of stuff about working with the command
line that I've never done before. The installation directions are
confusing to someone who doesn't know very much about computers. I
mean, I got Linux installed on my own, but I probably represent the
lower bound in computer knowledge of Linux users. I'm getting a new
computer in 4 months, so I'll just try again then.

Thanks for your help though.

On Nov 4, 9:16 pm, Jason Grout  wrote:
> Dan Drake wrote:
> > On Wed, 04 Nov 2009 at 04:07PM -0800, Simon King wrote:
> >> Hi Dan!
>
> >> On 5 Nov., 00:15, Dan Drake  wrote:
> >> ...
> >>> There's a space between "eigenvalues" and "()". Python (and hence Sage)
> >>> gets confused by that. Use A.eigenvalues() with no spaces.
> >> No, that's not true. On sage.math, it works with the additional space.
> >>   sage: A = matrix([[0, 4], [-1, 0]])
> >>   sage: A.eigenvalues ()
> >>   [-2*I, 2*I]
>
> >> So, probably it is really just the vintage sage 3.0.5
>
> > Wow, you're right. I suppose it is a problem with 3.0.5. Are there any
> > plans to update the Debian package?
>
> Yes, sort of.  See the thread on a PPA package for Sage on sage-devel.
>
> Jason
>
> --
> Jason Grout
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
-~--~~~~--~~--~--~---



Re: [sage-support] Re: Does SageMath work on Mac OS 10.14.6

2020-02-25 Thread Fernando Q. Gouvea
I managed to install *sage-9.0-OSX_10.11.6-x86_64.app.dmg* 
<http://mirrors.mit.edu/sage/osx/intel/sage-9.0-OSX_10.11.6-x86_64.app.dmg> 
on a Mac running OSX 10.13. The app version seems to work better than 
the non-app version, and this one worked much better than the older 8.8 
version I tried first.


The key is to be an administrator. That is needed at several points. 
First, when copying the app to the Applications folder. Then I had to 
start the program and the computer would tell me it wasn't from the 
Apple store so it couldn't be run. Once that happened, going into the 
security settings (and entering the admin password again) allowed me to 
say "run it anyway". Next time I started the program it spend a good 
long time "verifying" it. That may have required more administrator 
password. But eventually I got it to run and correctly open a notebook.


On a Windows machine, a non-administrator can install Sage "for yourself 
only", but Macs don't seem to allow that.


Fernando

On 2/25/2020 12:18 PM, Nathan Dunfield wrote:



On Tuesday, February 25, 2020 at 9:36:55 AM UTC-6, seriously wrote:

Seriously, has anyone got one of the current releases of Sage to
work on any Mac platform?

I tried several times, lately with version 8.8 for 10.14.5.  I
dropped the binary in Applications.
It can start up then - it opens a browser window which just
stalls; it has a drop-down menu called "Terminal Session",
which doesn't do anything, and if I go directly into the App and
execute ./sage, all kinds of errors appear
(many about permissions) and it crashes.

Unfortunately I want to run a program built on this platform, and
really need a working version.
Any ideas are much appreciated.


I would try this version:

sage-8.9-OSX_10.14.6-x86_64.tar.bz2   (1058.94 MB)

as it worked fine for me on macOS 10.14.6 using the following commands 
in the terminal:


cd /Applications
mv ~/Downloads/sage-8.9-OSX_10.14.6-x86_64.tar.bz2 .
tar xf sage-8.9-OSX_10.14.6-x86_64.tar.bz2
cd SageMath
./sage

Best,

Nathan

--
You received this message because you are subscribed to the Google 
Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to sage-support+unsubscr...@googlegroups.com 
<mailto:sage-support+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/93a7e77b-83fa-40f3-9687-15bd18c0cf32%40googlegroups.com 
<https://groups.google.com/d/msgid/sage-support/93a7e77b-83fa-40f3-9687-15bd18c0cf32%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
==
Fernando Q. Gouvea
Carter Professor of Mathematics
Colby College
Mayflower Hill 5836
Waterville, ME 04901
fqgou...@colby.edu http://www.colby.edu/~fqgouvea

What precisely is profound in Christianity is that Christ is both our
atoner and our judge, not that one is our atoner and another our
judge, for then we would nevertheless come to be judged, but that the
atoner and the judge are the same.
  -- Søren Kierkegaard, Journals

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/1b7ca6a0-6e93-2ff7-70b0-9d93e584982b%40colby.edu.


Re: [sage-support] Re: naive question

2020-03-09 Thread Fernando Q. Gouvea
Thanks. I was wondering why declaring the polynomial ring helped, but 
this helps me understand.


Fernando

On 3/7/2020 3:00 PM, Simon King wrote:

On 2020-03-07, Eric Gourgoulhon  wrote:

You should use simplify_full() instead of simplify():

Or you should rather use *polynomials* instead of general symbolic
variables, provided of course that all your expressions are multivariate
rational functions (which is the case here):


sage: var('s t')
(s, t)

sage: R. = QQ[]


sage: thirdroot = ((s^2 - 1)*t^2 - s^2 + 1)/(s^2 + 2*s*t + t^2)

sage: thirdroot = ((s^2 - 1)*t^2 - s^2 + 1)/(s^2 + 2*s*t + t^2)


sage: factor(thirdroot + 1)
(s*t + 1)^2/(s + t)^2

sage: factor(thirdroot + 1)
(s + t)^-2 * (s*t + 1)^2


sage: a = thirdroot + 1 - (s*t + 1)^2/(s+t)^2
sage: a
((s^2 - 1)*t^2 - s^2 + 1)/(s^2 + 2*s*t + t^2) - (s*t + 1)^2/(s + t)^2 + 1
sage: a.simplify_full()
0

sage: a = thirdroot + 1 - (s*t + 1)^2/(s+t)^2; a
0

That's because thirdroot is an element of the quotient field of a
polynomial ring, which does automatic simplifications (which in the
special context of polynomials is a lot easier than in the general
context of symbolic variables).

Best regards,
Simon


--
==
Fernando Q. Gouvea
Carter Professor of Mathematics
Colby College
Mayflower Hill 5836
Waterville, ME 04901
fqgou...@colby.edu http://www.colby.edu/~fqgouvea

Don't you feel more like you do now than you did when you came in?

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/67cbd162-b1ea-c733-e6b4-ed1379496e33%40colby.edu.


[sage-support] integrating sin(t)/t

2020-09-28 Thread Fernando Q. Gouvea
I am trying to see how to do a standard calculus exercise in Sage. I 
want a power series for the integral of sin(x)/x. I tried:


sage: var('t')
t
sage: assume(x>0)
sage: f(x)=integrate(sin(t)/t,t,0,x)
sage: f
x |--> sin_integral(x)
sage: taylor(f(x),x,0,10)
73/466560*x^9 - 127/35280*x^7 + 31/600*x^5 - 7/18*x^3 + x

The first weirdness is that Sage can't compute the integral unless I add 
the "assume(x>0)"; I'm not sure why.


The second weirdness is that the Taylor series is wrong! 
Taylor(Si(x),x,0,10) gives the same answer.


Fernando


--
==
Fernando Q. Gouvea
Carter Professor of Mathematics
Colby College
Mayflower Hill 5836
Waterville, ME 04901
fqgou...@colby.edu http://www.colby.edu/~fqgouvea

The object of opening the mind, as of opening the mouth, is to shut it
again on something solid.
  -- G. K. Chesterton, Autobiography.

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/5624ba1e-9194-6d00-864a-8fa2a83d1698%40colby.edu.


[sage-support] Windows install problems

2021-03-12 Thread Fernando Q. Gouvea
I have installed Sage on lots of windows machines using the prepared 
binary, but this time I'm having trouble.


The installation seems to run fine and creates the icons. When I click 
on the SageMath 9.2 icon, however, I get this:


mount: /tmp: Invalid argument
Sage home directory set to 'C:\Users\fqgouvea'
Close and restart all Sage sessions for the new setting to take effect.

And then nothing for a long time. If I lose my patience and close that 
window (one time I waited a whole day), then the next time I click I get 
a blank terminal window.


Any idea what might be going on?

Thanks,

Fernando


--
==
Fernando Q. Gouvea
Carter Professor of Mathematics
Colby College
Mayflower Hill 5836
Waterville, ME 04901
fqgou...@colby.edu http://www.colby.edu/~fqgouvea

It has just been discovered that research causes cancer in rats.

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/bfb925fb-ea87-9a5d-081c-b106054129f4%40colby.edu.


Re: [sage-support] Windows install problems

2021-03-15 Thread Fernando Q. Gouvea
Turns out the problem was not with the Sage installer at all. There was 
a pre-existing installation of Cygwin to which the system path pointed. 
After removing the Cygwin64 directory from the path, the Sage 
installation works.


Fernando

On 3/14/2021 5:02 PM, Vincent Delecroix wrote:

Dear Fernando,

The error should be reported to

https://github.com/sagemath/sage-windows

If you do so, include a more complete description
of your settings. That is

- your operating system (ie which Windows version)
- the version of the SageMath Windows installer
  you tried (ie 0.6.1 or 0.6.2 since you mentioned SageMath 9.2)
- if you had a previous working SageMath on the same machine

Best
Vincent

Le 12/03/2021 à 21:01, Fernando Q. Gouvea a écrit :
I have installed Sage on lots of windows machines using the prepared 
binary, but this time I'm having trouble.


The installation seems to run fine and creates the icons. When I 
click on the SageMath 9.2 icon, however, I get this:


mount: /tmp: Invalid argument
Sage home directory set to 'C:\Users\fqgouvea'
Close and restart all Sage sessions for the new setting to take effect.

And then nothing for a long time. If I lose my patience and close 
that window (one time I waited a whole day), then the next time I 
click I get a blank terminal window.


Any idea what might be going on?

Thanks,

Fernando





--
==
Fernando Q. Gouvea
Carter Professor of Mathematics
Colby College
Mayflower Hill 5836
Waterville, ME 04901
fqgou...@colby.edu http://www.colby.edu/~fqgouvea

Men despise religion; they hate it, and they fear it is true.
  -- Blaise Pascal

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/1838-d2b9-41a5-55bb-98f65d5f576b%40colby.edu.


[sage-support] Sage 9.3 for Windows crashing

2021-09-22 Thread Fernando Q. Gouvea
I just had SageMath 9.2 crash, so I tried installing 9.3. Alas, I get 
the same problem. The offending command is pretty innocuous:


sage: plot(ln(1+x),(-1,5))

The Sage window then crashes. In the notebook I get a message that the 
kernel just died. Running it in the Sage Terminal, sage crashes and 
leaves this message behind:



Unhandled SIGSEGV: A segmentation fault occurred.
This probably occurred because a *compiled* module has a bug
in it and is not properly wrapped with sig_on(), sig_off().
Python will now terminate.

/opt/sagemath-9.3/src/bin/sage-python: line 2:  1535 Segmentation 
fault  (core dumped) sage -python "$@"


Any ideas as to what is going on?

Fernando


--
==
Fernando Q. Gouvea
Carter Professor of Mathematics
Colby College
Mayflower Hill 5836
Waterville, ME 04901
fqgou...@colby.edu http://www.colby.edu/~fqgouvea

Humility engenders learning because it beats back the arrogance
that puts blinders on. It leaves you open for truths to reveal
themselves. You don't stand in your own way.
  -- Wynton Marsalis

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/e587c471-9ffa-4364-5fa2-fbf40d63e7d6%40colby.edu.


[sage-support] another "how to simplify" question

2021-12-08 Thread Fernando Q. Gouvea
I was showing my students a famous calculus example of an integral that 
can be computed in one order of the variables but not in the other. 
Knowing that SageMath can compute anything, the students suggested 
trying the integral the "wrong" way.


The "right" way is

sage: integrate(integrate(sin(x^2),y,0,x),x,0,1)

-1/2*cos(1) + 1/2

The "wrong" way is

sage: integrate(integrate(sin(x^2),x,y,1),y,0,1) 
-1/16*(-1)^(3/4)*((sqrt(2) + 4*(-1)^(1/4))*e^I - sqrt(-I)*((I + 
1)*sqrt(2)*(-1)^(1/4)*e^(2*I) - (I + 1)*sqrt(2)*(-1)^(1/4)*e^I) + 
I*sqrt(2)*e^I - 2*(-1)^(1/4)*e^(2*I) - (I + 1)*sqrt(2) - 
2*(-1)^(1/4))*e^(-I)


Is there any way to get Sage to check that these are equal?

The obvious thing does not seem to work:

sage: -1/16*(-1)^(3/4)*((sqrt(2) + 4*(-1)^(1/4))*e^I - sqrt(-I)*((I + 
1)*sqrt(2) : *(-1)^(1/4)*e^(2*I) - (I + 1)*sqrt(2)*(-1)^(1/4)*e^I) + 
I*sqrt(2)*e^I - 2* : (-1)^(1/4)*e^(2*I) - (I + 1)*sqrt(2) - 
2*(-1)^(1/4))*e^(-I) == -1/2*cos(1) : +1/2 
-1/16*(-1)^(3/4)*((sqrt(2) + 4*(-1)^(1/4))*e^I - sqrt(-I)*((I + 
1)*sqrt(2)*(-1)^(1/4)*e^(2*I) - (I + 1)*sqrt(2)*(-1)^(1/4)*e^I) + 
I*sqrt(2)*e^I - 2*(-1)^(1/4)*e^(2*I) - (I + 1)*sqrt(2) - 
2*(-1)^(1/4))*e^(-I) == -1/2*cos(1) + 1/2


Thanks,

Fernando

--
======
Fernando Q. Gouvea
Carter Professor of Mathematics
Colby College
Mayflower Hill 5836
Waterville, ME 04901
fqgou...@colby.edu  http://www.colby.edu/~fqgouvea

I have had a perfectly wonderful evening, but this wasn't it.
  --Groucho Marx

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/9557c1a9-bd1c-69e1-358f-4ab02a058c3a%40colby.edu.


Re: [sage-support] another "how to simplify" question

2021-12-08 Thread Fernando Q. Gouvea

Thank you, that works. What is strange is that this does not:

sage: right=integrate(integrate(sin(x^2),y,0,x),x,0,1) sage: 
wrong=integrate(integrate(sin(x^2),x,y,1),y,0,1) sage: 
real(wrong)==right -1/2*cos(1) + 1/2 == -1/2*cos(1) + 1/2


Is Sage seeing a difference there that I don't?

I think I don't understand the difference between real(wrong)==right and 
bool(real(wrong)==right).


Fernando

On 12/8/2021 1:23 PM, William Stein wrote:

You can compare the real and imaginary parts directly.

https://cocalc.com/wstein/support/2021-12-08-gouvea

sage: bool(wrong.real()==right)
True
sage: wrong.imag()
0

On Wed, Dec 8, 2021 at 10:07 AM Fernando Q. Gouvea 
 wrote:


I was showing my students a famous calculus example of an integral
that can be computed in one order of the variables but not in the
other. Knowing that SageMath can compute anything, the students
suggested trying the integral the "wrong" way.

The "right" way is

sage: integrate(integrate(sin(x^2),y,0,x),x,0,1)

-1/2*cos(1) + 1/2

The "wrong" way is

sage: integrate(integrate(sin(x^2),x,y,1),y,0,1)
-1/16*(-1)^(3/4)*((sqrt(2) + 4*(-1)^(1/4))*e^I - sqrt(-I)*((I +
1)*sqrt(2)*(-1)^(1/4)*e^(2*I) - (I + 1)*sqrt(2)*(-1)^(1/4)*e^I) +
I*sqrt(2)*e^I - 2*(-1)^(1/4)*e^(2*I) - (I + 1)*sqrt(2) -
2*(-1)^(1/4))*e^(-I)

Is there any way to get Sage to check that these are equal?

The obvious thing does not seem to work:

sage: -1/16*(-1)^(3/4)*((sqrt(2) + 4*(-1)^(1/4))*e^I -
sqrt(-I)*((I + 1)*sqrt(2) : *(-1)^(1/4)*e^(2*I) - (I +
1)*sqrt(2)*(-1)^(1/4)*e^I) + I*sqrt(2)*e^I - 2* :
(-1)^(1/4)*e^(2*I) - (I + 1)*sqrt(2) - 2*(-1)^(1/4))*e^(-I) ==
-1/2*cos(1) : +1/2 -1/16*(-1)^(3/4)*((sqrt(2) +
4*(-1)^(1/4))*e^I - sqrt(-I)*((I + 1)*sqrt(2)*(-1)^(1/4)*e^(2*I) -
(I + 1)*sqrt(2)*(-1)^(1/4)*e^I) + I*sqrt(2)*e^I -
2*(-1)^(1/4)*e^(2*I) - (I + 1)*sqrt(2) - 2*(-1)^(1/4))*e^(-I) ==
-1/2*cos(1) + 1/2

Thanks,

Fernando

-- 
==

Fernando Q. Gouvea
Carter Professor of Mathematics
Colby College
Mayflower Hill 5836
Waterville, ME 04901
fqgou...@colby.edu  http://www.colby.edu/~fqgouvea

I have had a perfectly wonderful evening, but this wasn't it.
   --Groucho Marx

-- 
You received this message because you are subscribed to the Google

Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/sage-support/9557c1a9-bd1c-69e1-358f-4ab02a058c3a%40colby.edu

<https://groups.google.com/d/msgid/sage-support/9557c1a9-bd1c-69e1-358f-4ab02a058c3a%40colby.edu?utm_medium=email&utm_source=footer>.



--
William (http://wstein.org)
--
You received this message because you are subscribed to the Google 
Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CACLE5GC6SNZuSsJ13iRFbO72Udn80Yy5OavR1SFwv03gjaQxvw%40mail.gmail.com 
<https://groups.google.com/d/msgid/sage-support/CACLE5GC6SNZuSsJ13iRFbO72Udn80Yy5OavR1SFwv03gjaQxvw%40mail.gmail.com?utm_medium=email&utm_source=footer>.


--
==
Fernando Q. Gouvea
Carter Professor of Mathematics
Colby College
Mayflower Hill 5836
Waterville, ME 04901
fqgou...@colby.edu  http://www.colby.edu/~fqgouvea

What is socialism?

The painful transition from capitalism to capitalism.

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/5ea4d847-d5a5-1053-cc98-e071382cf49f%40colby.edu.


Re: [sage-support] another "how to simplify" question

2021-12-08 Thread Fernando Q. Gouvea
I see. So the difference between this and, say, 1+1==2 (which returns 
True) is that 1+1 and 2 are numbers, not symbolic things.


Fernando

On 12/8/2021 3:37 PM, William Stein wrote:



On Wed, Dec 8, 2021 at 12:22 PM Fernando Q. Gouvea 
 wrote:


Thank you, that works. What is strange is that this does not:

sage: right=integrate(integrate(sin(x^2),y,0,x),x,0,1) sage:
wrong=integrate(integrate(sin(x^2),x,y,1),y,0,1) sage:
real(wrong)==right -1/2*cos(1) + 1/2 == -1/2*cos(1) + 1/2

Is Sage seeing a difference there that I don't?


I think I don't understand the difference between
real(wrong)==right and bool(real(wrong)==right).

In Sage "[symbol thing] == [symbolic thing]" is a constructor for a 
symbolic equation.


sage: SR(2) == SR(2)
2 == 2
sage: parent(SR(2) == SR(2))
Symbolic Ring
sage: bool(SR(2) == SR(2))
True # only because Sage can *prove* they are equal -- it's false if 
it can't prove they are equal, even if they are equal...



https://cocalc.com/wstein/support/gouvea-equals


Fernando

On 12/8/2021 1:23 PM, William Stein wrote:

You can compare the real and imaginary parts directly.

https://cocalc.com/wstein/support/2021-12-08-gouvea

sage: bool(wrong.real()==right)
True
sage: wrong.imag()
0

On Wed, Dec 8, 2021 at 10:07 AM Fernando Q. Gouvea
 wrote:

I was showing my students a famous calculus example of an
integral that can be computed in one order of the variables
but not in the other. Knowing that SageMath can compute
anything, the students suggested trying the integral the
"wrong" way.

The "right" way is

sage: integrate(integrate(sin(x^2),y,0,x),x,0,1)

-1/2*cos(1) + 1/2

The "wrong" way is

sage: integrate(integrate(sin(x^2),x,y,1),y,0,1)
-1/16*(-1)^(3/4)*((sqrt(2) + 4*(-1)^(1/4))*e^I - sqrt(-I)*((I
+ 1)*sqrt(2)*(-1)^(1/4)*e^(2*I) - (I +
1)*sqrt(2)*(-1)^(1/4)*e^I) + I*sqrt(2)*e^I -
2*(-1)^(1/4)*e^(2*I) - (I + 1)*sqrt(2) - 2*(-1)^(1/4))*e^(-I)

Is there any way to get Sage to check that these are equal?

The obvious thing does not seem to work:

sage: -1/16*(-1)^(3/4)*((sqrt(2) + 4*(-1)^(1/4))*e^I -
sqrt(-I)*((I + 1)*sqrt(2) : *(-1)^(1/4)*e^(2*I) - (I +
1)*sqrt(2)*(-1)^(1/4)*e^I) + I*sqrt(2)*e^I - 2* :
(-1)^(1/4)*e^(2*I) - (I + 1)*sqrt(2) - 2*(-1)^(1/4))*e^(-I)
== -1/2*cos(1) : +1/2 -1/16*(-1)^(3/4)*((sqrt(2) +
4*(-1)^(1/4))*e^I - sqrt(-I)*((I +
1)*sqrt(2)*(-1)^(1/4)*e^(2*I) - (I +
1)*sqrt(2)*(-1)^(1/4)*e^I) + I*sqrt(2)*e^I -
2*(-1)^(1/4)*e^(2*I) - (I + 1)*sqrt(2) - 2*(-1)^(1/4))*e^(-I)
== -1/2*cos(1) + 1/2

Thanks,

Fernando

-- 
==

Fernando Q. Gouvea
Carter Professor of Mathematics
Colby College
Mayflower Hill 5836
Waterville, ME 04901
fqgou...@colby.edu  http://www.colby.edu/~fqgouvea

I have had a perfectly wonderful evening, but this wasn't it.
   --Groucho Marx

-- 
You received this message because you are subscribed to the

Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from
it, send an email to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/sage-support/9557c1a9-bd1c-69e1-358f-4ab02a058c3a%40colby.edu

<https://groups.google.com/d/msgid/sage-support/9557c1a9-bd1c-69e1-358f-4ab02a058c3a%40colby.edu?utm_medium=email&utm_source=footer>.



-- 
William (http://wstein.org)
-- 
You received this message because you are subscribed to the

Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/sage-support/CACLE5GC6SNZuSsJ13iRFbO72Udn80Yy5OavR1SFwv03gjaQxvw%40mail.gmail.com

<https://groups.google.com/d/msgid/sage-support/CACLE5GC6SNZuSsJ13iRFbO72Udn80Yy5OavR1SFwv03gjaQxvw%40mail.gmail.com?utm_medium=email&utm_source=footer>.


-- 
==

Fernando Q. Gouvea
Carter Professor of Mathematics
Colby College
Mayflower Hill 5836
Waterville, ME 04901
fqgou...@colby.edu  http://www.colby.edu/~fqgouvea

What is socialism?

The painful transition from capitalism to capitalism.

-- 
You received this message because you are subscribed to the Google

Groups "sage-support" group.
To unsubscribe from this group 

[sage-support] plotting tangent vectors to a curve

2022-04-08 Thread Fernando Q. Gouvea
There is an easy way to plot vector fields in Sage. Is there an easy way 
to plot a curve and (some of) its tangent vectors? I don't think 
plot_vector_field would play along if I wanted to restrict to a curve.


Fernando

--
==
Fernando Q. Gouvea
Carter Professor of Mathematics
Colby College
Mayflower Hill 5836
Waterville, ME 04901
fqgou...@colby.edu http://www.colby.edu/~fqgouvea

No matter where you stand, no matter how far or fast you flee, when it
hits the fan, as much as possible will be propelled in your direction,
and almost none will be returned to the source.
  -- John L. Shelton

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/cc8ca727-a1e1-8ea4-6e04-b0685e517acd%40colby.edu.


[sage-support] limitations of "solve"?

2023-11-28 Thread Fernando Q. Gouvea
Yesterday I was demonstrating to my calculus class Sage's ability to 
implement the method of Lagrange multipliers. I used a standard example, 
putting the following code into SageMath Cell:


var('x,y,l')
f(x,y)=10*x^(1/3)*y^(2/3)
g(x,y)=5*x-6*y
fx=diff(f,x)
fy=diff(f,y)
gx=diff(g,x)
gy=diff(g,y)
solve((fx(x,y)==l*gx(x,y),fy(x,y)==l*gy(x,y),g(x,y)==120),(x,y,l))

That works beautifully. Then I decided to show off Sage's powers by 
making a little change:


var('x,y,l')
f(x,y)=10*x^(1/3)*y^(2/3)
g(x,y)=5*x^2+6*y
fx=diff(f,x)
fy=diff(f,y)
gx=diff(g,x)
gy=diff(g,y)
solve((fx(x,y)==l*gx(x,y),fy(x,y)==l*gy(x,y),g(x,y)==120),(x,y,l))

SageCell now gives me a spinning symbol ("I'm working") for a while, 
then seems to exit without any result. On my local installation (Sage 
9.2 on Windows) it returns an empty list, [].


What is curious is that the constraint equation 5x^2 + 6y=120 is easily 
solved for y...


Questions:

1) Shouldn't SageCell output an empty list here?

2) Is this a known limitation of "solve"?

Fernando

PS: It seems that if I add "algorithm='sympy'" then solutions are found.

--
==
Fernando Q. Gouvea
Carter Professor of Mathematics
Colby College
Mayflower Hill 5836
Waterville, ME 04901
fqgou...@colby.edu http://www.colby.edu/~fqgouvea



--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/62540dcf-47c4-4d54-bf35-2a2a8dd13a39%40colby.edu.


[sage-support] Re: limitations of "solve"?

2023-11-28 Thread Fernando Q. Gouvea
Answering part of my question: it seems that sympy and maxima have 
different attitudes towards fractional powers of negative numbers, which 
may be the source of the problem.


If I change to g(x,y)=x^2+6*y then "solve" has no problem finding 
x=2*sqrt(6), y=16.


Fernando

On 11/28/2023 10:36 AM, Fernando Q. Gouvea wrote:
Yesterday I was demonstrating to my calculus class Sage's ability to 
implement the method of Lagrange multipliers. I used a standard 
example, putting the following code into SageMath Cell:


var('x,y,l')
f(x,y)=10*x^(1/3)*y^(2/3)
g(x,y)=5*x-6*y
fx=diff(f,x)
fy=diff(f,y)
gx=diff(g,x)
gy=diff(g,y)
solve((fx(x,y)==l*gx(x,y),fy(x,y)==l*gy(x,y),g(x,y)==120),(x,y,l))

That works beautifully. Then I decided to show off Sage's powers by 
making a little change:


var('x,y,l')
f(x,y)=10*x^(1/3)*y^(2/3)
g(x,y)=5*x^2+6*y
fx=diff(f,x)
fy=diff(f,y)
gx=diff(g,x)
gy=diff(g,y)
solve((fx(x,y)==l*gx(x,y),fy(x,y)==l*gy(x,y),g(x,y)==120),(x,y,l))

SageCell now gives me a spinning symbol ("I'm working") for a while, 
then seems to exit without any result. On my local installation (Sage 
9.2 on Windows) it returns an empty list, [].


What is curious is that the constraint equation 5x^2 + 6y=120 is 
easily solved for y...


Questions:

1) Shouldn't SageCell output an empty list here?

2) Is this a known limitation of "solve"?

Fernando

PS: It seems that if I add "algorithm='sympy'" then solutions are found.


--
==
Fernando Q. Gouvea
Carter Professor of Mathematics
Colby College
Mayflower Hill 5836
Waterville, ME 04901
fqgou...@colby.edu http://www.colby.edu/~fqgouvea

Let the majority eavesdrop if they like, but their tastes should be
firmly ignored.
  -- Dwight Macdonald, in "Masscult & Midcult"

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/b9576228-7687-44ca-a81e-eaa0aea02630%40colby.edu.