belka matlab.doc

(19 KB) Pobierz

clc

clear

lp=4;

L=4

n=lp+5;

h=L/lp;

q=-0.2

E=2e+5

J=1e-4

P=[0 0 q/(E*J) q/(E*J) q/(E*J) q/(E*J) q/(E*J) 0 0]

A=zeros(n,n);

A(1,3)=1;

A(2,1:5)=1/12*h*[1 -8 0 8 -1];

for i=3:n-2

A(i,i-2:i+2)=1/h^4*[1 -4 6 -4 1];

P(i)=q/E*J;

end

A(n-1,n-4:n)=1/(12*h^2)*[-1,16,-30,16,-1];

A(n,n-4:n)=1/(2*h^3)*[-1,2,0,-2,1];

P=P'

w=A\P

plot(0:h:L,w(3:7),'*-')

 

Zgłoś jeśli naruszono regulamin