I am very new to Mathematica. I am attempting to solve a system of equations with 4 unknown matrices (B, C, D and S). B, D and S are symmetric. This is what I have:
A = {{ε, 0, 0}, {0, ε, 0}, {0,
0, -2 ε}}
B1 = Array[b, {3, 3}];
C1 = Array[c, {3, 3}];
D1 = Array[d, {3, 3}];
S1 = Array[s, {3, 3}];
Z = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
f1[D2_] := n γ + σ^2/2 Tr[D2];
f2[C2_, D2_] := -C2 - Transpose[C2] + 2 γ D2 - Transpose[A].D2 - D2.A + σ^2 D2.D2;
f3[B2_, C2_, D2_, S2_] := -Transpose[B2] - γ Transpose[A].D2 + γ C2 - C2.A + S2.D2 + σ^2 C2.D2;
f4[C2_, S2_] := -γ C2.A + γ Transpose[A].Transpose[C2] + C2.S2 + S2.Transpose[C2] + σ^2 Transpose[C2].C2;
Solve[{f1[D1]\[Equal]0,f2[C1,D1]\[Equal]Z,f3[B1,C1,D1,S1]\[Equal]Z,\
f4[C1,S1]\[Equal]Z},{Flatten[B1],Flatten[C1],Flatten[D1],Flatten[S1]}]\
But it gives me the error:
Solve::ivar: {b[1,1],b[1,2],b[1,3],b[2,1],b[2,2],b[2,3],b[3,1],b[3,2],b[3,3]} is not a valid variable.
Is my code just plain wrong, or is it that I am being unrealistic by trying to solve this symbolically? Any feedback/suggestions are much appreciated.
Thanks a lot in advance!
Solve[(* equations *), Join[Flatten[B1], Flatten[C1], Flatten[D1], Flatten[S1]]]
? $\endgroup$Flatten[{B1, C1, D1, S1}]
$\endgroup$Flatten[{B1, C1, D1, S1}]
$\endgroup$nmin = NMinimize[{b[1, 2], Flatten[{f1[D1] == 0, f2[C1, D1] == Z, f3[B1, C1, D1, S1] == Z, f4[C1, S1] == Z}]} /. {\[CurlyEpsilon] -> 1, \[Gamma] -> 2, \[Sigma] -> 3, n -> 4}, Flatten[{B1, C1, D1, S1}], WorkingPrecision -> 30]
and variations with NMaximize thereof. I think, neither Solve nor NSolve can do that. $\endgroup$