bugGNU Octave - Bugs: bug #45423, symbolic package fails to...

 
 

bug #45423: symbolic package fails to construct matrices

Submitted by:  None
Submitted on:  Sat 27 Jun 2015 10:52:04 AM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: DuplicateAssigned to: None
Originator Name: Rock StormOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.8.2
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sat 04 Jul 2015 01:27:42 PM UTC, comment #9:

Marked as duplicate of bug #42152

Carnë Draug <carandraug>
Project Member
Sat 04 Jul 2015 09:48:16 AM UTC, comment #8:

Honestly don't see how to mark a dupe on this bug tracker... or maybe I just don't have permission?

Colin Macdonald <cbm>
Sat 04 Jul 2015 09:46:36 AM UTC, comment #7:

Yes, I think this is a core octave bug:

https://savannah.gnu.org/bugs/index.php?42152

Also noted here, with workarounds:
https://github.com/cbm755/octsympy/issues/8

Colin Macdonald <cbm>
Sat 04 Jul 2015 12:03:58 AM UTC, comment #6:

Adding maintainer of the symbolic package to cc

Carnë Draug <carandraug>
Project Member
Sun 28 Jun 2015 11:27:29 AM UTC, comment #5:

I believe the problem is related to how octave and sympy communicate. According to sympy's documentation http://docs.sympy.org/latest/tutorial/matrices.html, sympy will not recognize octave's matrix notation. It requires rows to have their own brackets.

If this workaround is used from the very beginning it works just fine:

So for now, as long as matrices are typed in following sympy's notation right from the start, it works.

Anonymous
Sat 27 Jun 2015 06:10:11 PM UTC, comment #4:

this fails

A = [ a, 2; 6, 4 ]

so the first item in each row must be a sym

Doug Stewart <dastew>
Sat 27 Jun 2015 05:09:36 PM UTC, comment #3:

I did some more digging:

syms a
this works
A = sym([ a, 2; a, 4 ])
and this works
A = [ a, 2; a, 4 ]
but this does not work
A = [ 1, 2; a, 4 ]
A = sym([ 1, 2; a, 4 ])

so if the first item in the matrix is a sym then it works

Doug Stewart <dastew>
Sat 27 Jun 2015 03:08:34 PM UTC, comment #2:

one more workaround

cmd={
"a= symbols('a')" ;
"B=Matrix([[1, -1], [3, a], [0, 2]]);return ( B,)"
};
dd=python_cmd(cmd)

Doug Stewart <dastew>
Sat 27 Jun 2015 01:53:55 PM UTC, comment #1:

this might be a workaround

syms a b c d f m n p ;
n =sym( [ a; b; c; 4 ] )
d=reshape(n,2,2)

p = sym([sym(0); 1; sym(2); 3])
m=reshape(p, 2, 2)
f=inv(d)
m*f

So we can make a col. vec. and then reshape it.

Doug Stewart <dastew>
Sat 27 Jun 2015 10:52:04 AM UTC, original submission:

I am using octave forge package "symbolic", and it basically fails when constructing multiple-rows matrices that combine real numbers and symbolic variables.

Simple example of the error:

This code produces the following error:

Without any knowledge of the internals of this package this error seems somehow related to this other filed bug #42152

The workaround suggested at https://github.com/cbm755/octsympy/issues/8 also produces an error:

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Updated the item)
  • -unavailable- added by cbm (Posted a comment)
  • -unavailable- added by carandraug (Colin Macdonald - maintainer of symbolic package)
  • -unavailable- added by dastew (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 22 Dec 2015 04:13:54 PM UTCmtmillerOpen/ClosedOpen=>Closed
    Sat 04 Jul 2015 01:27:42 PM UTCcarandraugStatusNone=>Duplicate
      Dependencies-=>Depends on bugs #42152
    Sat 04 Jul 2015 12:03:58 AM UTCcarandraugCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1