bugGNU Octave - Bugs: bug #45478, Symbolic pkg errors with E

 
 

bug #45478: Symbolic pkg errors with E

Submitter:  Doug Stewart <dastew>
Submitted:  Sun 05 Jul 2015 09:52:06 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  doug stewart Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 07 Jul 2015 07:51:25 PM UTC, comment #4: 

*This can be closed fixed.*

Its fixed in:

https://github.com/cbm755/octsympy/commit/f7b5acbcfed6199e5fb31af3a4349776c53de988

by adding E, E1, others to an existing whitelist.

I also filed this to try for a better fix:

https://github.com/cbm755/octsympy/issues/255

Colin Macdonald <cbm>
Mon 06 Jul 2015 09:47:35 AM UTC, comment #3: 

Ok, read your whole post now and I see you do get an error from E1 (so that is good).  I think I will change E1 to work, the same way I override beta, zeta, gamma and a few others...
(see https://github.com/cbm755/octsympy/issues/23)

Now, about E (and I): these default to "exp(1)" and unit imaginary in SymPy.  I suppose I could make "sym('I')" and "sym('E')" override that...   For E I think that makes sense: its pretty clear what someone wants when she enters "syms E".

But for "I" I'm not so sure...  Maybe I don't want "I = sym('I')" to be different from "I = sym(I)" and "I = sym(i)" and "I = sym('i')" (all of which

Colin Macdonald <cbm>
Mon 06 Jul 2015 08:29:24 AM UTC, comment #2: 

I don't even get past your first line:


octave:11> E1 = sym('E1')
pydebug: error exporting variable:
pydebug: x: <function E1 at 0x7ffba2572140>
pydebug: type: <type 'function'>
E1 = python does not know how to export type <type 'function'>


"E1" is apparently assigned the function expint().

1.  But you don't get that error, which is strange!  Can you try just the "E1 = sym('E1')" line as above and let me know?

2.  It is supposed to be possible (in SymPy) to override these sorts of default symbols, so I'm surprised by this error.  I will investigate.

Colin Macdonald <cbm>
Mon 06 Jul 2015 08:21:19 AM UTC, comment #1: 

Adding maintainer of symbolic package to cc

@Doug Stewart -- you need to place your code inside verbatim clauses. As it were, the asterisks got interpreted as bold. See the verbatim section https://savannah.gnu.org/cookbook/?func=detailitem&item_id=125

The original, non-interpreted text, is on the mailing list https://lists.gnu.org/archive/html/octave-bug-tracker/2015-07/msg00122.html

Carnë Draug <carandraug>
Group Member
Sun 05 Jul 2015 09:52:06 PM UTC, original submission:  

This report is mainly for Colin Macdonald

clear
syms A B C D E E11 E1 ww
e1=2.5*A +1.5*D -2*E== 57.1
e2= 3*A +2.5*D -1*E== 27.6
e3=-4*A -6*D +2*E==-81.2
sf=solve(e1,e2,e3,A,D,E)

1) This first part works correctly.


2) Now try this:
se=solve(e1,A)
# answer is
# se = (sym)
#
#    3⋅D   4⋅ℯ   571
#  - ─── + ─── + ───
#     5     5     25

The answer I see has a small letter e in it, but no small  letter e in the question.


3) Now try the following: I tried changing E to E1
    to try and get away from the small e.
  this output is huge and wrong
e1=2.5*A +1.5*D -2*E1== 57.1
se=solve(e1,A)

4) to trouble shoot the wrong answer I tried:

ww=E1

and found out the E1 is a special function and cannot be used in my program.

The huge output from 3) is just this ascii warning sting treated as ascii values multiplied into the answer to 3)

If i change E to E2 then all is good.
Colin keep up the good work, I am enjoying the symbolic pkg.

Doug Stewart <dastew>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by cbm (Posted a comment)
  • -email is unavailable- added by carandraug (Colin Macdonald - maintainer of symbolic package)
  • -email is unavailable- added by dastew (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-02-10 mtmiller StatusNone Fixed
        Open/ClosedOpen Closed
    2015-07-06 carandraug Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code