krata.m
% rozwiazanie MES % przy uzyciu pakietu CALFEM % % opracowal: Piotr Pluciński %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % dane E=1e6; A=1e-2; ep = [E A] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % dyskretyzacja LE=3; LW=3; LSSW=2; LSSU=LW*LSSW; K=zeros(LSSU); F=zeros(LSSU,1); %wspolrzedne Coord=[0 0; 3 0 ; 0 4]; % topologia % (przynaleznosc stopni swobody do ES) % numery st.sw. dla wezlow Dof=reshape((1:LSSU),LSSW,length(Coord))'; % macierz topologii Etop=[1 2; 2 3; 1 3]; % definicja macierzy stopni swobody dla elementów for i=1:LE Edof(i,:)=[i,Dof(Etop(i,1),:),Dof(Etop(i,2),:)]; end [Ex,Ey]=coordxtr(Edof, Coord, Dof, 2); % rysunek siatki ES elnum=Edof(:,1); eldraw2(Ex,Ey,[1,3,1],elnum); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % obciazenie: % siły węzłowe F(6)=-10; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % macierze i wektory ES % agregacja for i=1:LE Ke=bar2e(Ex(i,:),Ey(i,:),ep); K=assem(Edof(i,:),K,Ke); end %for %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % warunki brzegowe bc=[1 0; 2 0; 4 -0.001; 5 0]; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %rozwiazanie [Q,R]=solveq(K,F,bc) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % postprocessing % powrot do ES % przemieszczenia w poszczegolnych ES Qe=extract_ed(Edof,Q); % rysunek zdeformowanej siatki ES figure(1) [sfac]=scalfact2(Ex,Ey,Qe,0.2); eldisp2(Ex,Ey,Qe,[2,1,1],sfac); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % obliczenie sił przywezłowych for i=1:LE fe(i,:)=bar2s(Ex(i,:),Ey(i,:),ep,Qe(i,:)); end fe plotpar=[2 1]; % Siły podłuzne figure(2) [fmax,nmax]=max(fe); scal=scalfact2(Ex(nmax,:),Ey(nmax,:),fe(nmax),0.1); for i=1:LE eldia2(Ex(i,:),Ey(i,:),ones(10,1)*fe(i,:),plotpar,scal); end %axis([-2 4 -1 5]); title('sily podluzne')