Menu

#4398 laplace (delta (t - a) * sin(b*t), t, s) gives zero

None
closed
laplace (6)
5
2024-11-06
2024-10-30
No

(%i1) laplace (delta (t - a) * sin(b*t), t, s);
(%o1) 0

Discussion

  • Robert Dodier

    Robert Dodier - 2024-10-31

    git bisect says that commit [ 4c9f030a ] is the place where the laplace result changed from nonzero to zero. Looking at the commit, I see it changed the way laplace handles its arguments, but I don't see how that leads to the observed result. More investigation needed.

     
  • Barton Willis

    Barton Willis - 2024-10-31

    My theory is that the time-var and parm are swapped somewhere. In the function lapsin, I see (laptimes rest parm time-var), but I think that should be
    (laptimes rest time-var param . Did commit [ 4c9f030a ] involve this code?

    Making the swap, I get

    (%i13)  laplace (delta (t - a) * sin(b*t), t, s);
    Is a positive, negative or zero?
    
    p;
    (%o13) -(((%i*%e^(2*%i*a*b)-%i)*%e^(-(a*s)-%i*a*b))/2)
    (%i14) trigrat(%);
    
    (%o14) sin(a*b)*%e^-(a*s)
    

    And %o14 is correct, I think. Specifically, I swapped:

    (defun lapsin (fun rest trigswitch time-var parm)
      (let ((ab (islinear (cadr fun) time-var)))
        (cond (ab
           (cond (rest
              (compose (laptimes rest parm time-var) ;; Looks suspicious!! 
                   parm
                   trigswitch
                   (car ab)
                   (cdr ab)))
    
     
  • Robert Dodier

    Robert Dodier - 2024-11-02

    For the record, 4c9f030a does make several changes to LAPTIMES. Here is a link to the commit: https://sourceforge.net/p/maxima/code/ci/4c9f030a (I thought SF would automatically generate a link but I guess it didn't.)

     
    • Raymond Toy

      Raymond Toy - 2024-11-06

      Oops. I guess I messed things up a bit here. After looking at [4c9f03], I think the error is in line 355 where I changed (laptimes rest parm) to (laptimes rest parm var). I think it should var should come before parm in the call to laptimes. I think there are few more places where I accidentally swapped var and parm.

      SF does generate links but you need to provide exactly 6 digits. If git annotate is any suggestion, we need to provide probably maybe 10 digits to identify a git commit.

       

      Related

      Commit: [4c9f03]

      • Raymond Toy

        Raymond Toy - 2024-11-06

        Fixing the two places where laptimes had the args in the wrong order now results in:

        (%i1) laplace (delta (t - a) * sin(b*t), t, s);
        Is a positive, negative or zero?
        
        pos;
                                    2 %i a b         - a s - %i a b
                              (%i %e         - %i) %e
        (%o1)               - ─────────────────────────────────────
                                                2
        (%i2) 
        

        Don't know if that's right or not, but at least it's not zero anymore. Wolfram Alpha seems to agree with this if a, b, and s are positive.

         
  • Barton Willis

    Barton Willis - 2024-11-02

    Thanks--that commit didn't change lapsin (where I think the bug is located), but maybe it fixed something triggers the putative bug in lapsin. I'll try to fix this bug.

     
  • Raymond Toy

    Raymond Toy - 2024-11-06
    • labels: --> laplace
    • status: open --> closed
    • assigned_to: Raymond Toy
     
  • Raymond Toy

    Raymond Toy - 2024-11-06

    Fixed in commit [9c52b5]

     

    Related

    Commit: [9c52b5]


Log in to post a comment.

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.
Try Free →