Solve a linear system m.x=b with WL-Function Minimize:
In[1]:= m = {{10, 7, 5}, {9, 7, 4}, {1, 4, 10}};
b = {3, 5, 3};
Minimize[{Norm[\!\(\*
TagBox["m",
Function[BoxForm`e$,
MatrixForm[BoxForm`e$]]]\) . {x1, x2, x3} - b]}, {x1, x2, x3}]
Out[3]= {0, {x1 -> -(109/83), x2 -> 232/83, x3 -> -(57/83)}}
Works as expected.
But what does the error message mean when I represent the variable x as a vector? How can I formulate equations with vector solution variables?
In[4]:= Minimize[{Norm[\!\(\*
TagBox["m",
Function[BoxForm`e$,
MatrixForm[BoxForm`e$]]]\) . x - b]},
x \[Element] Vectors[3, Rationals]]
During evaluation of In[4]:= Minimize::objfs: The objective function {Sqrt[Abs[-5+10 Indexed[<<2>>]+7 Indexed[<<2>>]+5 Indexed[<<2>>]]^2+2 Abs[-3+Times[<<2>>]+Times[<<2>>]+Times[<<2>>]]^2],Sqrt[Abs[-5+9 Indexed[<<2>>]+7 Indexed[<<2>>]+4 Indexed[<<2>>]]^2+2 Abs[-3+Times[<<2>>]+Times[<<2>>]+Times[<<2>>]]^2],Sqrt[Abs[-5+Subscript[x, <<1>>]+4 Indexed[<<2>>]+10 Indexed[<<2>>]]^2+2 Abs[-3+Indexed[<<2>>]+Times[<<2>>]+Times[<<2>>]]^2]} should be scalar-valued.
Out[4]= Minimize[{Sqrt[
Abs[-5 + {{10, 7, 5}, {9, 7, 4}, {1, 4, 10}} . x]^2 +
2 Abs[-3 + {{10, 7, 5}, {9, 7, 4}, {1, 4, 10}} . x]^2]},
x \[Element] Vectors[3, Rationals]]
Attachments: