Not able to integrate a matrix.
이전 댓글 표시
HI, I want to integrate an equation 'I', but matlab shows errors while executing it.
syms theta;
m = cos(theta);
n = sin(theta);
T = [m^2 n^2 0 0 0 -m*n; n^2 m^2 0 0 0 m*n; 0 0 1 0 0 0; 0 0 0 m n 0; 0 0 0 -n m 0; 2*m*n -2*m*n 0 0 0 m^2-n^2];
Cbar_PMNC = (inv(T))*C_nc*T';
Y = Cbar_PMNC*((R^2-a^2)/2);
I = integral(@(theta)Y,0,2*pi);
답변 (1개)
You missed to define some values, for generality i setted them to be symbolic variables. Also integral is a function for numeric integration, for symbolic integration use int:
syms theta C_nc R a
m = cos(theta);
n = sin(theta);
T = [m^2 n^2 0 0 0 -m*n; n^2 m^2 0 0 0 m*n; 0 0 1 0 0 0;...
0 0 0 m n 0; 0 0 0 -n m 0; 2*m*n -2*m*n 0 0 0 m^2-n^2];
Cbar_PMNC = (inv(T))*C_nc*T';
Y = Cbar_PMNC*((R^2-a^2)/2);
I = int(Y,0,2*pi)
gives:
I =
[ (5*pi*C_nc*(R^2 - a^2))/8, (3*pi*C_nc*(R^2 - a^2))/8, 0, 0, 0, 0]
[ (3*pi*C_nc*(R^2 - a^2))/8, (5*pi*C_nc*(R^2 - a^2))/8, 0, 0, 0, 0]
[ 0, 0, pi*C_nc*(R^2 - a^2), 0, 0, 0]
[ 0, 0, 0, 0, 0, 0]
[ 0, 0, 0, 0, 0, 0]
[ 0, 0, 0, 0, 0, -(pi*C_nc*(R^2 - a^2))/2]
카테고리
도움말 센터 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!