image thumbnail
ff=memfor(dd,x,y,Area,Emod,inode,jnode)
function ff=memfor(dd,x,y,Area,Emod,inode,jnode)
%
% ff=memfor(dd,x,y,Area,Emod,inode,jnode)
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% This function computes the axial force in 
% all members as a function of the member 
% properties and the global displacement vector.
%
% dd          - global displacement vector
% x,y         - global nodal coordinate vectors
% Area        - member area vector
% Emod        - modulus of elasticity vector
% inode,jnode - indices of the member ends
%
% ff          - member force vector
%
% User m functions called:  none
%----------------------------------------------

x=x(:); y=y(:); a=Area(:); e=Emod(:); 
i=inode(:); j=jnode(:);
xx=x(j)-x(i); yy=y(j)-y(i); 
L=sqrt(xx.^2+yy.^2);
cs=xx./L; sn=yy./L; eaL=(a.*e)./L;
iu=dd(2*i-1); iv=dd(2*i); 
ju=dd(2*j-1); jv=dd(2*j);
ff=eaL.*((ju-iu).*cs+(jv-iv).*sn);

Contact us at files@mathworks.com