solve solution is this a bug?

53 views
Skip to first unread message

Charles Bradshaw

unread,
Jan 12, 2023, 3:00:35 PM1/12/23
to sage-support
In the attached screenshot line 'out [113]' and 'out [98]' please observe 2*pi*z5484
the attempt to evaluate:  line [114] produces the error x5484 is not defined

is this a bug or did I not understand something?

I am running Fedora 37 with the dnf installed
SageMath version 9.6, Release Date: 2022-05-15
Using Python 3.11.1.

Thanks

Dima Pasechnik

unread,
Jan 12, 2023, 3:14:20 PM1/12/23
to sage-s...@googlegroups.com
On Thu, Jan 12, 2023 at 8:00 PM 'Charles Bradshaw' via sage-support
<sage-s...@googlegroups.com> wrote:
>
> In the attached screenshot line 'out [113]' and 'out [98]' please observe 2*pi*z5484
> the attempt to evaluate: line [114] produces the error x5484 is not defined

there is no attachment.


>
> is this a bug or did I not understand something?
>
> I am running Fedora 37 with the dnf installed
> SageMath version 9.6, Release Date: 2022-05-15
> Using Python 3.11.1.
>
> Thanks
>
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/e870bef7-68db-49a5-b45a-5508c039caf3n%40googlegroups.com.

Charles Bradshaw

unread,
Jan 12, 2023, 3:40:48 PM1/12/23
to sage-support
My mistake, here is the screenshot
Screenshot.png

Dima Pasechnik

unread,
Jan 12, 2023, 5:47:26 PM1/12/23
to sage-s...@googlegroups.com
the screenshot does not show lines 113 and 98 you refer to.
It might be better to send the notebook than the screenshot.

On Thu, Jan 12, 2023 at 8:40 PM 'Charles Bradshaw' via sage-support
<sage-s...@googlegroups.com> wrote:
>
> My mistake, here is the screenshot
>
> On Thursday, January 12, 2023 at 8:14:20 PM UTC dim...@gmail.com wrote:
>>
>> On Thu, Jan 12, 2023 at 8:00 PM 'Charles Bradshaw' via sage-support
>> <sage-s...@googlegroups.com> wrote:
>> >
>> > In the attached screenshot line 'out [113]' and 'out [98]' please observe 2*pi*z5484
>> > the attempt to evaluate: line [114] produces the error x5484 is not defined
>>
>> there is no attachment.
>>
>>
>> >
>> > is this a bug or did I not understand something?
>> >
>> > I am running Fedora 37 with the dnf installed
>> > SageMath version 9.6, Release Date: 2022-05-15
>> > Using Python 3.11.1.
>> >
>> > Thanks
>> >
>> > --
>> > 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...@googlegroups.com.
>> > To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/e870bef7-68db-49a5-b45a-5508c039caf3n%40googlegroups.com.
>
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/24aabd61-0475-4a2e-bcd9-ae577f0931ecn%40googlegroups.com.

Charles Bradshaw

unread,
Jan 13, 2023, 5:39:48 AM1/13/23
to sage-support
OK One more time. I finally figured out how to attach the the notebook.  I hope it's in the right format.
In the process of playing with the probllem I have re-numbered the lines.

The pi*z1649 term now appears in line 5, 7 and 8

Where did the z come from??

Thanks for your patience.
test-1.ipynb

Charles Bradshaw

unread,
Jan 13, 2023, 9:27:37 AM1/13/23
to sage-support
More info:
If I run my notebook code on https://sagecell.sagemath.org/ is see a huge page of errors begining:

/home/sc_serv/sage/src/sage/calculus/calculus.py:2509: DeprecationWarning: Importing union from here is deprecated; please use "from sage.misc.misc import union" instead. See https://trac.sagemath.org/32096 for details. f = SR(sage.all.__dict__[name])
...

I say again is this a bug or what?

Emmanuel Charpentier

unread,
Jan 13, 2023, 10:01:03 AM1/13/23
to sage-support

In Google Groups, I can’t see the screenshot nor the notebook, but this is a FAQ, so I risk an answer :

solve, used without algorithm= uses Maxima’s solver. The latter may introduce new variables to denote unknown, arbitrary, quantities : “zxxx” denote integer arbitrary constants, “rxxx” denoting real or complex arbitrary constants. But…

… the Sage interface to Maxima doesn’t catch them and does not define them in Sage. You have to catch them and declare them yourself. A quick and crude way to catch undefined variables in an expression E is [u for u in E.variables() if str(u) not in globals()] ; declaring them may use var(str(u)).

HTH,

Dima Pasechnik

unread,
Jan 13, 2023, 10:46:16 AM1/13/23
to sage-s...@googlegroups.com
On Fri, Jan 13, 2023 at 2:27 PM 'Charles Bradshaw' via sage-support
<sage-s...@googlegroups.com> wrote:
>
> More info:
> If I run my notebook code on https://sagecell.sagemath.org/ is see a huge page of errors begining:

sagecell does not take ipython notebooks, sorry, not a bug.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/83fdd5b4-f45a-4e5a-b0de-3b88c9567eb2n%40googlegroups.com.

Dima Pasechnik

unread,
Jan 13, 2023, 11:07:14 AM1/13/23
to sage-s...@googlegroups.com
On Fri, Jan 13, 2023 at 3:01 PM Emmanuel Charpentier
<emanuel.c...@gmail.com> wrote:
>
> In Google Groups, I can’t see the screenshot nor the notebook, but this is a FAQ, so I risk an answer :
>
> solve, used without algorithm= uses Maxima’s solver. The latter may introduce new variables to denote unknown, arbitrary, quantities : “zxxx” denote integer arbitrary constants, “rxxx” denoting real or complex arbitrary constants. But…
>
> … the Sage interface to Maxima doesn’t catch them and does not define them in Sage. You have to catch them and declare them yourself. A quick and crude way to catch undefined variables in an expression E is [u for u in E.variables() if str(u) not in globals()] ; declaring them may use var(str(u)).

yes, that's what I was going to say, too, after trying to run this notebook.
And indeed, "z1649" ( a different run might produce a differently
named "z..." variable)
is a variable representing an arbitrary integer.

If you want to pick a particular value of it, say, 42, it can be done
as follows:

sol[0][t02](z1649=42)

(and you should get 85/2*pi)

HTH
Dima

>
> HTH,
>
> Le jeudi 12 janvier 2023 à 21:40:48 UTC+1, brad...@ntlworld.com a écrit :
>>
>> My mistake, here is the screenshot
>>
>> On Thursday, January 12, 2023 at 8:14:20 PM UTC dim...@gmail.com wrote:
>>>
>>> On Thu, Jan 12, 2023 at 8:00 PM 'Charles Bradshaw' via sage-support
>>> <sage-s...@googlegroups.com> wrote:
>>> >
>>> > In the attached screenshot line 'out [113]' and 'out [98]' please observe 2*pi*z5484
>>> > the attempt to evaluate: line [114] produces the error x5484 is not defined
>>>
>>> there is no attachment.
>>>
>>>
>>> >
>>> > is this a bug or did I not understand something?
>>> >
>>> > I am running Fedora 37 with the dnf installed
>>> > SageMath version 9.6, Release Date: 2022-05-15
>>> > Using Python 3.11.1.
>>> >
>>> > Thanks
>>> >
>>> > --
>>> > 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...@googlegroups.com.
>>> > To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/e870bef7-68db-49a5-b45a-5508c039caf3n%40googlegroups.com.
>
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/283777a5-40f2-4b95-ad85-f28ad3315d21n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages