> expr3 = collect( expr2, M**(n+1), exact=True )

This doesn't work because it is M(2, 1)**(n+1) that is present in expr2,
and not M**(n+1).  So you must use:

expr3 = collect( expr2, M(2, 1)**(n+1), exact=True)

Øyvind

> # end code
> 
> Here is the output of the print statement:
> 
> A*M(1, 1)**n - C*M(1, 2)**n + B*M(2, 1)**(1 + n) - D*M(1, 1)**(1 + n) - 
> E*M(2, 1)**(1 + n)
> 
> In the above code, collect() does not seem to group the B*M(2, 1)**(1 + 
> n) and E*M(2, 1)**(1 + n) terms.
> 
> Once again, thank you very much for continuing to point me in the right 
> direction.
> 
> Nicholas
> 
> 
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to