Why does the inverse of this mapping from a square to a trapezoid not exist?

33 Views Asked by At

I am trying to compute an inverse mapping. I shall start with the forward mapping.

Consider the parametric coordinates $(r,s)$:

$r \in \mathbb{R}\wedge[-1,1]$

$s \in \mathbb{R}\wedge[-1,1]$

Then consider the Euclidean coordinates:

$X=(x,y,z)$

A mapping is considered from the parametric domain to a flat trapezoidal domain in 3D Euclidean space. The trapezoidal domain is delineated by the convex hull defined by the four coordinates:

$X_i = (x_i,y_i,z_i) : i \in \mathbb{Z}\wedge[1,4]$

The mapping from the parameterized $(r,s)$ domain to the trapezoidal domain is as follows:

$X(r,s) = \sum_{i=1}^4h_iX_i$

where

$h_1 = \frac{1}{4}(1+r)(1+s)$

$h_2 = \frac{1}{4}(1-r)(1+s)$

$h_3 = \frac{1}{4}(1-r)(1-s)$

$h_4 = \frac{1}{4}(1+r)(1-s)$

The $h_i$ are called shape functions in finite element analysis, and they have the partition of unity property ($\sum h_i(r,s)=1$).

The above mapping can be written in matrix form as follows:

\begin{equation} \left[\begin{matrix} x\\ y\\ z \end{matrix}\right] = \left[\begin{matrix} x_1 & x_2 & x_3 & x_4\\y_1 & y_2 & y_3 & y_4\\z_1 & z_2 & z_3 & z_4\\ \end{matrix}\right] \left[\begin{matrix} h_1\\ h_2\\ h_3\\ h_4 \end{matrix}\right] = \mathbf{X}\left[\begin{matrix} h_1\\ h_2\\ h_3\\ h_4 \end{matrix}\right] \end{equation}

Or equivalently:

\begin{equation} \left[\begin{matrix} x\\ y\\ z \end{matrix}\right] = \frac{1}{4} \left[\begin{matrix} x_1 & x_2 & x_3 & x_4\\y_1 & y_2 & y_3 & y_4\\z_1 & z_2 & z_3 & z_4\\ \end{matrix}\right] \left[\begin{matrix} 1 & 1 & 1 & 1\\1 & 1 & -1 & -1\\1 & -1 & -1 & 1\\1 & -1 & 1 & -1\\ \end{matrix}\right] \left[\begin{matrix} 1\\ s\\ r\\ sr \end{matrix}\right] \end{equation}

I have verified this mapping and it works as anticipated. In finite element analysis, usually one is interested in the mapping as described above, going from (r,s) to (x,y,z).

However, I am currently dealing with an inverse problem. I have (x,y,z) located in the trapezoidal domain. I now want to get the (r,s) coordinates.

The following was my attempt at achieving this.

I write the RHS vector above as follows:

\begin{equation} \left[\begin{matrix} 1\\ s\\ r\\ sr \end{matrix}\right] = \left[\begin{matrix} 1\\ 0\\ 0\\ 0 \end{matrix}\right] + \left[\begin{matrix} 0&0&0\\ 1&0&0\\ 0&1&0\\ 0&0&1 \end{matrix}\right] \left[\begin{matrix} s\\ r\\ sr \end{matrix}\right] \end{equation}

Plugging this into the previous equation and moving the constant terms (not functions of $(r,s)$) to the LHS:

\begin{equation} \left[\begin{matrix} x\\ y\\ z \end{matrix}\right] - \frac{1}{4}\mathbf{X} \left[\begin{matrix} 1\\ 1\\ 1\\ 1 \end{matrix}\right] = \frac{1}{4} \left[\begin{matrix} x_1 & x_2 & x_3 & x_4\\y_1 & y_2 & y_3 & y_4\\z_1 & z_2 & z_3 & z_4\\ \end{matrix}\right] \left[\begin{matrix} 1 & 1 & 1\\1 & -1 & -1\\-1 & -1 & 1\\-1 & 1 & -1\\ \end{matrix}\right] \left[\begin{matrix} s\\ r\\ sr \end{matrix}\right] = \mathbf{T} \left[\begin{matrix} s\\ r\\ sr \end{matrix}\right] \end{equation}

So I've found a 3x3 matrix $\mathbf{T}$ mapping $(\bar{x},\bar{y},\bar{z})$ to $(s,r,sr)$. The inverse of $\mathbf{T}$ should give me what I want.

