Azzera filtri
Azzera filtri

How to code this mathematical (tensor) formula in Matlab

3 visualizzazioni (ultimi 30 giorni)
Hi, i'm looking to code this tensor notation formula into matlab:
X = e.n - [n.e.n]n
where n is a unit vector, e is a 3x3 tensor (strain), and "." represents a dot product.
My initial code is the following:
X = e_tensor*n - n*transpose(e_tensor*n)*n
However, i am not able to recreate the results of the paper i am reading.
Is it possible my matlab code doesnt correctly represent the tensor formula?
Any help would be greatly appreciated.
Thanks,
Tyler

Risposte (1)

Walter Roberson
Walter Roberson il 29 Nov 2015
"*" is not the dot product.
X = dot(e_tensor, n) - dot(n, transpose( dot(e_tensor, n) )) * n
However, I do not see where the transpose is coming from, and the meaning of [something]n is not described.
Also, your e_tensor is 3 x 3 and your n is a unit vector. The MATLAB dot product is only defined between arrays (or vectors) that are the same size.

Categorie

Scopri di più su Elementary Math in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by