[SciPy-User] bug in signal.lsim2

josef.pktd@gmai... josef.pktd@gmai...
Thu Jan 28 19:03:17 CST 2010


On Thu, Jan 28, 2010 at 6:00 PM, Ryan Krauss <ryanlists@gmail.com> wrote:
> Hmmm.  Thanks.  That solves the immediate problem.  I am letting my
> students choose between Matlab and Python for projects in my course.
> This one my erode their confidence in Python/Scipy a bit.

It's always good to have a rough idea about whether the results are
correct and not trust the computer too much, whether it's matlab or
scipy. But if some of your students are willing to submit bug reports
or tests, then the next generation of students can be more confident
that it's the bugs in their own program that might be causing problems
and not the code in scipy.

Josef


>
> On Thu, Jan 28, 2010 at 3:05 PM,  <josef.pktd@gmail.com> wrote:
>> On Thu, Jan 28, 2010 at 3:39 PM, Ryan Krauss <ryanlists@gmail.com> wrote:
>>> I believe I have discovered a bug in signal.lsim2.  I believe the
>>> short attached script illustrates the problem.  I was trying to
>>> predict the response of a transfer function with a pure integrator:
>>>
>>>              g
>>> G = -------------
>>>          s(s+p)
>>>
>>> to a finite width pulse.  lsim2 seems to handle the step response just
>>> fine, but says that the pulse response is exactly 0.0 for the entire
>>> time of the simulation.  Obviously, this isn't the right answer.
>>>
>>> I am running scipy 0.7.0 and numpy 1.2.1 on Ubuntu 9.04, but I also
>>> have the same problem on Windows running 0.7.1 and 1.4.0.
>>>
>>> Thanks,
>>>
>>> Ryan
>>
>> When I add a small noise
>>
>> u2 = zeros(N) + 1e-14
>>
>> or for
>> u2[:50] = amp
>>
>> or for
>> u2[50:200] = amp
>>
>> it seems to work.
>>
>> This might be a tricky bug.
>>
>> Josef
>>
>>
>>>
>>> _______________________________________________
>>> SciPy-User mailing list
>>> SciPy-User@scipy.org
>>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>>
>>>
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User@scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>


More information about the SciPy-User mailing list