1
$\begingroup$

Is there a way I can make an algebraic substitution in a matrix? I tried using

Simplify[P_rhs _ 51, (c44hat*rhohat)^.5 == zeta]

Where P_rhs_51 is a 4x4 matrix.

2 x 2 example:

P51 = {{(rhohat*c44hat)^.5, -(rhohat*c44hat)^.5}, {rhohat, rhohat}};
$\endgroup$
3
  • 1
    $\begingroup$ You must not use underscores (_) for variable names in Mathematica. They have a built-in meaning (see Blank). You might also be interested in ReplaceAll (and its infix form /.). $\endgroup$ Feb 19 '19 at 10:58
  • 1
    $\begingroup$ Yes, there is such a way. You may get a better answer, if you post your expressions, such that we could copy/paste and play with them. $\endgroup$ Feb 19 '19 at 11:01
  • $\begingroup$ P51 = {{(rhohatc44hat)^.5, -(rhohatc44hat)^.5}, {rhohat, rhohat}} $\endgroup$ Feb 19 '19 at 11:05
0
$\begingroup$

Try this:

P51 = {{(rhohat*c44hat)^.5, -(rhohat*c44hat)^.5}, {rhohat, rhohat}};

P51 /. (c44hat*rhohat)^.5 -> zeta

(*  {{zeta, -zeta}, {rhohat, rhohat}}  *)

Have fun!

$\endgroup$
1
  • $\begingroup$ Thank you. Legend. $\endgroup$ Feb 19 '19 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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