Lab
Linear Transformations
Shoutout Schlafen.
The following is a demo to
elucidate how linear transformations work.
Pink text highlights information that is largely irrelevant and outside the
“syllabus”.
What does a linear transformation actually do?
Matrices are often introduced as rectangular arrays of numbers, which is perhaps one of the least helpful ways to understand them geometrically.
A matrix can instead be viewed as describing a transformation of space. In fact, when one graduates from a first course in linear algebra to an advanced (or abstract) linear algebra course, we learn about so-called linear transformations in the more abstract sense and on more abstract spaces (more on this later).
The important fact is that a linear transformation is completely determined by what it does to a basis. If
then linearity forces
Linearity of a function, call it , refers to it satisfying:
where are vectors in the space, and is in the ground field (usually or similar) .
Since all vector spaces have a basis, except for infinite dimensional spaces when you disallow the axiom of choice , which let’s you write elements of the space as a linear combination of basis elements
a linear transformation can be described entirely by what it does to the basis elements.
The tool below lets you look at the same idea from three slightly different perspectives.
We are working with the familiar vector space , as it is easy to visualize, though the idea generalizes to arbitrary vector spaces.
The demo let’s you do a couple of things:
- Define what the basis vectors are (you will be told if the basis you define is not valid),
- see what the integer multiples of the basis vector are (the grid),
- define some matrix,
- place some vectors,
- see how the transformations move those vectors.
Linear map
T(e₁) = (1, 0) · T(e₂) = (1, 1)
det(A) = 1
Basis
Valid basis · det = 1
Placed vectors keep their coefficients relative to this basis, so changing the basis moves them in real time.
Transformation
Selected vector
[v]₍B₎ = (3, 2)
v = 3b₁ + 2b₂
Standard coordinates:
v = (3, 2)
What is a basis?
In the demo I let you define a different basis from . Now, perhaps it is intuitive from the demo and preceding exposition what this is supposed to mean, perhaps not.
Definition: Basis of a vector space.
Let be a vector space over a field (feel free to search up the rigorous definition). A basis of is a linearly independent (feel free to search up the definition here also, though I think this one is included in a first course) set of vectors such that
meaning every vector can be written as a linear combination
Note: The basis is finite here, but this can generalize to infinite dimensions.
Now what does this mean? For any linear
transformation between spaces ,
have
Since , and has the property above, we have
so we can determine where goes by seeing where the basis elements go!
Why is this cool/important?
So far, changing basis may look like a somewhat unnecessary exercise in describing the same space in different ways.
It’s useful because some bases make problems easier.
Observe:
Suppose that a linear transformation has a basis consisting of eigenvectors
so that
Now take an arbitrary vector
By linearity,
Notice what happened.
Instead of the transformation mixing all the coordinates together, each basis direction simply gets multiplied by a number.
In this basis, the transformation is represented by a diagonal matrix
Very cool!
An example in PDEs
This becomes especially useful in engineering because many differential equations involve linear differential operators.
For example, differentiation is linear:
and
Likewise, the second derivative operator
is linear.
So instead of thinking about a matrix acting on vectors in , we can think about a differential operator acting on a vector space whose “vectors” are functions.
For arbitrary differentiable functions this becomes infinite dimensional. In PDEs one usually works with function spaces and orthogonal/orthonormal systems rather than treating everything as a finite-dimensional vector space.
Example: heat flowing through a rod
Suppose a thin rod of length has temperature
at position and time .
A standard model for heat flow is the heat equation
where describes how quickly the material conducts heat.
Suppose also that both ends of the rod are kept at temperature zero:
At first sight this is rather more intimidating than multiplying a vector by a matrix.
But consider the functions
If we apply the second derivative operator to one of these functions, we get
That should look familiar.
Each sine function is an eigenfunction of the second derivative operator.
Instead of
we now have
Now suppose the initial temperature distribution can be written as
This is a Fourier sine expansion.
Because the heat equation is linear, we can study every one of these basis functions independently.
The solution becomes
So an apparently complicated temperature distribution has been decomposed into simple modes.
Each mode evolves independently:
Higher-frequency modes decay faster, which is why sharp variations in temperature smooth out over time.