rtoy / maxima

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

assume(var>0) produces different result than answering "Is var positive, negative or zero?" #3277

Open rtoy opened 4 months ago

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-07 19:50:45 Created by ariel-co on 2013-07-17 05:12:34 Original: https://sourceforge.net/p/maxima/bugs/2611


When calculating the limit below, I get different results depending on whether I 'assume(t>0)' or wait for limit() to prompt and answer 'positive' (or set assume_pos:true). The result when I assume(t>0) (%o8, %o9) is wrong for the physical problem I intend to solve, and the other result (%o11, %o12) is as expected.

(%i1) T : 1/(C^2*R1*R2*s^2+C*(2*R1+R2)*s+1) $

(%i2) x : A*sin(2*%pi*f*t)*unit_step(t) $

(%i3) X : laplace(x,t,s);
                                  2 %pi f A
(%o3)                           --------------
                                     2  2    2
                                4 %pi  f  + s
(%i4) Y : X*T;
                                  2 %pi f A
(%o4)        ----------------------------------------------------
                   2  2    2        2  2
             (4 %pi  f  + s ) (1 + s  C  R1 R2 + s C (2 R1 + R2))
(%i5) assume(C>0, f>0, R1>0, R2>0) $

(%i6) y : ilt(Y,s,t) $

(%i7) assume(t>0) $

(%i8) limit(y, R2, 0, plus), ratsimp;
               - sin(2 %pi f t) A + 4 %pi f cos(2 %pi f t) A C R1
(%o8)        - --------------------------------------------------
                                       2  2  2   2
                             1 + 16 %pi  f  C  R1
(%i9) float(%), t=0;
                           12.56637061435917 f A C R1
(%o9)                 - ---------------------------------
                                                 2  2   2
                        1.0 + 157.9136704174297 f  C  R1
(%i10) forget(t>0) $

(%i11) limit(y, R2, 0, plus), ratsimp;
Is  t  positive, negative, or zero?

pos;
                t
            - ------
              2 C R1
(%o11) - (%e         (- 4 %pi f A C R1 + (- sin(2 %pi f t) A
                                                 t
                                               ------
                                               2 C R1              2  2  2   2
            + 4 %pi f cos(2 %pi f t) A C R1) %e      ))/(1 + 16 %pi  f  C  R1 )
(%i12) float(%), t=0;
(%o12)                                0.0
(%i13) build_info();
(%o13) 
Maxima version: "5.29.1"
Maxima build date: "2012-12-29 23:14:09"
Host type: "x86_64-unknown-linux-gnu"
Lisp implementation type: "GNU Common Lisp (GCL)"
Lisp implementation version: "GCL 2.6.7"

What am I missing? What's different between assume()-ing the predicate beforehand and providing the sign interactively?

Best regards,

Ariel Cornejo

Attachments:

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-07 19:50:46 Created by robert_dodier on 2013-07-22 17:16:23 Original: https://sourceforge.net/p/maxima/bugs/2611/#c1b2