How can I convert expression a1*u1+a2*u2+a3*u3 to the vector form of dot product A.U, where A={a1,a2,a3} and U={u1,u2,u3}?
|
|
||||
|
|
|
If you define :
then you can get
|
|||
|
|
|
I think you may try
where we get
This also works for system of equations.
See the important matrix
$$\left( \begin{array}{ccc} 1 & -1 & -1 \\ 1 & 2 & 1 \\ \end{array} \right)$$ |
||||
|
|
|
I'm not sure if this is the correct way to interpret your question, but here goes. You can separate the components of
The dot product can be formed:
|
|||
|
|
|
Another approach (similar to image_doctor's) uses replacement rules rather than Apply. Observe that the internal representation is
If we were to change the "Times" to "List" and change "Plus" to "List" then we'd be almost there:
All we need do is pick out the a's and u's separately. So we could define:
Then Dot[a, u] gives the original product. |
|||
|
|


