Need Help on Matlab code

I am trying to solve the following code.
clc
clear
% variables
E= 29000;
t = 2;
v = 0.3;
syms a;
syms b;
% finding B
B = [ (-b-y)/(4ab) 0 (b-y)/(4ab) 0 (b+y)/(4ab) 0 (-b+y)/(4ab) 0;
0 (-a-x)/(4ab) 0 (-a+x)/(4ab) 0 (a+x)/(4ab) 0 (a-x)/(4ab);
(-a-x)/(4ab) (-b-y)/(4ab) (-a+x)/(4ab) (b-y)/(4ab) (a+x)/(4ab) (b+y)/(4ab) (a-x)/(4ab) (-b+y)/(4ab)]
% E
Em= [ 31868.132 9560.44 0;
9560.44 35868.132 0;
0 0 1153.8]
% Getting K
C = transpose(B)
fun=@(x,y)C*Em*B*t;
k = integral2(fun,-a,a,-b,b)
Attached below is a picture of the equation.
Equation:
I'm trying to solve this integral equation using the matrices in the code.

Respuestas (1)

Walter Roberson
Walter Roberson el 31 de Mzo. de 2019

0 votos

Q = @(v) sym(v,'r');
E= Q(29000);
t = Q(2);
v = Q(0.3);
syms a b x y
% finding B
B = [ (-b-y)/(4*a*b) 0 (b-y)/(4*a*b) 0 (b+y)/(4*a*b) 0 (-b+y)/(4*a*b) 0;
0 (-a-x)/(4*a*b) 0 (-a+x)/(4*a*b) 0 (a+x)/(4*a*b) 0 (a-x)/(4*a*b);
(-a-x)/(4*a*b) (-b-y)/(4*a*b) (-a+x)/(4*a*b) (b-y)/(4*a*b) (a+x)/(4*a*b) (b+y)/(4*a*b) (a-x)/(4*a*b) (-b+y)/(4*a*b)];
% E
Em = Q([ 31868.132 9560.44 0;
9560.44 35868.132 0;
0 0 1153.8]);
% Getting K
C = transpose(B);
fun = C*Em*B*t;
k = int(int(fun,x,-a,a),y,-b,b);
The results alternate between numeric constants, versus expressions of the form constant*a/b + constant*b/a

1 comentario

Rubinjeet Sangha
Rubinjeet Sangha el 31 de Mzo. de 2019
I'm not able to get this correction to run.

Iniciar sesión para comentar.

Categorías

Más información sobre Symbolic Math Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 31 de Mzo. de 2019

Comentada:

el 31 de Mzo. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by