0
$\begingroup$

If I have the vector z={y1+2*y2+y3,y1+y2,y1+y2+y3} , and y={y1,y2,y3} and m=Array[a,{3,3}]. How to solve m.y=z to get that m={{1,2,1},{1,1,0},{1,1,1}}

$\endgroup$
3
  • $\begingroup$ You give z as both a vector and an array. They don't equate to each other. $\endgroup$
    – Bob Hanlon
    Jul 18 at 17:03
  • 2
    $\begingroup$ m = D[z, {y}] gives {{1, 2, 1}, {1, 1, 0}, {1, 1, 1}} and satisfies m . y == z. $\endgroup$
    – Roman
    Jul 18 at 17:04
  • $\begingroup$ I edited it and thank your answer helped me. $\endgroup$
    – Ray
    Jul 18 at 17:17
2
$\begingroup$

I think you mean this

m = {{1, 2, 1}, {1, 1, 0}, {1, 1, 1}}
aa = Array[a, {3, 3}]
y = {y1, y2, y3}
z = {y1 + 2*y2 + y3, y1 + y2, y1 + y2 + y3}

sa = First@SolveAlways[Thread[aa.y == z], y]

aa /. sa // MatrixForm

m == aa /. sa

(*   True   *)    
$\endgroup$
1
$\begingroup$
z = {y1 + 2*y2 + y3, y1 + y2, y1 + y2 + y3};
y = {y1, y2, y3};
m = Array[a, {3, 3}];
eq = ForAll[y // Evaluate, m . y == z];
sol = Resolve[eq]
Simplify[m, sol]

{{1, 2, 1}, {1, 1, 0}, {1, 1, 1}}

$\endgroup$

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.