### ufl tensor sqrt

171

views

0

Hello!

I am trying to procedure a very simple ufl tensor (2x2) operation:

$F^TF=C=U^2$

I am trying to get $U$

Any idea?

Best!

Ricardo

I am trying to procedure a very simple ufl tensor (2x2) operation:

$F^TF=C=U^2$

`F`^{T}`F`=`C`=`U`^{2}I am trying to get $U$

`U`, but fenics is giving me the following error message.Any idea?

Best!

Ricardo

Community: FEniCS Project

### 2 Answers

0

I think a got the answer:

fc_sqrt = as_tensor(((0.5, 0.5), (0.5, 0.5)))

fc_U = elem_pow(fc_C, fc_sqrt)

but now, I am trying to get the $ln\left(U\right)$

Best!

Ricardo

fc_sqrt = as_tensor(((0.5, 0.5), (0.5, 0.5)))

fc_U = elem_pow(fc_C, fc_sqrt)

but now, I am trying to get the $ln\left(U\right)$

`l``n`(`U`) , it is a Natural logarithm of tensor (2x2), any way or workaround to get it?Best!

Ricardo

0

Careful! Matrix function (such as square root or log)

Apparently,

See https://en.wikipedia.org/wiki/Matrix_function . There are several options how to compute matrix function, power series, diagonalization, Cauchy formula, ...

For the special 2x2 case there is a nice formula on the wiki page, see section "Arbitrary function of a 2x2 matrices". Just need to find eigenvalues of the matrix. Generally, a good way is to use the diagonalization approach (and special 2x2 formula is just a shorthand closed form for that approach I guess).

**is not an element-wise applied scalar function**. *Otherwise the matrix inverse would be just inverting the elements and the whole linear algebra world solving Ax=b would have no job :)Apparently,

`elem_power`

is an element-wise operation, something you do not want. See https://en.wikipedia.org/wiki/Matrix_function . There are several options how to compute matrix function, power series, diagonalization, Cauchy formula, ...

For the special 2x2 case there is a nice formula on the wiki page, see section "Arbitrary function of a 2x2 matrices". Just need to find eigenvalues of the matrix. Generally, a good way is to use the diagonalization approach (and special 2x2 formula is just a shorthand closed form for that approach I guess).

Please login to add an answer/comment or follow this question.