rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

inf calc #1442

Open rtoy opened 2 months ago

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-04 16:02:05 Created by nobody on 2010-09-03 07:46:26 Original: https://sourceforge.net/p/maxima/bugs/2067


Hi guys,

I wrote a small batch file and it does not take an end with the calculation: Here some information:

-------------------------------------------------------------

Maxima version: 5.21.1 Maxima build date: 21:54 8/30/2010 Host type: i686-pc-linux-gnu Lisp implementation type: SBCL Lisp implementation version: 1.0.42

-------------------------------------------------------------

The problem accours in the function E_i(t), when it calls ix(t,z). After some debuggin I got this message:

-------------------------------------------------------------

rat: replaced -333.333333333333 by -1000/3 = -333.333333333333 Trace exiting E_i level 1 Entering a Maxima break point. Type 'exit;' to resume. _exit; (1 EXIT |$E_i| (#1=(MTIMES . #2=(SIMP)) 600000 ((%INTEGRATE . #2#) (#1# ((MPLUS SIMP #3=(14 #4="/home/eule/Projekte/Bachelorarbeit/Berechnungen/lamp-new.mac" SRC |$E_i| 14)) 1000000 (#1# -2 ((MEXPT SIMP #3#) $Z 2))) (#5=(MEXPT . #2#) ((MPLUS SIMP #3#) 1000000 ((MEXPT SIMP #3#) $Z 2)) -2) (#5# ((MPLUS SIMP #6=(6 #4# SRC $IX 6)) 1 (#1# (#7=(RAT SIMP) 1 320000000000000000000000000) (#5# ((MPLUS SIMP #6#) $T (#1# (#7# -1 300000000) (#5# ((MPLUS SIMP #6#) 1000000 ((MEXPT SIMP #6#) $Z 2)) #8=(#7# 1 2)))) -5))) -1) ((MEXPT SIMP #6#) $%E (#1# 10000 (#9=(MPLUS . #2#) (#1# -1 $T) (#1# (#7# 1 300000000) (#5# ((MPLUS SIMP #6#) 1000000 ((MEXPT SIMP #6#) $Z 2)) #8#)))))) $Z 0 ((MTIMES SIMP #10=(8 #4# SRC $HX 8)) 2.222222222222222e-9 ((MPLUS SIMP #10#) ((MTIMES SIMP #10#) 90000000000000000 $T) (#1# -1.5e11 (#5# (#9# 3.0 (#1# 90000000000 ((MEXPT SIMP #10#) $T 2))) #8#))))))

-------------------------------------------------------------

at this point the program doesn't react anymore. Its reproduceable and I have idea, whats it is.

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-04 16:02:07 Created by *anonymous on 2010-09-03 07:46:26 Original: https://sourceforge.net/p/maxima/bugs/2067/#d796


batch file

Attachments:

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-04 16:02:10 Created by rtoy on 2010-09-03 12:43:36 Original: https://sourceforge.net/p/maxima/bugs/2067/#85f1


I think maxima is getting stuck doing an adaptive plot of E_i(t) and the integration in E_i(t) is probably causing the problem.

In E_i(t), you may want to replace integrate(...) with quad_qags(...)[1]. This will numerically integrate the expression instead of trying to do it symbolically. When I do this, I get a nice plot of E_i(t).

Can't do this for E_di(t), because you compute the symbolic derivative later in E_dip(t). But maxima has no problem plotting E_di(t).

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-04 16:02:13 Created by crategus on 2010-09-03 19:06:02 Original: https://sourceforge.net/p/maxima/bugs/2067/#6ebf


When I enter all of the definitions of this example and I try to get a numerical value for E_di(t), I get an error:

(%i18) E_di(1.0);

diff: second argument must be a variable; found 1.0 #0: ipx(t=1.0,z=z) #1: E_di(t=1.0) -- an error. To debug this try: debugmode(true);

When I try to get a result for a symbolic value I get a question from integrate. This might be the reason the example seems to hang.

(%i19) E_di(x);

Is sqrt(3*(30000000000*x^2+1))-600000*x positive, negative, or zero? p;

(%o19) (5.399999999999998e+75*x^7+sqrt(9.e+10*x^2+3.0) *(9.e+69*x^6+3.999999999999997e+59*x^4 -1.777777777777776e+49*x^2 -7.901234567901232e+38) +5.999999999999999e+65*x^5 +2.133333333333333e+55*x^3 +2.37037037037037e+44*x) *sqrt(-1.333333333333333e+11*x*sqrt(9.e+10*x^2+3.0) +5.e+16*x^2+1333333.333333333) *(100000000*(x/(300000000*sqrt(x^2+1000000))-1) *%e^(10000*(sqrt(x^2+1000000)/300000000-x)) /(1/(320000000000000000000000000*(x-sqrt(x^2+1000000)/300000000)^5) +1) +(1-x/(300000000*sqrt(x^2+1000000))) *%e^(10000*(sqrt(x^2+1000000)/300000000-x)) /(6400000000000000000000*(x-sqrt(x^2+1000000)/300000000)^6 *(1/(320000000000000000000000000 *(x-sqrt(x^2+1000000)/300000000)^5) +1) ^2)) /(5*(8.099999999999997e+89*x^8+1.44e+80*x^6+9.599999999999996e+69*x^4 +2.844444444444443e+59*x^2 +3.160493827160493e+48))

I think we do not have a bug, but the problem has to be reformulated to give the expected answers.

Dieter Kaiser

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-04 16:02:17 Created by *anonymous on 2010-09-03 22:09:02 Original: https://sourceforge.net/p/maxima/bugs/2067/#9a4a


I attatched a new file. In the previous I had a small mistake. in:

ipx(t,z) := diff(ix(t,t),t,1);

you have to change the parameters from ix(t,t) to ix(t,z). Now the error comes a little bit earlier, but its the same.

@crategus : I don't think the integration question has something to do with it. when you run the new batch file, you can see, that after the questions a lot of parameters are handeld. But after a while, it stops and cpu-usage goes to 100%. Very strange

@rtoy: Yes. The problem is, that i have to calculate a little bit more with symbolic functions. This is just a small extract from a bigger file. In addition, I need the output for some of the symbolic calculations.

Do someone know how I can do maxima a little bit more communicative, means print more messages? And how can I assign maxima to answer the integration question automatically?

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-04 16:02:20 Created by *anonymous on 2010-09-04 08:49:45 Original: https://sourceforge.net/p/maxima/bugs/2067/#efd6


Closer Error file

Attachments:

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-04 16:02:24 Created by robert_dodier on 2023-01-04 02:51:33 Original: https://sourceforge.net/p/maxima/bugs/2067/#d434


rtoy commented 2 months ago

Imported from SourceForge on 2024-07-04 16:02:27 Created by robert_dodier on 2023-01-04 02:51:33 Original: https://sourceforge.net/p/maxima/bugs/2067/#c5b6


I observe the same behavior with current post-5.46 Maxima.

A little debugging shows that the Risch integrator is trying to compute GCD of very large polynomials (lots of terms and very large coefficients). It gets stuck that way both when parameters are assigned numerical values and when they aren't.

Given that, I don't think there's any way to fix this, short of reworking the polynomial GCD code and/or reworking the Risch integrator to avoid blowing up the problem. This is a real bug, but I'm closing it as "won't fix" because I don't think there's any way to fix it at present.

If ever we circle back and work on GCD and/or Risch, we can reopen this ticket.