Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1532 radcan gives incorrect result.

closed
nobody
5
2009-03-18
2008-11-26
Anonymous
No

-------------------------------------------------------------
Maxima version: 5.16.3
Maxima build date: 23:54 11/19/2008
host type: x86_64-pc-linux-gnu
lisp-implementation-type: SBCL
lisp-implementation-version: 1.0.19-gentoo
-------------------------------------------------------------

The expression before radcan is not eqvivalent to the expression after.

Steps to reproduce:
(I'm trying to plot the amplitude characteristic of a signal sin(500pi*t) 0<t<1/5 , 0 otherwise, by using the absolute value of the laplace transform on the im axis).

(%i54) s1: integrate(sin(400*%pi*t)*exp(-s*t), t, 0, 1/5);
(%o54) (400*%pi)/(s^2+160000*%pi^2)-(400*%pi*%e^(-s/5))/(s^2+160000*%pi^2)

(%i55) plot2d([radcan(trigreduce(ratsimp(abs(ev(s1,s=%i*w)))))], [w,-2000,2000], [plot_format, gnuplot])$
Warning: empty y range [0:0], adjusting to [-1:1]

(%i56) plot2d([trigreduce(ratsimp(abs(ev(s1,s=%i*w))))], [w,-2000,2000], [plot_format, gnuplot])$

contact at: lereg at zero hyphen kelvin dot org

Discussion

  • Raymond Toy
    Raymond Toy
    2008-11-26

    Read the documentation on radcan and radexpand. In particular, radcan will convert sqrt(x^2-2*x+1) to x - 1, and sqrt(1-x) to %i*sqrt(x-1).

    This is what is happening to the second plot. It might be a bug that plot2d doesn't plot anything, though.

     
  • Raymond Toy
    Raymond Toy
    2009-01-25

    • status: open --> pending
     
  • Raymond Toy
    Raymond Toy
    2009-01-25

    Marking as pending/invalid. radcan is doing what it is documented to do.

    Perhaps plot2d should work better, but that's a different bug.

     
    • status: pending --> closed
     
  • This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).