0% found this document useful (0 votes)
70 views2 pages

Frame

This MATLAB function calculates the stiffness matrix, element forces, deformations, and element forces for a frame member. It takes in member geometry, material properties, and an integer (itask) to determine whether to calculate the stiffness matrix (itask = 1) or the element forces/deformations (itask = 2). First, it defines geometry variables and calculates a transformation matrix (Gama). Then, depending on itask, it either calculates the stiffness matrix by transforming the basic stiffness matrix, or calculates the element forces/deformations by applying the basic matrix to the transformed deformations.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views2 pages

Frame

This MATLAB function calculates the stiffness matrix, element forces, deformations, and element forces for a frame member. It takes in member geometry, material properties, and an integer (itask) to determine whether to calculate the stiffness matrix (itask = 1) or the element forces/deformations (itask = 2). First, it defines geometry variables and calculates a transformation matrix (Gama). Then, depending on itask, it either calculates the stiffness matrix by transforming the basic stiffness matrix, or calculates the element forces/deformations by applying the basic matrix to the transformed deformations.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

C:\Users\John\Documents\MATLAB\frame.

Saturday, August 04, 2012 4:41 AM

function [k,F,du,dF]=frame(X,Y,U,E,I,A,itask) % % MATLAB subroutine to conduct the computations for a frame member % % % X: abscissas of the member end points % y: ordinates of the member end points % U: member end displacement vector in global coordinate system % (it is only used if itask = 2, see below) % E: Young's modulus % I: Cross-sectional moment of inertia % A: Cross-sectional area % % itask: integer parameter, which determines what task must be conducted: % % if itask = 1, the routine calculates and returns the member % stiffness matrix in the global coordinate system, k. % % if itask = 2, the routine calculates and returns the member % end force vector in the global coordinate system, F, the element % basic deformation, du, and the element basic force, dF % %-------------------------------------------------------------------------% % FIRST, CONDUCT THE COMPUTATIONS WHICH ARE ALWAYS REQUIRED, NO MATTER WHAT THE VALUE OF itask IS!

dX=X(2)-X(1); dY=Y(2)-Y(1); L=(dX^2+dY^2)^0.5; cosp=dX/L; sinp=dY/L; % % % % % % % Determine the Gama array, with Gama=Gama-rbm*Gama-rot One could simply calculare Gama-rbm and Gama-rot and then multiply them, but this would be computationally expensive. To avoid this, we calculate BY HAND the values of Gama as a function of cosp, sinp and L. In this fashion we keep the required number of calculations to a minimum the (3x6) matrix Gama is found to be (VERIFY!):

val2=sinp/L; val1=cosp/L; Gama=[-val2 val1 1 val2 -val1 0;-val2 val1 0 val2 -val1 1;-cosp -sinp 0 cosp sinp 0]; % determine basic stiffness matrix: k1=2*E*I/L; kb=[2*k1 k1 0;k1 2*k1 0;0 0 E*A/L]; % basic stiffness!

if itask == 1
-1-

C:\Users\John\Documents\MATLAB\frame.m

Saturday, August 04, 2012 4:41 AM

% CONDUCT COMPUTATIONS IF itask =1: k = Gama'*kb*Gama; F=[0;0;0;0;0;0]; du=[0;0;0]; dF=[0;0;0]; elseif itask == 2 % CONDUCT COMPUTATIONS IF itask =2:

k = zeros(6,6); du=Gama*U; dF=kb*du; F=Gama'*dF;

else % if itask is NOT equal to 1 or 2, print an error message: k = zeros(0); F=zeros(0); du=zeros(0); dF=zeros(0); disp('ERROR: unacceptable value of itask given, set itask to 1 or 2' ) end

% Complete routine execution

end

-2-

You might also like