bugGNU Octave - Bugs: bug #56066, [octave forge] (symbolic)...

 
 

bug #56066: [octave forge] (symbolic) integration of heaviside

Submitter:  Z. M. <zmarantz>
Submitted:  Wed 03 Apr 2019 05:07:12 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Confirmed Assigned to:  None
Originator Name:  zmarantz Open/Closed:  * Open
Release:  * 4.4.0 Operating System:  * Mac OS
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 03 Apr 2019 05:26:13 PM UTC, comment #1: 

I can confirm:

>> syms t
>> f = heaviside(t - 1)
f = (sym) Heaviside(t - 1)
>> F = int(f, t)
F = (sym)

  ⎧           0              for │t│ < 1
  ⎪
  ⎨╭─╮0, 2 ⎛2, 1       │  ⎞
  ⎪│╶┐     ⎜           │ t⎟   otherwise
  ⎩╰─╯2, 2 ⎝      1, 0 │  ⎠


that expression does seem to be technically correct for t >= -1:


>> double(subs(F, t, -1))
ans =          0
>> double(subs(F, t, sym(1)/2))
ans =          0
>> double(subs(F, t, 2))
ans =          1
>> double(subs(F, t, 3))
ans =          2
>> double(subs(F, t, 10))
ans =          9


But it seems to be wrong for t <= -1, where it should be zero.

There are various upstream SymPy bugs about heaviside and integrals:
Does this look like https://github.com/sympy/sympy/issues/12632?

A workaround is probably

>> g = rewrite(f, 'Piecewise')
g = (sym)

  ⎧     0        for t - 1 < 0
  ⎪
  ⎨Heaviside(0)  for t - 1 = 0
  ⎪
  ⎩     1        for t - 1 > 0

>> int(g, t)
ans = (sym)

  ⎧  0    for t < 1
  ⎨
  ⎩t - 1  otherwise


Colin Macdonald <cbm>
Wed 03 Apr 2019 05:07:12 PM UTC, original submission:  

Hi Maintainer,

I am running Octave 4.4.0 on MAC OSX.

I'm working to integrate the heaviside function (as shown in the screenshot attached), but it doesn't appear to want to work when the argument is shifted.

Then again, maybe it is doing it correctly, but I do not understand what the output means.

Any assistance would be greatly appreciated.

Thank you,
Z.M.

Z. M. <zmarantz>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by cbm (Posted a comment)
  • -email is unavailable- added by zmarantz (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-04-03 mtmiller CategoryLibraries Octave Package
        StatusNone Confirmed
        SummarySymbolic integration of heaviside. [octave forge] (symbolic) integration of heaviside
    2019-04-03 zmarantz Attached File- Added Screen Shot 2019-04-03 at 12.50.18 PM.png, #46713

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code