Composition of Vector Functions in Mathematica

In summary, the conversation discussed defining functions for matrices and column vectors, as well as evaluating compositions of these functions. The solution involved simplifying the syntax and using dot products to compose the functions.
  • #1
Identity
152
0
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?
 
Physics news on Phys.org
  • #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
 
  • #3
I can't do that, because B has a translation vector
 
  • #4
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}
 
  • #5
I'll have to try it out when i get back tonight, but that looks very promising, thanks :)
 

FAQ: Composition of Vector Functions in Mathematica

What is the purpose of composing vector functions in Mathematica?

The purpose of composing vector functions in Mathematica is to combine multiple vector functions into a single function, allowing for more efficient and streamlined calculations.

How do you compose vector functions in Mathematica?

To compose vector functions in Mathematica, you can use the Composition function, denoted by the @ symbol. For example, if you have two vector functions f[x_] and g[x_], you can compose them by typing f@g[x].

Can you compose more than two vector functions in Mathematica?

Yes, you can compose as many vector functions as you need in Mathematica. The Composition function allows for an arbitrary number of functions to be composed together.

What are the benefits of composing vector functions in Mathematica?

Composing vector functions in Mathematica can lead to more efficient and concise code, as well as allowing for easier manipulation and analysis of the composed function. It also allows for easier visualization and graphing of the composed function.

Are there any limitations to composing vector functions in Mathematica?

One limitation of composing vector functions in Mathematica is that the functions being composed must have compatible domains and ranges. In other words, the output of one function must match the input of the next function in the composition. Additionally, the functions must be defined for all values in the composition.

Similar threads

Replies
3
Views
1K
Replies
4
Views
2K
Replies
3
Views
2K
Replies
10
Views
3K
Replies
4
Views
2K
Replies
1
Views
1K
Replies
7
Views
2K
Replies
34
Views
2K
Back
Top