# Removing zeros from a list of equations

I am setting up a matrix system of differential equations that need to be solved. Some equations are redundant, and I have removed them using UpperTriangularize[]:

eqs = {{a[t]==0, b[t]==t},{b[t]==t,d[t]==t}};
eqs = UpperTriangularize[eqs];
(* {{a[t]==t, b[t]==t},{0,d[t]==t}} *)


I need to come up with a clever way to remove the zero elements from this list of lists (flattening it is an option). I have tried using DeleteCases[eqs,0,Inifity] and a solution based on Select[], but neither seemed to give the desired result.

• How about Union@Flatten@eqs? Also, how do you generate eqs? (Or in other words, why do you have the duplicate equations anyway?) – sebhofer Oct 6 '17 at 8:18
• DeleteCases[Flatten@eqs,0]? – mmeent Oct 6 '17 at 8:26
• Ahh, I should point out, that I meant not to do use the UpperTriangularize... – sebhofer Oct 6 '17 at 8:31
• @Julius I don't understand DeleteCases[Flatten@eqs,0] does not touch equations of the form a[t]==0. It will only touch entries in the flatten list that are an exact match to the pattern 0. Alternatively, DeleteCases[eqs, 0, {2}] gives the same output as your Table expression. – mmeent Oct 6 '17 at 8:53
• By specifying Infinity as the level specification you are telling DeleteCases to delete expressions matching 0 at any level of eqn. This ignore heads so it will simply delete any 0 anywhere in the eqn – mmeent Oct 6 '17 at 9:03