symbolic icon indicating copy to clipboard operation
symbolic copied to clipboard

Attempt to do matrix series summation

Open bbbear2002 opened this issue 10 years ago • 5 comments

Respected Professor Macdonald, thank you for bringing us OctSymPy, which is very great! Here are some issues it is wished to file:

A=[1,2,3;2,1,4;3,5,1] syms n B=symsum(A^n/sym('n!'),n,0,inf)

Matrix series summation it is. The Octave responds as:

error: mpower: not implemented; sympy says: Only integer and rational values are supported error: called from: error: /Users/bbbear2002/octave/octsympy-0.1.0/@sym/mpower.m at line 62, column 7 error: evaluating argument list element number 1

I am on a MacBook Pro Retina late 2012, running Mavericks with Octave 3.8.0.

bbbear2002 avatar Sep 24 '14 11:09 bbbear2002

Thanks!

I also filed issue #100 for the component-by-component case. See also upstream https://github.com/sympy/sympy/pull/7563.

cbm755 avatar Sep 24 '14 20:09 cbm755

See also #101.

cbm755 avatar Sep 24 '14 20:09 cbm755

Your invaluable effort on OctSymPy is gratefully appreciated, thank you!

bbbear2002 avatar Sep 25 '14 11:09 bbbear2002

Hi again, i think this is solved, actually mpower supports matrix, actually i can run the test code, but you know, it takes his time.

latot avatar Sep 17 '16 23:09 latot

Even before the symsum, it would be nice here if we go something like:

>> q = python_cmd('return sp.MatPow(_ins[0],_ins[1])', A, n)
q = (sym 3×3 matrix expression)

             n
  ⎛⎡1  2  3⎤⎞ 
  ⎜⎢       ⎥⎟ 
  ⎜⎢2  1  4⎥⎟ 
  ⎜⎢       ⎥⎟ 
  ⎝⎣3  5  1⎦⎠ 

>> B = q / factorial(n)
B = (sym 3×3 matrix expression)

                n
     ⎛⎡1  2  3⎤⎞ 
  1  ⎜⎢       ⎥⎟ 
  ──⋅⎜⎢2  1  4⎥⎟ 
  n! ⎜⎢       ⎥⎟ 
     ⎝⎣3  5  1⎦⎠ 

Then there is some hope that symsum would give expm(A) (but I don't think it does at the moment).

Our mpower does not use MatPow explicitly. I wonder if something like doit(MatPow(A, n)) would be better than **?

cbm755 avatar Jan 26 '17 06:01 cbm755