on 4/26/04 11:25 AM, Barton Willis at willisb@unk.edu wrote:
> Try this; first make these assignments
>
> (C1) gcd : 'spmod$
> (C2) algebraic : true$
>
> Now run your code.
>
> There is a small chance that you'll avoid the
> "Polynomial quotient is not exact" error.
>
> gcd defaults to 'subres' and algebraic defaults to 'true.' I've
> seen the "Polynomial quotient is not exact" error go away
> by changing the gcd algorithm to spmod and
> setting algebraic to true.
>
> Good luck.
>
>
> Barton
>
on 4/26/04 11:52 AM, Joe Koski at jkoski11@comcast.net wrote:
> Thanks for the quick replies. I'll try Barton Willis's suggestions and
> report back. It may be a few days.
>
> Yes, I do consider success with this approach to be a long shot. After I've
> exhausted some possibilities, I'll post a batch file and the underlying
> derivation for the scrutiny of those who may have seen this type of problem
> before.
>
> Joe Koski
>
> on 4/26/04 11:35 AM, Richard Fateman at fateman@cs.berkeley.edu wrote:
>
>> This error indicates a bug in the polynomial GCD algorithm
>> or perhaps in some data transformations leading up to it.
>> "Polynomial quotient is not exact" means that the system
>> has computed
>> G = greatest common divisor of polynomials A and B.
>> It then reduces C=A/G, D=B/G.
>>
>> The error message says that G does not divide A or perhaps B.
>>
>> What to do?
>> Perhaps change the polynomial GCD routine being used.
>> Since your problem looks like an elliptic integral, it
>> would be surprising if Maxima did it. There is a higher
>> probability that the commercial Macsyma, or one of the other M systems
>> would do it. So maybe you should post it.
>>
>> Maxima would consider a problem that required an elliptic function
>> to be non-integrable, except perhaps in very rare lucky circumstances.
>>
>> RJF
>>
>>
>> Joe Koski wrote:
>>
>>> I'm trying to integrate a function that is a ratio of polynomials in the
>>> general form
>>>
>>> f(x)/g(x)^(3/2)
>>>
>>> where f(x) and g(x) are relatively complicated polynomials in x. If the
>>> integration succeeds, I should have the x-component of the magnetic field
>>> (B) for a cubic spline curve segment located in the x-y plane.
>>>
>>> After many hours, Maxima quits with the error:
>>>
>>> Polynomial quotient is not exact
>>> -- an error. Quitting. To debug this try DEBUGMODE(TRUE);)
>>>
>>> My questions:
>>>
>>> 1) Is there a simple explanation of this problem? What is the "polynomial
>>> quotient?" All exponents in the polynomials are integers, but their ratios
>>> are not, sometimes.
>>>
>>> 2) Does this indicate that the function can not be integrated at all, or is
>>> it a Lisp/Maxima problem?
>>>
>>> 3) Are there any work-arounds or alternative approaches suggested. There may
>>> be some elliptic integrals lurking in the problem, or it could simply be
>>> nonintegrable.
>>>
>>> I've been trying to solve this problem on-and-off for over ten years as a
>>> kind of stress test for Maxima and Mathematica. This is the first time the
>>> computer has had enough memory and speed to actually give me an error
>>> instead of just running out of resources. If this works, I think it could be
>>> a useful tool for designing magnet sets, if it doesn't, no harm done.
>>>
>>> I can post the batch script if it would help. Thanks for any suggestions.
>>>
>>> Joe Koski
>>>
>>>
A (lack of) progress report: I made the changes that Barton Willis suggested
above, and restarted the batch file. Eight days and five days worth of cpu
time later (hey, no problem, it minds its own business while I work on other
things) the batch file is still running with no errors to report. Watching
lisp.run with the UNIX "top" monitor, program size seems to cycle between
about 400 and about 600 MB of memory usage, with a tendency for the maximum
memory usage to sometimes creep upward with time. This probably just
indicates that the garbage collector is working. It's running on a dual
processor 1.8 GHz G5 Macintosh with 1 GB memory under OS X 10.3.3 with
Maxima 5.9.0 and clisp 2.31.
My guess is that the integration routine is hung in a loop of some sort. Is
that possible, or is it just trying to exhaust a very large number of
possibilities?
The entire batch script is as follows:
gcd : 'spmod$
algebraic : true$
y:a*(x-x1)^3 + b*(x-x1)^2 + c*(x-x1) + d;
theta:atan(diff(y,x));
bx:(sin(theta)*zp)/((xp-x)^2+(yp-y)^2+zp^2)^(3/2);
integrate(%,x);
Once the integration completes, the integral must be evaluated between the
limits of x1 and x2 to get the x-component of the magnetic field vector, B,
at point (xp, yp, zp). There are three more similar integrals necessary to
define all components of B.
Would the experienced Maxima/Lisp users please recommend whether to kill
this process or let it continue. (Yes, I know I should have killed it days
ago.) My next step is to try the magnetic vector potential approach which
promises an "easier" integral with sqrt in the denominator not ^(3/2). On
the other hand, that approach is even more likely to contain elliptic
integrals of some form. Finally, I guess I could write a routine that uses
adaptive numerical integration to solve the problem, but the challenge was
to use a symbolic math program to avoid that.
Thanks, I'm open to any advice and suggestions.
Joe Koski