Hynek Baran

63 Reputation

8 Badges

17 years, 30 days
Silesian University at Opava
Opava, Czech Republic

MaplePrimes Activity

These are answers submitted by Hynek Baran

U:=(seq(seq((x^n)*(y^m), n=0..2),m=0..2));

select(p -> degree(p)<=2, [U]);

Try evalm(JT)
Which version of Maple are you using? In Maple 12, see ?GraphTheory[HighlightSubgraph]
Yes, you can use Maple command line interface. See ?maple for the details.
Yes, I am using that in some simple situations. Unfortunately, I need 'indexing' by monomials (they represents derivatives). For example, I am dealing with variables as u, u[t], u[x], u[x*t], u[x^2*t] etc. After above discussion I see the indexed representation of such variables is a deadlock. Thus, I decided to represent it some other way.
Aha, I see. So, by my opinion, it is a kind of bug in collect. Anyway, I thing the best trick to avoid it is using an unevaluated function calls instead of an indices collect( u*(u(t)+1), [u, u(t)], distributed); u*u(t)+u because it is most straightforward - there is no need of any auxiliary code (as subs or alias). The reason why I am trying to avoid the auxiliary code is following: In my real expressions to be collected are not just u and u[t] but a lot of variables of such a kind and, moreover, I have not some fixed list of such variables, they differs from one collected expression to the other. Thank all of you for a help!
Thank you very much, I didn't know that. When I read your comment, I thought that I understood the reason what is happening: collect is based on depends function which assumes u[t] is dependent on u. It makes a sense. But it is more complicated: If you change my original example from indexing to unevaluated function calls, collect( u*(u(t)+1), [u, u(t)], distributed); you obtain the correct answer u*u(t)+u So, I am a one step further but still not understanding what collect is precisely doing :) probably I have to read its source code...
All of my considerations are based on the assumption there is nothing assigned to u. Thus, u and u[t] are simply two different names and I see no reason I cannot collect them. See collect help page, there is written: The indeterminates can be names or unevaluated function calls but not sums or products or fractional powers. Unfortunately, I cannot use expand, because there are more names in my collected expressions (I posted the most simplified one so you can easily see where the problem is).
Page 1 of 1