User:Eml4500.f08.RAMROD.A/HW5
This version is very similar to the original but some sections have been rearranged to be placed in the correct order, as there was some confusion as to whose portions went where. Also, a parsing issue was resolved. I, (Eml4500.f08.RAMROD.A 01:11, 14 November 2008 (UTC),) have fixed the HW for final submission and the comparison to the original can be found here: [Comparsion]
Justification of Eliminated rows 1, 2, 5, and 6 to obtain K 2-bar truss: [edit]
Force Displacement Relation: K6x6d6x1 = F6x1
Moving F to the other side of the equation gives us Equation (1):
Equation (1)

Using the Principle of Virtual Work, we can arrive at Equation (2):
Equation (2)

-
- This is true for all w6x1
- w is known as the "weighting mat."
- Note that the dot product is used in this equation.
Equation (1)↔ Equation (2)
Force Displacement Relation Proof [edit]
| Proof that Kd=F | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
A) Equation(1) → Equation(2): Trivial
|
Using Principle of Virtual Work [edit]
Taking account for the boundary conditions of the 2 bar truss:
- d1=d2=d5=d6=0
Weighting coefficient must be "kinematically admissible," ie cannot violate the boundary conditions
- w1=w2=w5=w6=0
Weighting coefficients = virtual displacement
- (calculus of variations)
From before:


