Professional Documents
Culture Documents
Matlab Code Ex2
Matlab Code Ex2
Matlab Code Ex2
clear;
%Input
E = 70e6;
A = 50e-6;
L = 5;
P = 8;
q = 12.5;
%Solution
k1 = A*E* [1/(L) -1/(L);
-1/(L) 1/(L)];
r1 = [q*L/2 q*L/2];
R1 = zeros(2,1);
R2 = zeros(2,1);
R2(1:2) = R2(1:2) + r1';
U = (U1+U2)/2
%FEM solution
%Internal force or reaction
b1 = k1*[U1(1);U1(2)]
b2 = k1*[U2(1);U2(2)] - r1'
%Internal stress
sig1 = b1/A
sig2 = b2/A