How to code this mathematical (tensor) formula in Matlab
5 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
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.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!