フィルターのクリア

How to evaluate symbolic results over a 3D tensor?

15 ビュー (過去 30 日間)
Mirlan Karimov
Mirlan Karimov 2020 年 5 月 3 日
回答済み: Walter Roberson 2020 年 5 月 3 日
I want the following results to be evaluate over a m x m x m 3D tensor defined by [X,Y,Z] = meshgrid(x,x,x) where length(x) = m. The problem is that are the elementwise square and multiplication, respectively. How do I solve the problem?
syms t x y z C w a alpha
% alpha = 0;
X = [x,y,z];
Xbar = int(int(int(X,x,-a,a),y,-a,a),z,-a,a)/(8*a^3);
%Example1
v = [sin(C*t)*x + cos(C*t)*y - w/2*y; cos(C*t)*x + w/2*x - sin(C*t)*y + x*y;0];
A = [-sin(C*t), cos(C*t) - w/2; cos(C*t) + w/2 + x^2 + y*x, - sin(C*t)];
vbar = int(int(int(v,x,-a,a),y,-a,a),z,-a,a)/(8*a^3);
W = 0.5 * ( jacobian(v,X) - transpose(jacobian(v,X)) );
SKEW = 0.5 * ( (v-vbar)*(X-Xbar) - transpose((v-vbar)*(X-Xbar)) );

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 5 月 3 日
You should be able to just subs() in the 3d grid.
The symbolic toolbox treats all names as representing scalars, implicitly using elementwise operations including assuming commutative. x*u will be assumed to be the same as y*x for example. You do not need to write the dot versions of the operations because they assumed.
Then later when you subs() in non-scalars it more-or-less does arrayfun, doing elementwise operations.

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by