Affine transformations and their inverse

Click For Summary
SUMMARY

The discussion centers on affine transformations and their inverses, specifically the mapping function F_{K}: \hat{K} \to K defined as F_{K}(\hat{x},\hat{y}) = B_{K}[\hat{x}, \hat{y}] + b_{K}. The matrix B_{K} is given as [[1, 0], [1, 1]] with b_{K} as [0, 0]. The inverse transformation F_{K}^{-1} is computed as F_{K}^{-1} = B_{K}^{-1}([x, y] - b_{K}), leading to discrepancies in the evaluation of the function φ(x,y) when compared to direct computation. The user identifies an error in their MATLAB implementation related to the transformation, which affects the output of the function.

PREREQUISITES
  • Understanding of affine transformations in mathematics
  • Familiarity with matrix operations, including inversion
  • Knowledge of function composition in mathematical contexts
  • Basic proficiency in MATLAB for implementing mathematical functions
NEXT STEPS
  • Study the properties of affine transformations in detail
  • Learn about matrix inversion techniques, specifically for 2x2 matrices
  • Explore function composition and its applications in mathematical programming
  • Review MATLAB's capabilities for handling matrix operations and function definitions
USEFUL FOR

Mathematicians, computer scientists, and engineers involved in finite element analysis or anyone implementing affine transformations in programming environments like MATLAB.

hkcool
Messages
10
Reaction score
0
Let F_{K}: \hat{K} \to K be defined as follows:
<br /> F_{K}(\hat{x},\hat{y}) = B_{K}\left[\begin{array}{c}<br /> \hat{x}\\<br /> \hat{y}\\<br /> \end{array}\right] + b_{K}<br />

i.e. F_{K} maps from (\hat{x},\hat{y}) to (x,y). In a more concrete sense, for this example take the following:
<br /> B_{K} = \left[\begin{array}{cc}<br /> 1 &amp; 0\\<br /> 1 &amp; 1\\<br /> \end{array}\right], \;\;\;b_{K} = \left[\begin{array}{c}<br /> 0\\<br /> 0\\<br /> \end{array}\right]<br />

Now suppose we have the function
<br /> \hat{\phi}(\hat{x},\hat{y}) = 1 - \hat{x} - \hat{y}<br />

and are given that
<br /> \phi(x,y) = \hat{\phi} \circ F_{K}^{-1}<br />

Computing F_{K}^{-1} is easy:
<br /> F_{K}^{-1} = B_{K}^{-1}\left(\left[\begin{array}{c}<br /> x\\<br /> y\\<br /> \end{array}\right] - b_{K}\right) = \left[\begin{array}{c}<br /> x\\<br /> y-x\\<br /> \end{array}\right]<br />

so a direct computation of \phi(x,y) gives:
<br /> \phi(x,y) = 1 - x - (y-x) = 1-y<br />

Consider the point (x,y) = (1/2,0). We have \phi(1/2,0) = 1.

However, if we compute via the composition of the inverse, we have F_{K}^{-1}(1/2,0) = [1/2,-1/2]^{T} and \hat{\phi} \circ F_{K}^{-1}(1/2,1/2) = 1 - 1/2 + 1/2 = 1.

edit: err, I figured out the error as I was typing this out and corrected it...maybe someone can delete this for me? Or I guess it can be left as an example or something

So what is the reason for this discrepancy and the error in the second way I computed it? This is a subroutine I have to implement in MATLAB and the only way I can do it is by computing the value of F_{K}^{-1} first and then composing it with \hat{\phi}, since I can't get an analytical expression for \phi in MATLAB...(I suppose I could but it would be much more tedious than it's worth).

I'm assuming I'm doing something extremely idiotic here, but can't for the life of me figure out what the error is...

If anyone is curious about the context: It's a finite element computation. Some info on the transformations: http://www.math.umn.edu/~sayas002/anIntro2FEM.pdf on page 28.
 
Last edited by a moderator:
Physics news on Phys.org
hkcool said:
Let F_{K}: \hat{K} \to K be defined as follows:
<br /> F_{K}(\hat{x},\hat{y}) = B_{K}\left[\begin{array}{c}<br /> \hat{x}\\<br /> \hat{y}\\<br /> \end{array}\right] + b_{K}<br />

i.e. F_{K} maps from (\hat{x},\hat{y}) to (x,y). In a more concrete sense, for this example take the following:
<br /> B_{K} = \left[\begin{array}{cc}<br /> 1 &amp; 0\\<br /> 1 &amp; 1\\<br /> \end{array}\right], \;\;\;b_{K} = \left[\begin{array}{c}<br /> 0\\<br /> 0\\<br /> \end{array}\right]<br />

Now suppose we have the function
<br /> \hat{\phi}(\hat{x},\hat{y}) = 1 - \hat{x} - \hat{y}<br />

and are given that
<br /> \phi(x,y) = \hat{\phi} \circ F_{K}^{-1}<br />

Computing F_{K}^{-1} is easy:
<br /> F_{K}^{-1} = B_{K}^{-1}\left(\left[\begin{array}{c}<br /> x\\<br /> y\\<br /> \end{array}\right] - b_{K}\right) = \left[\begin{array}{c}<br /> x\\<br /> y-x\\<br /> \end{array}\right]<br />

so a direct computation of \phi(x,y) gives:
<br /> \phi(x,y) = 1 - x - (y-x) = 1-y<br />

Consider the point (x,y) = (1/2,1/2). We have \phi(1/2,1/2) = 1/2.

However, if we compute via the composition of the inverse, we have F_{K}^{-1}(1/2,1/2) = [1/2,0]^{T} and \hat{\phi} \circ F_{K}^{-1}(1/2,1/2) = 1 - 1/2 - 1/2 = 0.

Isn't it supposed to be

\hat{\phi}(F_K^{-1}(1/2,1/2) = \hat{\phi}(1/2,0) = 1 - 1/2 - 0 = 1/2
 
R136a1 said:
Isn't it supposed to be

\hat{\phi}(F_K^{-1}(1/2,1/2) = \hat{\phi}(1/2,0) = 1 - 1/2 - 0 = 1/2

Yup. I've still got an error in my code in the transformation part, so I'm going to take a look at it and re-edit the question :/ sorry for the confusion
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 26 ·
Replies
26
Views
962
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 13 ·
Replies
13
Views
1K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 5 ·
Replies
5
Views
1K