Rational simplification bug ("Quotient by a polynomial of higher degree" error message)
Subject: Rational simplification bug ("Quotient by a polynomial of higher degree" error message)
From: Alan W. Irwin
Date: Wed, 28 Nov 2012 12:54:01 -0800 (PST)
On 2012-11-28 10:34-0500 Karl-Dieter Crisman wrote:
> On Wed, Nov 28, 2012 at 10:27 AM, Karl-Dieter Crisman
> <kcrisman at gmail.com> wrote:
>> Hi Alan,
>>
>> On Wed, Nov 28, 2012 at 5:27 AM, <maxima-request at math.utexas.edu> wrote:
>>> Rational simplification bug ("Quotient by a polynomial of
>>> higher degree" error message)
>>
>> You can just do the following to check this in Maxima.
>>
>> sage -maxima
>>
>> (%i1) fullratsimp(paste in your expression here);
>> (%01) 0
>>
>> well, that's what I got for your big one. But it looks like your
>> expressions are well-formed enough that you can just paste them into
>> Maxima directly. If you try to report a bug upstream, it's good to
>> try to do it in the "native" language, though of course sometimes
>> that's challenging.
>
> Also, even in Sage I get zero (5.4.1). This is with nbody=3.
>
> sage: Residual[0]
> (2*(beta + gamma)*G*M_2/(sqrt((z_0 - z_2)^2 + (y_0 - y_2)^2 + (x_0 -
> x_2)^2)*c^2) - (vx_0^2 + vy_0^2 + vz_0^2)*gamma/c^2 - 1)*(x_0 -
> x_2)*G*M_2/((z_0 - z_2)^2 + (y_0 - y_2)^2 + (x_0 - x_2)^2)^(3/2) +
> 1/2*(4*gamma + 3)*G*M_2*a_x2/(sqrt((z_0 - z_2)^2 + (y_0 - y_2)^2 +
> (x_0 - x_2)^2)*c^2) + (x_0 - x_2)*G*M_2/((z_0 - z_2)^2 + (y_0 - y_2)^2
> + (x_0 - x_2)^2)^(3/2) - 1/2*(x_0 - x_2)*(2*(gamma + 1)*(vx_2^2 +
> vy_2^2 + vz_2^2) - 4*(gamma + 1)*(vx_0*vx_2 + vy_0*vy_2 + vz_0*vz_2) -
> 2*(2*beta - 1)*U_2 - (z_0 - z_2)*a_z2 - (y_0 - y_2)*a_y2 - (x_0 -
> x_2)*a_x2 - 3*((z_0 - z_2)*vz_2 + (y_0 - y_2)*vy_2 + (x_0 -
> x_2)*vx_2)^2/((z_0 - z_2)^2 + (y_0 - y_2)^2 + (x_0 -
> x_2)^2))*G*M_2/(((z_0 - z_2)^2 + (y_0 - y_2)^2 + (x_0 -
> x_2)^2)^(3/2)*c^2) + (vx_0 - vx_2)*(2*(gamma + 1)*((z_0 - z_2)*vz_0 +
> (y_0 - y_2)*vy_0 + (x_0 - x_2)*vx_0) - (2*gamma + 1)*((z_0 - z_2)*vz_2
> + (y_0 - y_2)*vy_2 + (x_0 - x_2)*vx_2))*G*M_2/(((z_0 - z_2)^2 + (y_0 -
> y_2)^2 + (x_0 - x_2)^2)^(3/2)*c^2) + 1/2*(4*(gamma + 1)*((z_0 -
> z_2)*(vz_0 - vz_2) + (y_0 - y_2)*(vy_0 - vy_2) + (x_0 - x_2)*(vx_0 -
> vx_2))*G*M_2*vx_2/((z_0 - z_2)^2 + (y_0 - y_2)^2 + (x_0 -
> x_2)^2)^(3/2) - 4*(gamma + 1)*G*M_2*a_x2/sqrt((z_0 - z_2)^2 + (y_0 -
> y_2)^2 + (x_0 - x_2)^2) - (x_0 - x_2)*(2*(2*gamma + 1)*G*M_2/sqrt((z_0
> - z_2)^2 + (y_0 - y_2)^2 + (x_0 - x_2)^2) + vx_0^2 + vy_0^2 +
> vz_0^2)*G*M_2/((z_0 - z_2)^2 + (y_0 - y_2)^2 + (x_0 - x_2)^2)^(3/2) -
> 2*((2*gamma + 1)*((z_0 - z_2)*(vz_0 - vz_2) + (y_0 - y_2)*(vy_0 -
> vy_2) + (x_0 - x_2)*(vx_0 - vx_2))*G*M_2/((z_0 - z_2)^2 + (y_0 -
> y_2)^2 + (x_0 - x_2)^2)^(3/2) + (z_0 - z_2)*G*M_2*vz_0/((z_0 - z_2)^2
> + (y_0 - y_2)^2 + (x_0 - x_2)^2)^(3/2) + (y_0 - y_2)*G*M_2*vy_0/((z_0
> - z_2)^2 + (y_0 - y_2)^2 + (x_0 - x_2)^2)^(3/2) + (x_0 -
> x_2)*G*M_2*vx_0/((z_0 - z_2)^2 + (y_0 - y_2)^2 + (x_0 -
> x_2)^2)^(3/2))*vx_0)/c^2 - 1/2*(2*(2*beta - 1)*(x_0 -
> x_2)*G^2*M_2^2/((z_0 - z_2)^2 + (y_0 - y_2)^2 + (x_0 - x_2)^2)^2 -
> (2*gamma + 1)*(x_0 - x_2)*(vx_0^2 + vy_0^2 + vz_0^2)*G*M_2/((z_0 -
> z_2)^2 + (y_0 - y_2)^2 + (x_0 - x_2)^2)^(3/2) - (x_0 - x_2)*(2*(gamma
> + 1)*(vx_2^2 + vy_2^2 + vz_2^2) - 2*(2*beta - 1)*U_2 - (z_0 -
> z_2)*a_z2 - (y_0 - y_2)*a_y2 - (x_0 - x_2)*a_x2 - ((z_0 - z_2)*vz_2 +
> (y_0 - y_2)*vy_2 + (x_0 - x_2)*vx_2)^2/((z_0 - z_2)^2 + (y_0 - y_2)^2
> + (x_0 - x_2)^2))*G*M_2/((z_0 - z_2)^2 + (y_0 - y_2)^2 + (x_0 -
> x_2)^2)^(3/2) + (2*(x_0 - x_2)*((z_0 - z_2)*vz_2 + (y_0 - y_2)*vy_2 +
> (x_0 - x_2)*vx_2)^2/((z_0 - z_2)^2 + (y_0 - y_2)^2 + (x_0 - x_2)^2)^2
> - 2*((z_0 - z_2)*vz_2 + (y_0 - y_2)*vy_2 + (x_0 -
> x_2)*vx_2)*vx_2/((z_0 - z_2)^2 + (y_0 - y_2)^2 + (x_0 - x_2)^2) -
> a_x2)*G*M_2/sqrt((z_0 - z_2)^2 + (y_0 - y_2)^2 + (x_0 - x_2)^2) +
> 4*(gamma + 1)*((x_0 - x_2)*G*M_2*vx_0*vx_2/((z_0 - z_2)^2 + (y_0 -
> y_2)^2 + (x_0 - x_2)^2)^(3/2) + (x_0 - x_2)*G*M_2*vy_0*vy_2/((z_0 -
> z_2)^2 + (y_0 - y_2)^2 + (x_0 - x_2)^2)^(3/2) + (x_0 -
> x_2)*G*M_2*vz_0*vz_2/((z_0 - z_2)^2 + (y_0 - y_2)^2 + (x_0 -
> x_2)^2)^(3/2)))/c^2
> sage: Residual[0].simplify_rational()
> 0
>
> So I'm not sure why fullratsimp isn't working on your machine, unless
> I made a mistake in your script.
Hi Karl-Dieter:
Thanks very much for your detailed replies.
The interesting result is I cannot replicate your above result for Residual[0] with nbody=3 (the
only change that should be made to the script). My result (attached)
is quite a bit longer (5624 bytes) and involves both M_2 and M1. So
it appears a lot more simplification is going on for your sage
platform compared to mine _before_ the Residual[0] result is obtained.
And I assume since your Residual[0] result is already more simplified
than mine, you don't run into further simplication errors for
Residual[0].simplify_rational() when simplifying it to 0.
The paste limit for maxima appears to be 4096 bytes which appears to
me to be a limitation for maxima that should be fixed. (Note this is
not a cut limit, because I was able to cut and paste my Residual[0]
result into emacs to generate the file that is attached.)
Because of this maxima limitation I cannot use your suggested method
of running sage -maxima and pasting in the attached result. Do you
have another maxima method you could suggest that could work around
the paste limit? For example, is there a method to concatanate two
strings together (each less than 4096 bytes) into a valid expression
that can be simplified?
Of course, if you do find a method of running fullratsimp on the
attached expression, you might run into exactly the simplification
error that started this thread which would be a good thing from the
perspective of attempting to replicate the maxima simplification
error which, of course, is the first step toward debugging this issue.
Of course, what I am interested in a lot more is to confirm the
simplfied Residual[0] result for nbody=3, 4, etc. Since you have had
success with that, I would like to replicate your sage-5.4.1 platform
as closely as possible. Can you describe that platform in more
detail? For example, did you build it yourself from vanilla
sage-5.4.1 was that a patched version, or was that a binary download?
And just in case it makes a difference, what hardware are you using,
how many cpu's, etc.
In my case I built (on a Debian Wheezy platform with Intel AMD64
hardware) sage with everything default for the build other than
setting export MAKE="make -j4" to take advantage of the two cpus for
my hardware. This (3-hour!) build automatically included a build of
maxima-5.26.0. My understanding is such builds try to take advantage
of all characteristics of your hardware to be as efficient as possible
while the binary downloaded version of sage is more generic.
It's possible the latter may be less prone to issues so my next step
is to try a binary download of sage-5.4.1 to see if I can replicate
the good result you got from my script for nbody=3. However, if your
reply identifies some other sage-5.4.1 alternative you were using
(such as a patched build), I would be happy to try that too.
Finally, my thanks to everybody here that has replied already for
being so understanding about my mixed sage/maxima questions. I
thought this was the right place to ask these question because my
google search revealed no other sage-related questions for this maxima
error message, but lots of (historical) hits for this error message
for vanilla maxima without sage. And by attaching my detailed results
for Residual[0] (which presumably somebody can find a way to import
into vanilla maxima without running into the paste length limitation),
I am hoping this thread will eventually result in a fix for maxima's
ability to simplify expressions.
Alan
__________________________
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________
Linux-powered Science
__________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_irwin
Type: application/octet-stream
Size: 5624 bytes
Desc: Expression that leads to maxima error message
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20121128/e943c68e/attachment.obj>