Not able to integrate a matrix.

1 visualización (últimos 30 días)
Rahul sharma
Rahul sharma el 18 de Ag. de 2020
Editada: Stephan el 18 de Ag. de 2020
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);

Respuestas (1)

Stephan
Stephan el 18 de Ag. de 2020
Editada: Stephan el 18 de Ag. de 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]

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by