Professional Documents
Culture Documents
P=-1; >> %for structure: >> GDof=2*numberNodes; >> U=zeros(GDof,1); >> %stiffness matrix and force vector >> [stiffness,force]=... formStiffnessBernoulliBeam(GDof,numberElements,... elementNodes,numberNodes,xx,EI,P); >> %Boundary conditions and solution >> %clamped-clamped >> %fixedNodeU=[1 2*numberElements+1]'; >> %fixedNodeV=[2 2*numberElements+2]'; >> %simply supported-simply supported >> fixedNodeU=[1 2*numberElements+1]'; fixedNodeV=[]'; >> %clamped at x=0 >> %fixNodeU=[1]'; fixnodeV=[2]'; >> prescribedDof=[fixedNodeU;fixedNodeV]; >> %solution >> displacements=solution(GDof,prescribedDof,stiffness,force); >> %output displaments/reactions >> outputDisplacementsReactions(displacements,stiffness,... GDof,prescribedDof) >> %drawing deform shape >> U=displacements(1:2:2*numberNodes); >> plot(nodeCoordinates,U,'.')