2
$\begingroup$

For example, I have a matrix A given by some parameters (a,b,c,d) and two variables (x,y), $$ A=\begin{pmatrix}a&a+bx\\(c-d)y&a(c+d)\end{pmatrix} $$ The condition is that A is a matrix independent of (x,y). Therefore, we find b=0 and c=d.

How should I do it in mathematica? Now I have a complicated 64-by-64 matrix with 32 parameters and 3 variables. So I want a general method to solve this problem.

$\endgroup$
4
  • $\begingroup$ Are the matrix elements simple polynomial functions of $x$ and $y$, or is it more generally complicated than that? $\endgroup$
    – march
    Commented Oct 19, 2023 at 20:08
  • $\begingroup$ If the matrix elements are simple enough, it's possible that something like SolveAlways[ Flatten[A] == Flatten[A /. {x -> 0, y -> 0}] // Thread, {x, y}] would work, although I don't know how fast that will be on a 64 by 64 matrix. $\endgroup$
    – march
    Commented Oct 19, 2023 at 20:11
  • $\begingroup$ They are rational expressions of x and y. If we set all variables to 0, some denominators might be 0 too. $\endgroup$ Commented Oct 19, 2023 at 20:18
  • $\begingroup$ Can you give a more complicated example, then, one that shows the difficulty in the issue here? Edit your post to include the example, properly formatted in code blocks with proper Mathematica notation. $\endgroup$
    – march
    Commented Oct 19, 2023 at 20:19

1 Answer 1

4
$\begingroup$

Set the derivatives of $A$ with respect to $x$ and $y$ to zero for all values of $x$ and $y$:

A = {{a, a + b x}, {(c - d) y, a (c + d)}};

SolveAlways[Thread[Flatten[D[A, {{x, y}}]] == 0], {x, y}]
(*    {{b -> 0, c -> d}}    *)
$\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.