0
$\begingroup$

I solved a set of equation and use reduce on the set of solutions. Changing the equal sign to arrows I get some set of rules but some of the entries are inequalities. E.g.

{\[ScriptA][2, 1] != 0, 
 0 -> \[ScriptA][2, 2] - Sqrt[\[ScriptA][2, 2]^2], \[ScriptA][4, 
   4] -> 1, \[ScriptA][4, 3] -> 
  0, \[ScriptA][3, 3] -> -1, \[ScriptA][1, 2] -> (
  1 - \[ScriptA][2, 2]^2)/\[ScriptA][2, 1], \[ScriptA][1, 
   1] -> -\[ScriptA][2, 2]}

How can I remove in a systematic way the first kind of entries ($ \cal a[2,1]\neq 0)$ for my rules? I tried Deletecase with several patterns but that does not seem to work.

Thanks!

$\endgroup$
2
  • $\begingroup$ Select[{...}, #[[0]] == Rule &]? Cases[{...}, _Rule]? $\endgroup$ Commented Aug 10, 2019 at 11:39
  • $\begingroup$ FullForm of a != b is Unequal[a,b], so you should use DeleteCases with this head: DeleteCases[{<your set of rules>},_Unequal]. $\endgroup$
    – Alx
    Commented Aug 10, 2019 at 12:42

1 Answer 1

0
$\begingroup$
DeleteCases[{\[ScriptA][2, 1] != 0, 
0 -> \[ScriptA][2, 2] - Sqrt[\[ScriptA][2, 2]^2], \[ScriptA][4,4] -> 1,
\[ScriptA][4,3] -> 0, \[ScriptA][3, 3] -> -1,
\[ScriptA][1, 2] -> (1 - \[ScriptA][2, 2]^2)/\[ScriptA][2, 1],
\[ScriptA][1, 1] -> -\[ScriptA][2, 2]},_Unequal]

gives

{0 -> \[ScriptA][2, 2] - Sqrt[\[ScriptA][2, 2]^2], \[ScriptA][4,4] -> 1,
\[ScriptA][4,3] -> 0, \[ScriptA][3, 3] -> -1,
\[ScriptA][1, 2] -> (1 - \[ScriptA][2, 2]^2)/\[ScriptA][2, 1],
\[ScriptA][1, 1] -> -\[ScriptA][2, 2]}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.