New Reply

Composition of Vector Functions in Mathematica

 
Share Thread Thread Tools
Jul26-12, 04:35 PM   #1
 

Composition of Vector Functions in Mathematica


I want to define something like:
[tex]A\left(\begin{matrix} x \\ y\end{matrix}\right) = \left(\begin{matrix} 1 & -1 \\ -1 & 1 \end{matrix}\right)\left(\begin{matrix} x \\ y\end{matrix}\right)[/tex]
[tex]B\left(\begin{matrix} x \\ y\end{matrix}\right) = \left(\begin{matrix} 0 & 1 \\ 2 & -1 \end{matrix}\right)\left(\begin{matrix} x \\ y\end{matrix}\right)+\left(\begin{matrix} 1 \\ 1\end{matrix}\right)[/tex]
And then I want to be able to evaluate compositions such as [itex]A \circ B \circ A\left(\begin{matrix} x \\ y\end{matrix}\right)[/itex] quickly and easily.

Currently I'm using this syntax:
A[x_,y_] = {{1,-1},{-1,1}}.{{x},{y}}

However, when I define such a function, the output is a column vector, not a list, and I can't input a column vector into the next function. How do I do ths?
 
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> Front-row seats to climate change
>> Attacking MRSA with metals from antibacterial clays
>> New formula invented for microscope viewing, substitutes for federally controlled drug
Jul26-12, 05:05 PM   #2
 
If I understand your syntax correctly, you have too many brackets in the column vector definition. A column vector should be just a simple list, and a matrix should be a nested list. Instead of:
A[x_,y_] = {{1,-1},{-1,1}}.{{x},{y}}

Just define:

A = {{1,-1},{-1,1}}
B = {{0,1},{2,-1}}
X = {x,y}

Then you can simply compose them with the dot product, such as:

(A.(B.A)).X
 
Jul26-12, 06:00 PM   #3
 
I can't do that, because B has a translation vector
 
Jul26-12, 07:33 PM   #4
 

Composition of Vector Functions in Mathematica


Is this what you are looking for?

In[1]:= A[{x_,y_}]:={{1,-1},{-1,1}}.{x,y};
B[{x_,y_}]:={{0,1},{2,-1}}.{x,y}+{1,1};
Composition[A,B,A][{x,y}]

Out[3]= {-2 x-2 (x-y)+2 y,2 x+2 (x-y)-2 y}
 
Jul26-12, 07:46 PM   #5
 
I'll have to try it out when i get back tonight, but that looks very promising, thanks :)
 
New Reply
Thread Tools


Similar Threads for: Composition of Vector Functions in Mathematica
Thread Forum Replies
Composition of Functions help please! Precalculus Mathematics Homework 4
Composition of Functions Calculus & Beyond Homework 4
Composition of (vector) functions Calculus & Beyond Homework 3
Composition Functions Mathematica Math & Science Software 4
Composition of functions Calculus & Beyond Homework 3