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.

Answers (1)

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 Comment

I'm not able to get this correction to run.

Sign in to comment.

Asked:

on 31 Mar 2019

Commented:

on 31 Mar 2019

Community Treasure Hunt

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

Start Hunting!