New answers tagged

10

ClearAll[a, b]; a := 1 + 1 b = Sqrt Is this acceptable? foo = # /. Join @@ Cases[#, s_Symbol :> OwnValues[s], ∞, Heads->True] &; foo @ Hold[a + b[c]] Hold[(1 + 1) + Sqrt[c]] Update As OP has noticed I've missed the fact that ReadProtected symbols won't show its OwnValues. We could do something like s_Symbol /; FreeQ[ Attributes[s], ...


1

May be, like this: A = {H2*H3*Ax[x, y, z], H1*H3*Ay[x, y, z], H1*H2*Az[x, y, z]}; Then expr = 1/(H1*H2*H3)*Inactive[Div][A, {x, y, z}] (* Inactive[Div][{H2 H3 Ax[x, y, z], H1 H3 Ay[x, y, z], H1 H2 Az[x, y, z]}, {x, y, z}]/(H1 H2 H3) *) And you may substitute: expr1=expr /. Thread[{H1, H2, H3} -> {1, 1, 1}] (* Inactive[Div][{Ax[x, y, ...



Top 50 recent answers are included