1
$\begingroup$

I have two vectors v,w which have a rather simple linear transformation A.v=w. My goal is to obtain A.

Take the following example v={foo[a],foo[b]} and w={foo[a]+foo[b],foo[a]-foo[b]}. Now my attempt to find a linear transformation is

Solve[Table[A[i, j], {i, 1, 2}, {j, 1, 2}].v == w,Flatten@Table[A[i, j], {i, 1, 2}, {j, 1, 2}]]

i.e. I multiply v with the 2x2 matrix A in the form of Table[A[i, j], {i, 1, 2}, {j, 1, 2} from the left hand side and solve the equality with w for all entries A[i_,j_].

The result I would hope for, is

{{A[1,1] -> 1, A[1,1] -> 1, A[1,1] -> 1, A[1,1] -> -1}}

Instead, I get

{{A[1, 2] -> -((A[1, 1] foo[a])/foo[b]) - (-foo[a] - foo[b])/foo[b], A[2, 2] -> -((A[2, 1] foo[a])/foo[b]) - (-foo[a] + foo[b])/foo[b]}}

which of course is a correct result, but I want my expressions A[i_,j_] to be independent of foo[x_]. My question therefore is:

How do I tell Solve to make the solutions independent of foo[x_]?

I have already tried to define a domain dom in Solve[expr,vars,dom], but e.g. Complexes does not work, even though

In[253]:= MemberQ[Complexes, foo[a]]
Out[253]= False

I expect there to be an easier way to find linear transformations in general, but I would like to have this particular issue solved nevertheless.

$\endgroup$

1 Answer 1

1
$\begingroup$

In your symbolic case, try

D[w, {v, 1}]

{{1, 1}, {1, -1}}

$\endgroup$
4
  • $\begingroup$ Thank you very much! This indeed also works for my more complicated problem. I wouldn't have considered D[] for this. $\endgroup$
    – Fred
    Dec 19, 2018 at 21:26
  • $\begingroup$ Oh, I thought I had to wait a little longer. I planned to do it tomorrow. It's done now. $\endgroup$
    – Fred
    Dec 19, 2018 at 22:37
  • $\begingroup$ No problem. You can do that whenever you like. It was just a little reminder. $\endgroup$ Dec 19, 2018 at 22:39
  • $\begingroup$ It was only because I remembered stackexchange not allowing me to do it this early, but it worked. So thanks again and good bye :) $\endgroup$
    – Fred
    Dec 19, 2018 at 22:40

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.