Not able to integrate a matrix.
1 view (last 30 days)
Show older comments
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);
0 Comments
Answers (1)
Stephan
on 18 Aug 2020
Edited: Stephan
on 18 Aug 2020
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]
0 Comments
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!