However, when I test this for a simple square, I find that the forward mapping works as expected, but $\mathbf{T}$ is singular and the inverse does exist.

Why might my mapping matrix be singular? I have a feeling it has to do with the rs term in the RHS... however thinking about this logically the mapping has to be bijective. I must be missing something. Any ideas are much appreciated.

Edit:

The example square coordinates are:

$X_1 = (0,0,0)$

$X_2 = (2.5,0,0)$

$X_3 = (2.5.,2.5.,0)$

$X_4 = (0,2.5.,0)$

Taking the parametric coordinates $(0,0)$, the mapping should give the centre of the square.

\begin{equation} \left[\begin{matrix} x\\ y\\ z \end{matrix}\right] = \frac{1}{4} \left[\begin{matrix} 0 & 2.5 & 2.5 & 0\\0 & 0 & 2.5 & 2.5\\0 & 0 & 0 & 0\\ \end{matrix}\right] \left[\begin{matrix} 1 & 1 & 1 & 1\\1 & 1 & -1 & -1\\1 & -1 & -1 & 1\\1 & -1 & 1 & -1\\ \end{matrix}\right] \left[\begin{matrix} 1\\ 0\\ 0\\ 0 \end{matrix}\right] = \left[\begin{matrix} 1.25\\ 1.25\\ 0 \end{matrix}\right] \end{equation}

Which is (1.25,1.25,0.) as expected.

However, inverting the mapping in the way I tried it, I am not able to go back the other way.

1

There are 1 best solutions below

0
On BEST ANSWER

The problem here is that the space of vectors $(r,s,rs)$ is not "flat". In fact it is a 2-dimensional space in $\mathbb R^3$.

On the other side, if $\mathbf T$ was invertible you would have $$ \mathbf{T}^{-1} \begin{equation} \left[\begin{matrix} x\\ y\\ z \end{matrix}\right] - \frac{1}{4}\mathbf{T}^{-1}\mathbf{X} \left[\begin{matrix} 1\\ 1\\ 1\\ 1 \end{matrix}\right] = \left[\begin{matrix} s\\ r\\ sr \end{matrix}\right] \end{equation} $$ so on the left you have a subset of an affine space, that is flat, and you want to stuff it inside a curved surface. This is obviously not possible on a geometric basis.


Moreover, if your trapezoid is "flat", it means that, up to a translation, it is contained in a 2-dimensional vector space. In formulae, there exists a vector $(x,y,z)$ such that for every $i$, $$(x_i,y_i,z_i) = (x,y,z) + (x'_i,y'_i,z'_i)$$ and the rank of $$ \left[\begin{matrix} x'_1 & x'_2 & x'_3 & x'_4\\y'_1 & y'_2 & y'_3 & y'_4\\z'_1 & z'_2 & z'_3 & z'_4\\ \end{matrix}\right] $$ is at most 2. It means that $$ \mathbf{T} = \frac{1}{4} \left[\begin{matrix} x_1 & x_2 & x_3 & x_4\\y_1 & y_2 & y_3 & y_4\\z_1 & z_2 & z_3 & z_4\\ \end{matrix}\right] \left[\begin{matrix} 1 & 1 & 1\\1 & -1 & -1\\-1 & -1 & 1\\-1 & 1 & -1\\ \end{matrix}\right] = \\ \frac{1}{4} \left[\begin{matrix} x & x & x & x\\y & y & y & y\\z & z & z & z\\ \end{matrix}\right] \left[\begin{matrix} 1 & 1 & 1\\1 & -1 & -1\\-1 & -1 & 1\\-1 & 1 & -1\\ \end{matrix}\right] + \frac{1}{4} \left[\begin{matrix} x'_1 & x'_2 & x'_3 & x'_4\\y'_1 & y'_2 & y'_3 & y'_4\\z'_1 & z'_2 & z'_3 & z'_4\\ \end{matrix}\right] \left[\begin{matrix} 1 & 1 & 1\\1 & -1 & -1\\-1 & -1 & 1\\-1 & 1 & -1\\ \end{matrix}\right]=\\ \frac{1}{4} \left[\begin{matrix} x'_1 & x'_2 & x'_3 & x'_4\\y'_1 & y'_2 & y'_3 & y'_4\\z'_1 & z'_2 & z'_3 & z'_4\\ \end{matrix}\right] \left[\begin{matrix} 1 & 1 & 1\\1 & -1 & -1\\-1 & -1 & 1\\-1 & 1 & -1\\ \end{matrix}\right] $$ so the rank of $\mathbf T$ is at most 2.