this may be a stupid question, but I can't find my way around it. (and I have searched the forum for a similar issue, but with no luck...)
I have a sum (let's call it mysum) of many terms. Some of them contains the expressions Sin[w t] and Cos[w t] (for context, here t is time). The sum uses Units. Since I'm only interested in the non time-varying part of the sum, I would like to drop all the terms involving the aforementioned expression. I haven't found an elegant way to do this. These are the strategies that got me closer:
mysum/.{Sin[w t] -> 0, Cos[w t] -> 0}
Unfortunately, the terms containing zero are not dropped. I think it has to do with units (for example they contain terms like (0 epsilonzero), that is clearly zero, but Mathematica does not drop for some reason.
Collect[mysum,{Sin[w t],Cos[w t]}]
%[[{1,3}]]
Where {1,3} are just used as examples here. In fact, this is the problem. The above works, but the position of the terms involving the unwanted expressions depends on the specific form of my original form, so I have to select indexes on a case-by-case basis.
mysum/.{Sin[w t] -> removeme, Cos[w t] -> removeme}
Collect[%,removeme]
%[[;;-2]]
This works, but only in the case in which non of the unwanted expressions exist in the original sum. Plus, it doesn't really look elegant...
Any suggestions?
Thanks
Giacomo