I have a question in FindRoot
of matrix operation equations.
It's my first time use Matrix operation in FindRoot
, i have write a simple example, it shows FindSolve
can solve Matrix equations.
a = {{1, 2}, {3, 4}}; b = {{1, 3}, {2, 2}};
{c} /. FindRoot[
c == a.b - IdentityMatrix[2],
{c, IdentityMatrix[2]}
]
Very fast and simple!
Can I write a new expression in FindRoot
like
a = {{1, 2}, {3, 4}}; b = {{1, 3}, {2, 2}};
d = {{1, 1}, {3, 3}};
{c} /. FindRoot[
var == d.b,
c == a.var - IdentityMatrix[2],
{c, IdentityMatrix[2]}
]
and return c
and var
, well, var
is some function result I want update in FindRoot
and used to the equation I want to solve like c == a.var
. var
isn't need to solve.
Above code have issues. Here is my idea:
a = {{1, 2}, {3, 4}}; b = {{1, 3}, {2, 2}};
d = {{1, 1}, {3, 3}};
{var = d.b, c /. FindRoot[
c == a.var - IdentityMatrix[2],
{c, IdentityMatrix[2]}
]}
Can I achieve same result in a more compact form?Putting expressions (eg. var
) that don't need to solve into FindRoot
will cause errors.
q
is not defined when the definition ofqE0
refers to its parts. For your simple example,Solve
works:c /. Solve[{c == a . b - IdentityMatrix[2], c \[Element] Matrices[{2, 2}]}, c][[1]]
$\endgroup$Additional useful buttons for our M.SE editor
$\endgroup$a.d.b - IdentityMatrix[2]
directively? There no equation in your examples indeed. $\endgroup$