![\begin{Bmatrix}
w_3\\
w_4
\end{Bmatrix}\bullet[\begin{bmatrix}
K_{13} & K_{14} \\
K_{23} & K_{24} \\
K_{33} & K_{34}\\
K_{43} & K_{44}\\
K_{53} & K_{54}\\
K_{63} & K_{64}
\end{bmatrix} \begin{Bmatrix}
d_3\\
d_4
\end{Bmatrix} - \begin{Bmatrix}
F_1\\
F_2\\
F_3\\
F_4\\
F_5\\
F_6
\end{Bmatrix}] = 0](http://upload.wikimedia.org/math/1/5/b/15b44c8230ca03a12b1be636290288ad.png)
- This is true for all




Comparing Equations (3) and (4) [edit]
Equation (3): 
Equation (4): 
Equation (3) → Equation (4) is trivial
Equation (4) → Equation (3)
- Since Equation (4) is valid for all w, select w=1
Thus proving Equation (3) is true
Principal of Virtual Work Matrix [edit]
We are going to try to derive element stiffness matrix by Principle of Virtual Work.

Recalling the force displacement with axial degree of freedom 

Equation 
Principle of Virtual Work applied here:Equation
![]()
We showed equation 
Recall 
Similarly 
Virtual Displacement Terms [edit]
ŵ2x1 = virtual axial displacement, with corresponding q(e)2x1
w4x1 = virtual axial displacement in global coordinates system, with corresponding d(e)4x1
Equation (5) [edit]
for all w4x1
We want to prove equation (5) using matrix identity equation (6):
Equation 6: 
Homework Example to verify equation (6) [edit]




This proves Equation (6): 
We can recall that
, where a and b are nx1 and aT is 1xn
It follows that from Eq(1):
, for all w,
and using Eq (6) above, that:
![w^TT^{(e)T}[\hat{k}^{(e)}(T^{(e)}d^{(e)})-P^{(e)}] = 0](http://upload.wikimedia.org/math/7/4/a/74addf14df43905d58fa2ec9741b5a40.png)
and that:
, for all w4x1
Also:
, for all w.
All the above proves:

Principal of Virtual Work [edit]
Equation 2:
, for all w
Equation 3:

and finally equation 4:

Problems of the Continuous Case (PDE's) [edit]
The new problems will contain varying parameters
Example of problem:
Elastic bar with varying cross section A(x), varying modulus E(x), subjective to varying axial load (distributed), a concentrated load and inertia force (dynamic).
note: load will be time dependent
Problem Setup [edit]
The following is a FBD of an infinitesimal section area of the elastic bar with varying properties.
The bottom force that is not labeled in the picture can be represented as the following equation;

Within this equation
is equal to
which has the units of
. Now we proceed to sum the forces in the x-direction and the results are as follows;

where
is equal to the acceleration as given in Newton's notation. Now we perform a Taylor Series expansion on this equation but we will be ignoring the higher order terms. This is performed below.



The second equation is part of the expansion while the last equation is known as the equation of motion for the elastic bar which ignores the higher order terms of the expansion. The equation of motion is otherwise abbreviated as
. An expression for the force
can be obtained and the results are found below.

Putting this expression into the
yields the partial differential equation of motion (PDE of Motion) for the elastic bar.
![\displaystyle \frac{\partial }{\partial x}\left[ A(x) E(x) \frac{\partial u}{\partial x}\right] + f(x,t) = m(x) \ddot{u}](http://upload.wikimedia.org/math/a/7/6/a765f17a5d2b6b3c8d0c22f311ea1c6e.png)
In order to solve this equation two boundary conditions along with two initial conditions are needed. The two initial conditions are initial displacement and initial velocity. For the boundary conditions, two cases need to be considered. They are depicted below.
For case a, the two boundary conditions are as follows;


For case two the boundary conditions are as follows;


The initial conditions are specific to different problems
|
Composite Literature |
|---|
|
|
Debugged 2 Bar Truss System [edit]
Below is the code to the debugged two bar truss system. Since the modulus of elasticity and the areas for the given example were not the same the code had to be modified in order for it to run properly. Before the correction the code was running as if the all of the elements had the same modulus of elasticity and the same area. Below is the corrected code and the results from the corrected code. Functions PlaneTrussElemtens.m, NodalSoln.m and PlaneTrussResults.m were used in this code and the discription for these functions can be found in the functions section.
% Two bar truss example clear all; e = [3 5]; A = [1 2]; P = 7; L=[4 2]; alpha = pi/3; beta = pi/4; nodes = [0, 0; L(1)*cos(pi/2-alpha), L(1)*sin(pi/2-alpha); L(1)*cos(pi/2-alpha)+L(2)*sin(beta),L(1)*sin(pi/2-alpha)-L(2)*cos(beta)]; dof=2*length(nodes); conn=[1,2; 2,3]; lmm = [1, 2, 3, 4; 3, 4, 5, 6]; elems=size(lmm,1); K=zeros(dof); R = zeros(dof,1); debc = [1, 2, 5, 6]; ebcVals = zeros(length(debc),1); %load vector R = zeros(dof,1); R(4) = P; % Assemble global stiffness matrix K=zeros(dof); for i=1:elems lm=lmm(i,:); con=conn(i,:); k_local=e(i)*A(i)/L(i)*[1 -1; -1 1] k=PlaneTrussElement(e(i), A(i), nodes(con,:)) K(lm, lm) = K(lm, lm) + k; end K R % Nodal solution and reactions [d, reactions] = NodalSoln(K, R, debc, ebcVals) results=[]; for i=1:elems results = [results; PlaneTrussResults(e(i), A(i), ... nodes(conn(i,:),:), d(lmm(i,:)))]; end format short g results
Results from the debugged two bar truss code
k_local =
0.7500 -0.7500
-0.7500 0.7500
k =
0.5625 0.3248 -0.5625 -0.3248
0.3248 0.1875 -0.3248 -0.1875
-0.5625 -0.3248 0.5625 0.3248
-0.3248 -0.1875 0.3248 0.1875
k_local =
5 -5
-5 5
k =
2.5000 -2.5000 -2.5000 2.5000
-2.5000 2.5000 2.5000 -2.5000
-2.5000 2.5000 2.5000 -2.5000
2.5000 -2.5000 -2.5000 2.5000
K =
0.5625 0.3248 -0.5625 -0.3248 0 0
0.3248 0.1875 -0.3248 -0.1875 0 0
-0.5625 -0.3248 3.0625 -2.1752 -2.5000 2.5000
-0.3248 -0.1875 -2.1752 2.6875 2.5000 -2.5000
0 0 -2.5000 2.5000 2.5000 -2.5000
0 0 2.5000 -2.5000 -2.5000 2.5000
R =
0
0
0
7
0
0
d =
0
0
4.3520
6.1271
0
0
reactions =
-4.4378
-2.5622
4.4378
-4.4378
results =
1.7081 5.1244 5.1244
0.6276 3.138 6.276
>>
Comparison of Results [edit]
Once the code was corrected the same reaction results were obtained when comparing it to the statics methods that have been done in class. Below are the results to the statics method.
Finite Element Method:
Using this equation, we can now solve for the f(1) matrix and thus we find the values for the reactions:
Using this same procedure applied to element 2, we can solve for the values of the other two unknown reactions giving us:
Statics
Using the Euler cut method, you find the following components from the resultant P forces.
Six Bar Truss Example [edit]
Six Bar Truss Code [edit]
Below is the code for the six bar truss system found on page 226 in the the textbook. All six of the bars have the same modulus of elasticity (e) and the same area (A). The MATLAB functions of PlaneTrussElement.m, NodalSoln.m, and PlaneTrussResults.m are all found in the code. The descriptions and functions can be found below the results of the six bar truss system.
% Six bar truss example e = 200*10^3; A = 0.001*1000^2; P = 20000.; alpha = pi/6; nodes = 1000*[0, 0; 4, 0; 0, 3; 4, 3; 2, 2]; dof=2*length(nodes); conn=[1,2; 2,5; 5,3; 2,4; 1,5; 5,4]; lmm = [1, 2, 3, 4; 3, 4, 9, 10; 9, 10, 5, 6; 3, 4, 7, 8; 1, 2, 9, 10; 9, 10, 7, 8]; elems=size(lmm,1); K=zeros(dof); R = zeros(dof,1); debc = [1, 2, 5, 6, 7, 8]; ebcVals = zeros(length(debc),1); %load vector R = zeros(dof,1); R(3) = P*sin(alpha); R(4) = P*cos(alpha); % Assemble global stiffness matrix K=zeros(dof); for i=1:elems lm=lmm(i,:); con=conn(i,:); k=PlaneTrussElement(e, A, nodes(con,:)); K(lm, lm) = K(lm, lm) + k; end K R % Nodal solution and reactions [d, reactions] = NodalSoln(K, R, debc, ebcVals) results=[]; for i=1:elems results = [results; PlaneTrussResults(e, A, ... nodes(conn(i,:),:), d(lmm(i,:)))]; end format short g results
Results of the above code.
K = Columns 1 through 5 85355 35355 -50000 0 0 35355 35355 0 0 0 -50000 0 85355 -35355 0 0 0 -35355 1.0202e+005 0 0 0 0 0 71554 0 0 0 0 -35777 0 0 0 0 0 0 0 0 -66667 0 -35355 -35355 -35355 35355 -71554 -35355 -35355 35355 -35355 35777 Columns 6 through 10 0 0 0 -35355 -35355 0 0 0 -35355 -35355 0 0 0 -35355 35355 0 0 -66667 35355 -35355 -35777 0 0 -71554 35777 17889 0 0 35777 -17889 0 71554 35777 -71554 -35777 0 35777 84555 -35777 -17889 35777 -71554 -35777 2.1382e+005 0 -17889 -35777 -17889 0 1.0649e+005 R = 0 0 10000 17321 0 0 0 0 0 0 d = 0 0 0.21311 0.24998 0 0 0 0 -0.0060971 0.012242 reactions = -10873 -217.27 874.27 -437.13 -1.7279 -16666 results = 5.3276e-005 10.655 10655 -4.6334e-006 -0.92669 -926.69 -4.8873e-006 -0.97746 -977.46 -8.3326e-005 -16.665 -16665 1.5363e-006 0.30727 307.27 -9.659e-009 -0.0019318 -1.9318 >>
Functions [edit]
The functions PlaneTrussElement.m, NodalSoln.m, PlaneTrussResults.m were all called in the code for the 5 truss system. They are all necessary for the completion of the truss problem.
PlaneTrussElement.m
This function take the Young's Modulus (e), the Area of the element (A) and the coordinates of the element ends (coord) and generates the stiffness matrix for a plane truss element. The function first calculates the lengths of the the elements. Once those are calculated the stiffness matrix is calculated.
function k = PlaneTrussElement(e, A, coord) % PlaneTrussElement(e, A, coord) % Generates stiffness matrix for a plane truss element % e = modulus of elasticity % A = area of cross-section % coord = coordinates at the element ends x1=coord(1,1); y1=coord(1,2); x2=coord(2,1); y2=coord(2,2); L=sqrt((x2-x1)^2+(y2-y1)^2); ls=(x2-x1)/L; ms=(y2-y1)/L; k = e*A/L*[ls^2, ls*ms,-ls^2,-ls*ms; ls*ms, ms^2,-ls*ms,-ms^2; -ls^2,-ls*ms,ls^2,ls*ms; -ls*ms,-ms^2,ls*ms,ms^2];
NodalSoln.m
The function takes the global coefficient matrix (K), the global right hand side vector (R), the list of degrees of freedom with specified values, and the specified values to determine the displacements and reactions at each node. The dof of the the system is first found by using the length command which finds the longest dimension of R. df then finds the difference between the dofs that have known values (a value of zero) and the dof that were found in the previous line. The displacements and the reactions are then calculated.
function [d, rf] = NodalSoln(K, R, debc, ebcVals) % [nd, rf] = NodalSoln(K, R, debc, ebcVals) % Computes nodal solution and reactions % K = global coefficient matrix % R = global right hand side vector % debc = list of degrees of freedom with specified values % ebcVals = specified values dof = length(R); df = setdiff(1:dof, debc); Kf = K(df, df); Rf = R(df) - K(df, debc)*ebcVals; dfVals = Kf\Rf; d = zeros(dof,1); d(debc) = ebcVals; d(df) = dfVals; rf = K(debc,:)*d - R(debc);
PlaneTrussResults.m
This function computes the plane truss element results. It takes in the modulus of elasticity (e), the area of the cross-section (A), the coordinates at the element ends (coord), and the displacements at the elemtent ends (disps) and calculates the axial strain (eps), stress(sigma) and force (force). The results are stored in the variable results and sent back to the main program.
function results = PlaneTrussResults(e, A, coord, disps) % results = PlaneTrussResults(e, A, coord, disps) % Compute plane truss element results % e = modulus of elasticity % A = Area of cross-section % coord = coordinates at the element ends % disps = displacements at element ends % The output quantities are eps = axial strain % sigma = axial stress and force = axial force. x1=coord(1,1); y1=coord(1,2); x2=coord(2,1); y2=coord(2,2); L=sqrt((x2-x1)^2+(y2-y1)^2); ls=(x2-x1)/L; ms=(y2-y1)/L; T=[ls,ms,0,0; 0,0,ls,ms]; d = T*disps; eps= (d(2)-d(1))/L; sigma = e.*eps; force = sigma.*A; results=[eps, sigma, force];
Plot of Six Bar Truss System [edit]
Below is the code and the plot of the six bar truss system. The plot was made from the results that were found in the above code. The results demonstrate that only node 2 and node 5 had a displacement of (0.2131, 0.2500) and (-0.0061, 0.0122) respectively. The undeformed system is plotted with the dotted lines and the deformed system is plotted with solid lines. The deformed displacements have been scaled up by a factor of 1.2 in order to enhance in the plot.
%Plot Six beam truss system % clear; close; %model with 2-D beam elements dof = 2; %dof per node: axial disp x, 2= disp y %obtain the coordinatates of all nodes % n_node = 5; %number of nodes n_elem = 6; %number of elements total_dof = 2 * n_node; %total dof of system position(:, 1) = [0; 0]; position(:, 2) = [4; 0]; position(:, 3) = [0; 3]; position(:, 4) = [4; 3]; position(:, 5) = [2; 2]; % print the node coord. for i = 1 : n_node; x(i) = position (1,i); y(i) = position (2,i); end node_connect (1, 1) = 1; %element 1 node_connect (2, 1) = 2; node_connect (1, 2) = 2; %element 2 node_connect (2, 2) = 5; node_connect (1, 3) = 3; %element 3 node_connect (2, 3) = 5; node_connect (1, 4) = 2; %element 4 node_connect (2, 4) = 4; node_connect (1, 5) = 1; %element 5 node_connect (2, 5) = 5; node_connect (1, 6) = 5; %element 6 node_connect (2, 6) = 4; % connect all beam elements by connectivity array for i = 1 : n_elem; node_1 = node_connect(1,i); node_2 = node_connect(2,i); xx = [x(node_1),x(node_2)]; yy = [y(node_1),y(node_2)]; axis([ -1 7 -1 5]) plot(xx,yy,'--') hold on end text(x(node_connect(1,1)),y(node_connect(1,1))-.2,'Global Node 1', 'HorizontalAlignment', 'center') text(x(node_connect(1,2)),y(node_connect(1,2))-.2,'Global Node 2', 'HorizontalAlignment', 'center') text(x(node_connect(1,3))-.22,y(node_connect(1,3))+.2,'Global Node 3', 'HorizontalAlignment', 'center') text(x(node_connect(2,4))+.6,y(node_connect(2,4))+.8,'Global Node 4', 'HorizontalAlignment', 'center') text(x(node_connect(1,6))-1.27,y(node_connect(1,6)),'Global Node 5', 'HorizontalAlignment', 'center') text (x(node_connect(2,1))*1.1-2,y(node_connect(2,1))/2 -.2,'Element 1', 'HorizontalAlignment', 'center') text (x(node_connect(2,1))-1.6, y(node_connect(2,1))+1 ,'Element 2', 'HorizontalAlignment', 'center') text( x(node_connect(2,3))/2 -1, y(node_connect(2,3))/2 ,'Element 3', 'HorizontalAlignment', 'center') text( x(node_connect(2,4))/2 + 1, y(node_connect(2,4))*1.1 ,'Element 4', 'HorizontalAlignment', 'center') text( x(node_connect(1,4))*1.5-1.2, y(node_connect(2,3))*.85+.65 ,'Element 5', 'HorizontalAlignment', 'center') hold on %Displacements were multiplied by a factor of 1.2 in order for them to show up %in the plot position_disp(:, 1) = [0; 0]; position_disp(:, 2) = [5.2133 * 1.2; .25 * 1.2]; position_disp(:, 3) = [0; 3 * 1.2]; position_disp(:, 4) = [4 * 1.2; 3 * 1.2]; position_disp(:, 5) = [1.5439 * 1.2; 2.0122 * 1.2]; % print the node coord. for i = 1 : n_node;0 x(i) = position_disp (1,i); y(i) = position_disp (2,i); end node_connect_disp (1, 1) = 1; %element 1 node_connect_disp (2, 1) = 2; node_connect_disp (1, 2) = 2; %element 2 node_connect_disp (2, 2) = 5; node_connect_disp (1, 3) = 3; %element 3 node_connect_disp (2, 3) = 5; node_connect_disp (1, 4) = 2; %element 4 node_connect_disp (2, 4) = 4; node_connect_disp (1, 5) = 1; %element 5 node_connect_disp (2, 5) = 5; node_connect_disp (1, 6) = 5; %element 6 node_connect_disp (2, 6) = 4; % connect all beam elements by connectivity array for i = 1 : n_elem; node_1 = node_connect_disp(1,i); node_2 = node_connect_disp(2,i); xx = [x(node_1),x(node_2)]; yy = [y(node_1),y(node_2)]; axis([ -1 7 -1 5]) plot(xx,yy,'-') hold on end title ('Five Bar Truss System') xlabel('x') ylabel('y')
| I, the copyright holder of this work, hereby release my work worldwide into the public domain. Where this is not legally possible, I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law. |
| This is a candidate to be copied to the Wikimedia Commons. Appropriately licensed media are more accessible to other Wikimedia projects if placed on Commons. Any user may perform this move—please see Moving images to the Commons for more information.
Please remove this tag after this image has been copied to Commons. Copy to Commons via CommonsHelper |
Six Bar Truss Code for Elements with Varying E [edit]
Next, the six bar truss Matlab code used above, was modified to allow for different values of E for each element. This code uses all the same functions as above (i.e. PlaneTrussElement.m, PlaneTrussResults.m and NodalSoln.m). The modified code is shown below.
The results from this situation, as well as the constant E case and the undeformed truss system are shown in the plot below. The varying E case is shown by the dotted nodes while the undeformed case is shown dashed. The element and node numbers are suppressed to avoid cluttering the diagram.
The code used to create this plot is very similar to that shown above for the six bar truss with constant E, but repeated for the two deformation cases.
Three Bar Space Truss [edit]
Three Bar Space Truss Example [edit]
Below is the code for the the 3D three bar truss system found in the textbook on page 230. There are four nodes in the system with each node containing 3 degrees of freedom. The code uses three additional functions for it to be run. SpaceTrussElement.m, NodalSoln.m, and NodalSoln.m were all used for the code. Below this code a description of each function can be found.
% Three bar space truss example a1 = 200; a2 = 600; e = 200000; P = 20000; nodes = 1000*[.96, 1.92, 0; -1.44, 1.44, 0; 0, 0, 0; 0, 0, 2]; dof=3*length(nodes); conn=[1,4; 2,4; 3,4]; lmm = [1, 2, 3, 10, 11, 12; 4, 5, 6, 10, 11, 12; 7, 8, 9, 10, 11, 12]; debc = [1:9]; ebcVals = zeros(length(debc),1); %load vector R = zeros(dof,1); R(11) = -P; % Assemble global stiffness matrix K=zeros(dof); for i=1:2 lm=lmm(i,:); con=conn(i,:); k=SpaceTrussElement(e, a1, nodes(con,:)); K(lm, lm) = K(lm, lm) + k; end lm=lmm(3,:); con=conn(3,:); k=SPaceTrussElement(e, a2, nodes(con,:)); K(lm, lm) = K(lm, lm) + k % Nodal solution and reactions [d, reactions] = NodalSoln(K, R, debc, ebcVals) results=[]; for i=1:2 results = [results; SpaceTrussResults(e, a1, ... nodes(conn(i,:),:), d(lmm(i,:)))]; end results = [results; SpaceTrussResults(e, a2, ... nodes(conn(3,:),:), d(lmm(3,:)))]; format short g results
Functions [edit]
The functions SpaceTrussElement.m, NodalSoln.m, SpaceTrussResults.m were all called in the code for the 5 truss system. They are all necessary for the completion of the truss problem.
SpaceTrussElement.m This function creates the stiffness matrix of a space truss element. It takes in the modulus of elacticity (e), the truss area (A), and the corresponding coordinates for the truss. The function first calculates the length of each element and then calculates the stiffness matrix (k).
function k = SpaceTrussElement(e, A, coord) % k = SpaceTrussElement(e, A, coord) % Generates stiffness matrix of a space truss element % e = modulus of elasticity % A = Area of cross-section % coord = coordinates at the element ends x1=coord(1,1); y1=coord(1,2); z1=coord(1,3); x2=coord(2,1); y2=coord(2,2); z2=coord(2,3); L=sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2); ls=(x2-x1)/L; ms=(y2-y1)/L; ns=(z2-z1)/L; k = e*A/L*[ls^2, ls*ms, ls*ns, -ls^2, -(ls*ms), -(ls*ns); ls*ms, ms^2, ms*ns, -(ls*ms), -ms^2, -(ms*ns); ls*ns, ms*ns, ns^2, -(ls*ns), -(ms*ns), -ns^2; -ls^2, -(ls*ms), -(ls*ns), ls^2, ls*ms, ls*ns; -(ls*ms), -ms^2, -(ms*ns), ls*ms, ms^2, ms*ns; -(ls*ns), -(ms*ns), -ns^2, ls*ns, ms*ns, ns^2];
NodalSoln.m
The function takes the global coefficient matrix (K), the global right hand side vector (R), the list of degrees of freedom with specified values, and the specified values to determine the displacements and reactions at each node. The dof of the the system is first found by using the length command which finds the longest dimension of R. df then finds the difference between the dofs that have known values (a value of zero) and the dof that were found in the previous line. The displacements and the reactions are then calculated.
function [d, rf] = NodalSoln(K, R, debc, ebcVals) % [nd, rf] = NodalSoln(K, R, debc, ebcVals) % Computes nodal solution and reactions % K = global coefficient matrix % R = global right hand side vector % debc = list of degrees of freedom with specified values % ebcVals = specified values dof = length(R); df = setdiff(1:dof, debc); Kf = K(df, df); Rf = R(df) - K(df, debc)*ebcVals; dfVals = Kf\Rf; d = zeros(dof,1); d(debc) = ebcVals; d(df) = dfVals; rf = K(debc,:)*d - R(debc);
SpaceTrussResults.m
This function takes in the modulus of elasticity (e), the area of each truss (A), the coordinate of the nodes and the displacements (disps) at the element ends. It calculates the axial strain (eps), stress(sigma) and force (force). The results are stored in the variable results and sent back to the main program.
function results = SpaceTrussResults(e, A, coord, disps) % results = SpaceTrussResults(e, A, coord, disps) % Compute space truss element results % e = modulus of elasticity % A = Area of cross-section % coord = coordinates at the element ends % disps = displacements at element ends x1=coord(1,1); y1=coord(1,2); z1=coord(1,3); x2=coord(2,1); y2=coord(2,2); z2=coord(2,3); L=sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2); ls=(x2-x1)/L; ms=(y2-y1)/L; ns=(z2-z1)/L; T=[ls,ms,ns,0,0,0; 0,0,0,ls,ms,ns]; d = T*disps; eps= (d(2)-d(1))/L; sigma = e.*eps; force = sigma.*A; results=[eps, sigma, force];
3 Bar Space Truss Results [edit]
Below are the results from the three bar space truss example.
K = 1.0e+004 * Columns 1 through 7 0.1460 0.2919 -0.3041 0 0 0 0 0.2919 0.5839 -0.6082 0 0 0 0 -0.3041 -0.6082 0.6335 0 0 0 0 0 0 0 0.3567 -0.3567 0.4954 0 0 0 0 -0.3567 0.3567 -0.4954 0 0 0 0 0.4954 -0.4954 0.6880 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.1460 -0.2919 0.3041 -0.3567 0.3567 -0.4954 0 -0.2919 -0.5839 0.6082 0.3567 -0.3567 0.4954 0 0.3041 0.6082 -0.6335 -0.4954 0.4954 -0.6880 0 Columns 8 through 12 0 0 -0.1460 -0.2919 0.3041 0 0 -0.2919 -0.5839 0.6082 0 0 0.3041 0.6082 -0.6335 0 0 -0.3567 0.3567 -0.4954 0 0 0.3567 -0.3567 0.4954 0 0 -0.4954 0.4954 -0.6880 0 0 0 0 0 0 0 0 0 0 0 6.0000 0 0 -6.0000 0 0 0.5026 -0.0647 0.1913 0 0 -0.0647 0.9405 -1.1036 0 -6.0000 0.1913 -1.1036 7.3216 d = 0 0 0 0 0 0 0 0 0 -0.1871 -2.5920 -0.3858 reactions = 1.0e+004 * 0.6667 1.3333 -1.3889 -0.6667 0.6667 -0.9259 0 0 2.3148 results = 0.00050936 101.87 20375 0.00033036 66.072 13214 -0.0001929 -38.58 -23148 >>
Code for the lot of the 3 Bar Space Truss [edit]
Below is the code for the 3 Bar Space Truss.
%Plot three beam truss system % clear; close; %model with 2-D beam elements dof = 3; %dof per node: axial disp x, 2= disp y %obtain the coordinatates of all nodes % n_node = 4; %number of nodes n_elem = 3; %number of elements total_dof = 3 * n_node; %total dof of system position(:, 1) = [-.96; 1.92; 0 ]; position(:, 2) = [-1.44; 1.44; 0 ]; position(:, 3) = [0; 0; 0 ]; position(:, 4) = [0; 0; 2] % print the node coord. for i = 1 : n_node; x(i) = position (1,i); y(i) = position (2,i); z(i) = position (3,i); end node_connect (1, 1) = 1; %element 1 node_connect (2, 1) = 4; node_connect (1, 2) = 2; %element 2 node_connect (2, 2) = 4; node_connect (1, 3) = 3; %element 3 node_connect (2, 3) = 4; % connect all beam elements by connectivity array for i = 1 : n_elem; node_1 = node_connect(1,i); node_2 = node_connect(2,i); xx = [x(node_1),x(node_2)]; yy = [y(node_1),y(node_2)]; zz = [z(node_1),z(node_2)]; axis([ -3 3 -3 3 -3 3]) plot3(xx,yy,zz,'--') view([1,1,1]) hold on end text(x(node_connect(1,1)),y(node_connect(1,1)),z(node_connect(1,1))-.5,'Global Node 1', 'HorizontalAlignment', 'center') text(x(node_connect(1,2))-1,y(node_connect(1,2)),z(node_connect(1,2))+.3,'Global Node 2', 'HorizontalAlignment', 'center') text(x(node_connect(1,3)),y(node_connect(1,3)),z(node_connect(1,3))-.5,'Global Node 3', 'HorizontalAlignment', 'center') text(x(node_connect(2,3)),y(node_connect(2,3)),z(node_connect(2,3))+.5,'Global Node 4', 'HorizontalAlignment', 'center') %text (x(node_connect(1,1))/2,y(node_connect(1,1))/2 +1,'Element 1', 'HorizontalAlignment', 'center') %text (x(node_connect(2,2))/2 -1, y(node_connect(2,2))/2 -.5,'Element 2', 'HorizontalAlignment', 'center') %text( x(node_connect(2,3))/2, y(node_connect(2,3))*.75 ,'Element 3', 'HorizontalAlignment', 'center') %Scaled by 1/10 position_disp(:, 1) = [-.96; 1.92; 0 ]; position_disp(:, 2) = [-1.44; 1.44; 0 ]; position_disp(:, 3) = [0; 0; 0 ]; position_disp(:, 4) = [-0.1871; -2.5920; 2 + -0.3858] % print the node coord. for i = 1 : n_node;0 x(i) = position_disp (1,i); y(i) = position_disp (2,i); z(i) = position_disp (3,i); end node_connect_disp (1, 1) = 1; %element 1 node_connect_disp (2, 1) = 4; node_connect_disp (1, 2) = 2; %element 2 node_connect_disp (2, 2) = 4; node_connect_disp (1, 3) = 3; %element 3 node_connect_disp (2, 3) = 4; % connect all beam elements by connectivity array for i = 1 : n_elem; node_1 = node_connect_disp(1,i); node_2 = node_connect_disp(2,i); xx = [x(node_1),x(node_2)]; yy = [y(node_1),y(node_2)]; zz = [z(node_1),z(node_2)]; axis([ -3 3 -3 3 -3 3]) view([1,1,1]) plot3(xx,yy,zz,'-') hold on end title ('Three Bar Space Truss System') xlabel('x') ylabel('y') zlabel('z')
Plot of 3 Bar Space Truss [edit]
Below is the plot of the 3 bar Space truss with the viewing mode of x = 1m, y = 1m, and z= 1m. The dotted lines represent the undeformed truss system and the solid lines represent the deformed truss system.
| I, the copyright holder of this work, hereby release my work worldwide into the public domain. Where this is not legally possible, I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law. |
| This is a candidate to be copied to the Wikimedia Commons. Appropriately licensed media are more accessible to other Wikimedia projects if placed on Commons. Any user may perform this move—please see Moving images to the Commons for more information.
Please remove this tag after this image has been copied to Commons. Copy to Commons via CommonsHelper |
Below is the same plot but in plane view down the x axis, plane view down the y axis, and plane view down the z axis.
| I, the copyright holder of this work, hereby release my work worldwide into the public domain. Where this is not legally possible, I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law. |
| This is a candidate to be copied to the Wikimedia Commons. Appropriately licensed media are more accessible to other Wikimedia projects if placed on Commons. Any user may perform this move—please see Moving images to the Commons for more information.
Please remove this tag after this image has been copied to Commons. Copy to Commons via CommonsHelper |
| I, the copyright holder of this work, hereby release my work worldwide into the public domain. Where this is not legally possible, I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law. |
| This is a candidate to be copied to the Wikimedia Commons. Appropriately licensed media are more accessible to other Wikimedia projects if placed on Commons. Any user may perform this move—please see Moving images to the Commons for more information.
Please remove this tag after this image has been copied to Commons. Copy to Commons via CommonsHelper |
| I, the copyright holder of this work, hereby release my work worldwide into the public domain. Where this is not legally possible, I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law. |
| This is a candidate to be copied to the Wikimedia Commons. Appropriately licensed media are more accessible to other Wikimedia projects if placed on Commons. Any user may perform this move—please see Moving images to the Commons for more information.
Please remove this tag after this image has been copied to Commons. Copy to Commons via CommonsHelper |
3-D Truss Relationships [edit]
This process is very similar to that of the 2-D case. Therefore we will be taking the same steps to derive the Force-Displacement relationships. The elemental axial force displacement relationship is identical to the 2-D case and is shown below.

Since the 3-D case will have three displacements at each node, the element displacement matrix will be a six by one (6x1) as will the element force matrix. These matrices are shown below.


For the 3-D case the two by six (2x6) transformation matrix
that relates the axial degrees of freedom to the global degrees of freedom is shown below.

This transformation matrix can be used to relate the axial and global degrees of freedom and forces as shown below.

It can also be used to relate the global forces to the local axial forces. This is shown below.

Using the Principle of Virtual Work, the global FD relationship is given by:

Also, we can represent the elemental matrix
in terms of the axial matrix
and the transformation matrix,
. This is shown below:

Lastly, the relationship between the element forces in global coordinates,
, and the axial forces,
, can be found using the transformation matrix,
.

Or more detailed:

Using the above derived equation for
, we can give the actual values for its elements. Multiplying out the right side of the equation gives us the following:


This is the elemental stiffness matrix,
for element e.
Contributing Members [edit]
Eml4500.f08.RAMROD.A 21:11, 7 November 2008 (UTC)
EML4500.F08.RAMROD.B 19:54, 7 November 2008 (UTC)
EML4500.f08.RAMROD.E 18:05, 6 November 2008 (UTC)
Eml4500.f08.ramrod.D 01:59, 7 November 2008 (UTC)
Eml4500.f08.ramrod.c 19:11, 7 November 2008 (UTC)
Eml4500.f08.RAMROD.F 20:36, 7 November 2008 (UTC)
![\mathbf{w}^T_{1x6} = [1\; 0\; 0\; 0\; 0\; 0]_{1x6}](http://upload.wikimedia.org/math/2/1/6/2160e1d382dec821f3983e48d6171fad.png)
![\mathbf{w}\bullet(\mathbf{Kd}-\mathbf{F}) = 1[\sum_{j=1}^6{K_{1j}d_{j}-F_{1}}] + 0[\sum_{j=1}^6{K_{2j}d_{j}-F_{2}}]+...+0[\sum_{j=1}^6{K_{6j}d_{j}-F_{6}}]](http://upload.wikimedia.org/math/f/d/d/fddebc56016f43833e4ae8308b3f592e.png)
(This is the 1st Equation)![\mathbf{w}^T_{1x6} = [0\; 1\; 0\; 0\; 0\; 0]_{1x6}](http://upload.wikimedia.org/math/1/6/0/160920f275f41f3fb37f1ab4f68242b9.png)
![\mathbf{w}\bullet(\mathbf{Kd}-\mathbf{F}) = 0[\sum_{j=1}^6{K_{1j}d_{j}-F_{1}}] + 1[\sum_{j=1}^6{K_{2j}d_{j}-F_{2}}]+0[\sum_{j=1}^6{K_{3j}d_{j}-F_{3}}]+...+0[\sum_{j=1}^6{K_{6j}d_{j}-F_{6}}]](http://upload.wikimedia.org/math/3/8/9/3895b90cefeb0dedc26e272517f1a38c.png)
(This is the 1st Equation)![\mathbf{w}^T_{1x6} = [0\; 0\; 1\; 0\; 0\; 0]_{1x6}](http://upload.wikimedia.org/math/4/1/c/41c728c98792650f5d37bec1f235e7c6.png)
![\mathbf{w}\bullet(\mathbf{Kd}-\mathbf{F}) = 0[\sum_{j=1}^6{K_{1j}d_{j}-F_{1}}] + 0[\sum_{j=1}^6{K_{2j}d_{j}-F_{2}}]+1[\sum_{j=1}^6{K_{3j}d_{j}-F_{3}}]+0[\sum_{j=1}^6{K_{4j}d_{j}-F_{4}}]...+0[\sum_{j=1}^6{K_{6j}d_{j}-F_{6}}]](http://upload.wikimedia.org/math/8/7/6/876da689e0d925144a9073a666b16f5d.png)
(This is the 3rd Equation)![\mathbf{w}^T_{1x6} = [0\; 0\; 0\; 1\; 0\; 0]_{1x6}](http://upload.wikimedia.org/math/c/d/d/cdd88c4dafc5ecc1b6862a6d7a0af95c.png)
![\mathbf{w}\bullet(\mathbf{Kd}-\mathbf{F}) = 0[\sum_{j=1}^6{K_{1j}d_{j}-F_{1}}] + ...+ 0[\sum_{j=1}^6{K_{3j}d_{j}-F_{3}}]+1[\sum_{j=1}^6{K_{4j}d_{j}-F_{4}}]+0[\sum_{j=1}^6{K_{5j}d_{j}-F_{5}}]+0[\sum_{j=1}^6{K_{6j}d_{j}-F_{6}}]](http://upload.wikimedia.org/math/8/9/0/8903b08ebf184cef6e1f219ca61356de.png)
(This is the 4th Equation)![\mathbf{w}^T_{1x6} = [0\; 0\; 0\; 0\; 1\; 0]_{1x6}](http://upload.wikimedia.org/math/6/4/5/645d1d35641ffe46ee74196b0f73a42e.png)
![\mathbf{w}\bullet(\mathbf{Kd}-\mathbf{F}) = 0[\sum_{j=1}^6{K_{1j}d_{j}-F_{1}}] + ...+ 0[\sum_{j=1}^6{K_{4j}d_{j}-F_{4}}]+1[\sum_{j=1}^6{K_{5j}d_{j}-F_{5}}]+0[\sum_{j=1}^6{K_{6j}d_{j}-F_{6}}]](http://upload.wikimedia.org/math/5/7/0/5706269ecb626b67a4afcef89b1e05b0.png)
(This is the 5th Equation)![\mathbf{w}^T_{1x6} = [0\; 0\; 0\; 0\; 0\; 1]_{1x6}](http://upload.wikimedia.org/math/a/1/3/a136206c6b49ac1532ba6e5e94d06c56.png)
![\mathbf{w}\bullet(\mathbf{Kd}-\mathbf{F}) = 0[\sum_{j=1}^6{K_{1j}d_{j}-F_{1}}] + ...+ 0[\sum_{j=1}^6{K_{5j}d_{j}-F_{5}}]+1[\sum_{j=1}^6{K_{6j}d_{j}-F_{6}}]](http://upload.wikimedia.org/math/5/7/3/5733d79f41d871cd1392302704f2c2f6.png)
(This is the 6th Equation)
Thus proving Equation (3) is true
Equation









