How to code this mathematical (tensor) formula in Matlab

5 ビュー (過去 30 日間)
Tyler
Tyler 2015 年 11 月 28 日
回答済み: Walter Roberson 2015 年 11 月 29 日
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

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 11 月 29 日
"*" 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.

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by