User:Eml4500.f08.bike.mcdonald/homework report 5
See my comments below. Please don't remove these comments in case you amend your work; just add a comment in these comment boxes to say what you did. Eml4500.f08 12:56, 10 November 2008 (UTC)
Class Notes [edit]
Principal of Virtual Work [edit]
To justify the elimination of rows 1, 2, 5, and 6 in order to obtain K as a 2x2 matrix in a 2-bar truss, the FD relation

Can be rearranged to be:
(1)
Which is designated to be equation 1.
Utilizing the principle of virtual work, equation 1 becomes:
(2)
Where W is a 6x1 matrix and Kd - F is a 6x1, and 0 is a scalar number. This equation is designated as equation 2. This equation is true for all values of W and W is called the weighting matrix.
Considering this, Equation 2 being true implies Equation one is also true, and vice versa.
The proof going from Equation 1 to 2 is trivial. However, going from two to one is not trivial and to do this we must choose different values for W
1st Choice:
Choose W so that

Therefore

and
![\mathbf{W} \cdot ( \mathbf{Kd-F} )
= 1[ \sum^6_{j=1} \mathbf{K}_{1j} \mathbf{d}_j- \mathbf{F}_1]
+ 0[ \sum^6_{j=1} \mathbf{K}_{2j} \mathbf{d}_j- \mathbf{F}_2]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{3j} \mathbf{d}_j- \mathbf{F}_3]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{4j} \mathbf{d}_j- \mathbf{F}_4]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{5j} \mathbf{d}_j- \mathbf{F}_5]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{6j} \mathbf{d}_j- \mathbf{F}_6]](http://upload.wikimedia.org/math/7/a/0/7a046af302245f2e9e110f0fff62186c.png)
Thus, the result becomes

Which is designated to be equation (a).
2nd Choice:
Choose W such that W2=1, W1=W3=W4=W5=W6=0 so that:

Therefore:
![\mathbf{W} \cdot ( \mathbf{Kd-F} )
= 0[ \sum^6_{j=1} \mathbf{K}_{1j} \mathbf{d}_j- \mathbf{F}_1]
+ 1[ \sum^6_{j=1} \mathbf{K}_{2j} \mathbf{d}_j- \mathbf{F}_2]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{3j} \mathbf{d}_j- \mathbf{F}_3]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{4j} \mathbf{d}_j- \mathbf{F}_4]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{5j} \mathbf{d}_j- \mathbf{F}_5]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{6j} \mathbf{d}_j- \mathbf{F}_6]](http://upload.wikimedia.org/math/7/c/7/7c7cf2003473070119ca449bf428aae7.png)
Thus, the result becomes

Which is designated to be equation (b)
3rd Choice: C hoose W such that W3=1, W1=W2=W4=W5=W6=0 so that

![\mathbf{W} \cdot ( \mathbf{Kd-F} )
= 0[ \sum^6_{j=1} \mathbf{K}_{1j} \mathbf{d}_j- \mathbf{F}_1]
+ 0[ \sum^6_{j=1} \mathbf{K}_{2j} \mathbf{d}_j- \mathbf{F}_2]
+ 1 [ \sum^6_{j=1} \mathbf{K}_{3j} \mathbf{d}_j- \mathbf{F}_3]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{4j} \mathbf{d}_j- \mathbf{F}_4]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{5j} \mathbf{d}_j- \mathbf{F}_5]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{6j} \mathbf{d}_j- \mathbf{F}_6]](http://upload.wikimedia.org/math/d/0/7/d079508e3b02abceb28d000d0e2a7f1e.png)
Thus, the result becomes 
Which is designated to be equation (c)
Choice 4:
Choose W such that W4=1, W1=W2=W3=W5=W6=0 so that

![\mathbf{W} \cdot ( \mathbf{Kd-F} )
= 0[ \sum^6_{j=1} \mathbf{K}_{1j} \mathbf{d}_j- \mathbf{F}_1]
+ 0[ \sum^6_{j=1} \mathbf{K}_{2j} \mathbf{d}_j- \mathbf{F}_2]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{3j} \mathbf{d}_j- \mathbf{F}_3]
+ 1 [ \sum^6_{j=1} \mathbf{K}_{4j} \mathbf{d}_j- \mathbf{F}_4]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{5j} \mathbf{d}_j- \mathbf{F}_5]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{6j} \mathbf{d}_j- \mathbf{F}_6]](http://upload.wikimedia.org/math/3/6/c/36c0a41d757d4237eac94307e2b5e5c3.png)
Thus, the result becomes 
This is designated to be equation (d)
Choice 5:
Choose W such that W5=1, W1=W2=W3=W4=W6=0 so that

![\mathbf{W} \cdot ( \mathbf{Kd-F} )
= 0[ \sum^6_{j=1} \mathbf{K}_{1j} \mathbf{d}_j- \mathbf{F}_1]
+ 0[ \sum^6_{j=1} \mathbf{K}_{2j} \mathbf{d}_j- \mathbf{F}_2]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{3j} \mathbf{d}_j- \mathbf{F}_3]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{4j} \mathbf{d}_j- \mathbf{F}_4]
+ 1 [ \sum^6_{j=1} \mathbf{K}_{5j} \mathbf{d}_j- \mathbf{F}_5]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{6j} \mathbf{d}_j- \mathbf{F}_6]](http://upload.wikimedia.org/math/2/a/e/2aeb890e8a1205e35524936677f071d4.png)
Thus, the result becomes 
This is designated to be equation (e)
Choice 6:
Choose W such that W6=1, W1=W2=W3=W4=W5=0 so that

![\mathbf{W} \cdot ( \mathbf{Kd-F} )
= 0[ \sum^6_{j=1} \mathbf{K}_{1j} \mathbf{d}_j- \mathbf{F}_1]
+ 0[ \sum^6_{j=1} \mathbf{K}_{2j} \mathbf{d}_j- \mathbf{F}_2]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{3j} \mathbf{d}_j- \mathbf{F}_3]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{4j} \mathbf{d}_j- \mathbf{F}_4]
+ 0 [ \sum^6_{j=1} \mathbf{K}_{5j} \mathbf{d}_j- \mathbf{F}_5]
+ 1 [ \sum^6_{j=1} \mathbf{K}_{6j} \mathbf{d}_j- \mathbf{F}_6]](http://upload.wikimedia.org/math/3/a/d/3ada86ac1beee69b93c453532829dcf3.png)
so that the result becomes 
This equation is designated to be equation (f)
Thus, when the equations (a) through (f) are combined, they become
which is equation (1) from before.
The weighting coefficients must be kinetically admissible which means they cannot violate the boundary conditions so W1 = W2 = W5= W6=0 where the weighting coefficients represent the virtual displacement.
Now,

Where Kd is a 6x2 matrix minus a 2x1 vector.
Thus
(3)
Which is designated as Equation 3.
and is true for all values of 
and the K matrix is reduced to 
as well as:


being the reduced F and d matrices.
Analysis of The Axial Force Displacement Relation Using The Principle of Virtual Work. [edit]
Recall:

An example of the use of a weighting factor is shown in the computation of our course grade. This computation is shown below.
Course Grade = 
The weighting factors used in the above computation are
and 
Deriving the following relation,

and also recalling the following Force Displacement relation with axial degrees of freedom,

By subtracting the force matrix
, the relation is now written as follows.
Equation (1)
Now, the Principle of Virtual Work can be applied, and it is shown below.
Equation (2)
This equation holds true for all
.
Assigned HW - Prove that equation (1) equation (2) |
|---|
|
The first step is to select a W such that
The first equation can be rewritten as shown.
Then, this same procedure is going to be repeated five times, for each element in W being equal to one.
The second equation can be rewritten as shown.
The third equation can be rewritten as shown.
The fourth equation can be rewritten as shown.
The fifth equation can be rewritten as shown.
The sixth equation can be rewritten as shown.
In conclusion, the equations that were computed above become equation (1), shown below.
This proves that equation (1) |
Principle of Virtual Work Conversion to Force Displacement Equation [edit]
= virtual axial displacement corresponding to
.
= virtual displacement in global coordinate system, corresponding to
.
Substituting Equations (3) and (4) into Equation (2) yields the following Equation:
for all 
In order to solve Equation (5), a few matrix operations must be recalled:
| Assigned HW - Verification of Equation (6) Example. | |
|---|---|
|
|
To solve Equation (5), Equation (6) and (7) must be applied:
The dot product must be replaced with the transpose as shown below from Equation (7).
for all 
The matrix transpose is replaced with the product of individual transposes from Equation (6).
for all 
After distributing the transpose matrix T the following equation is the result.
for all 
replaced
, and
replaced
.
The resulting equation is:
for all 
After dividing both sides by w, and moving f(e) to the other side yielded:

The previous methods have all been for discrete, non-continuous cases (matrices), and the new analytic methods will be for continuous cases (PDEs).
Motivational Model Problem:
An elastic bar with varying A(x) and E(x) is subject to a varying axial load (distributed), concentrated load, and inertia force (dynamic). Both the axial and concentrated loads are time dependent. The figure below depicts the problem.
Equation of Motion, Constitutive Relation, PDE of Motion, and Boundary Condition Derivation [edit]
| Assigned HW - Literature Research of Composite Materials. | |
|---|---|
|
Composite materials are complex materials made from multiple substances, called constituents, that have significantly different physical or chemical properties. Although the materials making up the composite act in concert, they do not merge completely and each contains its own identity. For this reason two or more materials could be combined in order to take advantage of the good characteristics of each material. Composites usually consist of two components, the matrix and the filler. The matrix holds the filler in an orderly pattern, and helps transfer the load among the filler. Fillers can be any material, such as ceramic, carbon fiber, or sand, and are usually added in order to increase the strength of the composite. Concrete is an example of a composite, where the cement is the matrix and the sand acts as the filler. Composites can be classified into 4 different types depending on the filler: Particulate - The filler particles have roughly equal dimensions in all directions, such as resin powder or gravel. The particles are very close to spherical, but do not have to be perfectly round. References: http://www.science.org.au/nova/059/059key.htm |
The free body diagram of section dx can be seen below in Figure 1.
Summing the forces in the x direction yields

⇨ 
The dx terms are canceled out of this equation, as well as the high order terms(h.o.t). Let this equation be call equation (1).
Why are the high order terms neglected?
Recall Taylor series expansion: 
where
is considered a h.o.t and is therefore neglected.
From equation (1) the equation of motion(EOM) of the system can be derived. Let the EOM be called equation (2).
⇨ 
Equation (3), the constitutive relation, can then be determined.
⇨ 
where 
and 
Substituting equation (3) into equation (2) yields the partial differential equation of motion, equation (4) shown below.
⇨ 
There are 2 initial conditions(displacement and velocity), and therefore 2 boundary conditions(2nd order derivative with respect to x).
For Figure 2 the boundary conditions are 
For Figure 3 the boundary condition at 0 is also
, but the boundary condition at L can be derived as follows

where 
and 
and 
The boundary condition at L can therefore be simplified to

Derivation of Matrix Relations and Matrices for Finite Element Analysis of 3-D Systems [edit]
Axial FD Relation [edit]
When an additional displacement DOF is added to the system, the Axial Force-Displacement Relation does not change. This is because a member can only have two-reaction forces, and those forces are constrained to be along the direction of the member. Because deformation in a member is caused by these forces, the only axial displacements in a space truss member are found at the bar ends in the direction of the member.
Thus, the Axial Force-Displacement Relation is as shown below, where P represents the axial forces at each node in the member and q represents the axial displacement of each node.


Element DOFs and Element Forces in Global xyz Coordinates [edit]
The following image shows the proper setup of the element displacement DOFs and element forces for a space truss element.
Since each element in a space truss system has 6 displacement DOFs and forces, the element displacement DOF and force matrices are of size 6 x 1. These matrices are shown below.

Transformation Matrix [edit]
For plane truss members, the transformation matrix is as shown below, where
and
are the director cosines for a 2D system.

For space truss members, the transformation matrix is slightly different, due to the fact that an additional coordinate, z, is added to the system. The director cosine corresponding to the z-coordinate is represented by
. The transformation matrix for a space truss system is shown below.

Relation between Axial DOFs and Element DOFs in Global Coordinates [edit]
The relation between the axial displacement DOFs and element DOFs using the transformation matrix is shown below.


Relation between Axial Forces and Element Forces in Global Coordinates [edit]
The relation between the axial forces and element forces using the transformation matrix is shown below.


Derivations Using the Principal of Virtual Work [edit]
In this section, various relations for space truss elements are derived using the Principal of Virtual Work.
Global FD Relation [edit]
The element axial force-displacement relation is shown below.

Relations for the element axial displacement DOFs and element axial forces in terms of the transformation matrix and the element displacement DOFs and forces in global coordinates are shown below.


Substituting these relations into the element axial force-displacement relation, the following relation is developed.

Applying the Principal of Virtual Work, the above relation can be written as shown below, greatly simplifying the problem.
![\mathbf{f}_{6\times 1}^{(e)} = [\mathbf{T}^{(e)^{T}}_{2\times 6}\mathbf{\hat{k}}^{(e)}\mathbf{T}^{(e)}_{2\times 6}]\mathbf{d}_{6\times 1}^{(e)}](http://upload.wikimedia.org/math/f/0/e/f0e1b06fab070a937c3cf75f2ba6a119.png)
Error: No, you cannot "solve" the equation further above to obtain the above equation; you need to use the PVW. Eml4500.f08 11:06, 10 November 2008 (UTC)
The above derivation has been modified to explain how the PVW is used. Eml4500.f08.bike.mcdonald 21:55, 11 November 2008 (UTC)
Multiplying out the term inside the brackets, it can be shown that it is equal to the element stiffness matrix, as shown below.



Substituting this relation into the above relation for the element force matrix in global coordinates gives the desired result, the element force-displacement relation, proved using the Principle of Virtual Work.

Element Stiffness Matrix in Global Coordinates in Terms of Transformation Matrix and Element Stiffness Matrix from Axial FD Relation [edit]
The following relation shows the element stiffness matrix of a space truss element in terms of the transformation matrix,
, and the element stiffness matrix from the axial force-displacement relation,
. This relation was derived in the above derivation of the global force-displacement relation.

Element Forces in Global Coordinates in Terms of Transformation Matrix and Element Axial Forces [edit]
The following relation was derived and shown in the above derivation of the space truss element force-displacement relation.

Multiplying both sides of this relation by
gives the relation shown below for the element forces in global coordinates in terms of the transformation matrix and the element axial forces.

Element Stiffness Matrix in Global Coordinates in Terms of Director Cosines [edit]
The following relation shows the element stiffness matrix of a space truss element in terms of the director cosines,
,
, and
. This relation was derived in the above derivation of the global force-displacement relation.

Rerunning the MATLAB Code for 2-Bar Truss System and Interpreting results Array [edit]
The setup of the 2-bar truss system to be analyzed is shown below. This system was previously analyzed and verified using statics in Homework Report 2, however there was a bug in the MATLAB code that needed to be corrected. The steps taken to correct the bug will be shown in this section, and the new results that come from the modified MATLAB code will be presented.
The properties of the 2-bar truss system to be analyzed is shown in the table below.
| Element Number | Young's Modulus | Cross-Sectional Area | Length | Angle of Inclination |
|---|---|---|---|---|
|
|
|
|
|
![]() |
|
|
|
|
|
![]() |
Modified MATLAB Code [edit]
When the MATLAB code for solving the 2-bar truss system using the Finite Element Method was first analyzed in Homework Report 2, there was a bug that showed up when calculating the results array. This bug was due to the fact that the MATLAB code passed the entire e and A arrays into the PlaneTrussResults(e,A,coord,disps) function, instead of passing only the proper array index in.
The section of code with the error is shown below prior to fixing the bug.
for i=1:elems results = [results; PlaneTrussResults(e, A, ... nodes(conn(i,:),:), d(lmm(i,:)))]; end
In order to fix the bug, the variables e and A were replaced with e(i) and A(i), which allowed for the values at each index in these arrays to be properly used when calculating the results. This is because the function PlaneTrussResults is located inside a for loop from the value 1 to the variable elems, which in this case has a value of 2.
The modified section of code is shown below.
for i=1:elems results = [results; PlaneTrussResults(e(i), A(i), ... nodes(conn(i,:),:), d(lmm(i,:)))]; end
The overall modified MATLAB code used to solve the 2-bar truss system is shown below.
% MATLAB Code to perform Finite Element Analysis on % Two-Bar Truss System % NOTE: Modification made to fix bug in calculating results clear all; e = [3 5]; A = [1 2]; P = 7; L=[4 2]; alpha = pi/3; beta = pi/4; nodes = [ 0, 0; % x,y position of node 1 L(1)*cos(pi/2-alpha), L(1)*sin(pi/2-alpha); % x,y position of node 2 L(1)*cos(pi/2-alpha)+L(2)*sin(beta),L(1)*sin(pi/2-alpha)-L(2)*cos(beta) % x,y position of node 3 ]; 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
Interpreting results Array [edit]
The MATLAB command window output after running the MATLAB code shown in the above section is shown below.
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
The last value shown in the MATLAB command window output is the results array. The first row of the array is associated with Element 1, and the second row is associated with Element 2. The first column gives the value of axial strain in the corresponding elements, the second column gives the value of axial stress in the corresponding elements, and the third column gives the value of axial force in the corresponding elements.
A table showing the results of the Finite Element Analysis on the 2-bar truss system is given below.
| Element Number | Axial Strain | Axial Stress | Axial Force |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
In order to verify that the results obtained from the MATLAB code shown above, the calculation of axial force, axial stress, and axial strain using statics is shown below for both element 1 and 2 of the 2-bar truss system.
The axial forces of both elements were obtained by summing forces in both the x and y directions, as shown below.




Element 1 [edit]
Knowing the axial force in element 1, the axial stress and axial strain can be calculated as shown below.



Comparing these values with the values obtained from the Finite Element Method solution above, it can be seen that both methods are in complete agreement.
Element 2 [edit]
Knowing the axial force in element 2, the axial stress and axial strain can be calculated as shown below.



Comparing these values with the values obtained from the Finite Element Method solution above, it can be seen that both methods are in complete agreement.
Finite Element Analysis of Various 6-Bar Truss Systems [edit]
The setup of the 6-bar truss system as given on page 226 of FUNDAMENTAL Finite Element Analysis and Applications With Mathematica and MATLAB Computations, written by M. Asghar Bhatti is shown in the figure below.
6-Bar Truss System With Same Young's Modulus and Cross-Sectional Area Values [edit]
The properties of the 6-bar truss system with the same values for Young's Modulus and cross-sectional area are shown in the table below.
| Element Number | Young's Modulus (GPa) | Cross-Sectional Area (m2) | Length (m) | Angle of Inclination |
|---|---|---|---|---|
|
|
|
|
|
![]() |
|
|
|
|
|
![]() |
|
|
|
|
|
![]() |
|
|
|
|
|
![]() |
|
|
|
|
|
![]() |
|
|
|
|
|
![]() |
MATLAB Code [edit]
The following MATLAB code was provided as an online resource from FUNDAMENTAL Finite Element Analysis and Applications With Mathematica and MATLAB Computations, written by M. Asghar Bhatti.
% 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
In order for this code to run properly, it needs three additional MATLAB functions. These functions are listed and shown in detail below.
PlaneTrussElement.m [edit]
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 [edit]
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 [edit]
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 Undeformed and Deformed Structure [edit]
The plot of the undeformed and deformed shapes of the 6-bar truss system with the same values for Young's Modulus and cross-sectional area is shown below with a multiplication factor on the deformation of 3000.
The source code added to the original MATLAB code to produce the above plot is given below.
%----------------------------------------------------------------- % model with 2-D beam elements with 2 dofs per node dof = 2; % dof per node % % input the nodal coordinates % n_node = 5; % total number of nodes n_elem = 6; % total number of elements total_dof = dof * n_node; % total dofs of system % five-bar truss system data % for i=1:n_elem con=conn(i,:); L(i)=PlaneTrussElementMod(nodes(con,:)); end for i=1:n_elem con=conn(i,:); theta(i)=PlaneTrussElementMod2(nodes(con,:)); end position(:, 1) = [ 0; 0]; position(:, 2) = [ L(1); 0]; position(:, 3) = [ 0; L(4)]; position(:, 4) = [ L(1) ; L(4) ]; position(:, 5) = [ L(5)*cos(theta(5)) ; L(5)*sin(theta(5)) ]; % set up the nodal coordinate arrays x, y for i = 1 : n_node x(i) = position(1,i); y(i) = position(2,i); end % set up the element connectivity array node_connect, defined as % follows: % node_connect(local node number, element number) = global node number 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) = 5; % element 3 node_connect(2, 3) = 3; 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; % plot the whole truss system % loop over the elements for i = 1 : n_elem % for element i, do the following: % node_1 = global node number corresponding to the local node 1 node_1 = node_connect(1,i); % node_2 = global node number corresponding to the local node 1 node_2 = node_connect(2,i); % xx : 1x2 array containing x coordinates of node_1 and node_2 xx = [x(node_1),x(node_2)]; % yy : 1x2 array containing y coordinates of node_1 and node_2 yy = [y(node_1),y(node_2)]; % plot the element i in 2-D using command plot % use axis command to avoid having the plot window too tight axis([-1000 5000 -1000 4000]) % solid line plot(xx,yy,'--') % hold the current figure for the next element hold on end text(x(node_connect(1,1)),y(node_connect(1,1)),'Node 1',... 'HorizontalAlignment', 'center') text(x(node_connect(1,2)),y(node_connect(1,2)),'Node 2',... 'HorizontalAlignment', 'center') text(x(node_connect(2,3)),y(node_connect(2,3)),'Node 3',... 'HorizontalAlignment', 'center') text(x(node_connect(2,4)),y(node_connect(2,4)),'Node 4',... 'HorizontalAlignment', 'center') text(x(node_connect(2,4)),y(node_connect(2,4)),'Node 5',... 'HorizontalAlignment', 'center') text(x(node_connect(2,1))/2,y(node_connect(2,1))/2,'Element 1',... 'HorizontalAlignment', 'center') text( x(node_connect(2,1)) + (x(node_connect(2,2))-x(node_connect(2,1)))/2 , y(node_connect(2,1)) + (y(node_connect(2,2))-y(node_connect(2,1)))/2 ,'Element 2',... 'HorizontalAlignment', 'center') text( x(node_connect(2,1)) + (x(node_connect(2,2))-x(node_connect(2,1)))/2 , y(node_connect(2,1)) + (y(node_connect(2,2))-y(node_connect(2,1)))/2 ,'Element 3',... 'HorizontalAlignment', 'center') text( x(node_connect(2,1)) + (x(node_connect(2,2))-x(node_connect(2,1)))/2 , y(node_connect(2,1)) + (y(node_connect(2,2))-y(node_connect(2,1)))/2 ,'Element 4',... 'HorizontalAlignment', 'center') text( x(node_connect(2,1)) + (x(node_connect(2,2))-x(node_connect(2,1)))/2 , y(node_connect(2,1)) + (y(node_connect(2,2))-y(node_connect(2,1)))/2 ,'Element 5',... 'HorizontalAlignment', 'center') text( x(node_connect(2,1)) + (x(node_connect(2,2))-x(node_connect(2,1)))/2 , y(node_connect(2,1)) + (y(node_connect(2,2))-y(node_connect(2,1)))/2 ,'Element 6',... 'HorizontalAlignment', 'center') hold on mult_factor = 3000; d=d*mult_factor; position_d(:, 1) = [ 0; 0]; position_d(:, 2) = [ L(1)+d(3); 0+d(4)]; position_d(:, 3) = [ 0; L(4)]; position_d(:, 4) = [ L(1) ; L(4) ]; position_d(:, 5) = [ L(5)*cos(theta(5))+d(9) ; L(5)*sin(theta(5))+d(10) ]; % set up the nodal coordinate arrays x, y for i = 1 : n_node x(i) = position_d(1,i); y(i) = position_d(2,i); end % set up the element connectivity array node_connect, defined as % follows: % node_connect(local node number, element number) = global node number node_connect_d(1, 1) = 1; % element 1 node_connect_d(2, 1) = 2; node_connect_d(1, 2) = 2; % element 2 node_connect_d(2, 2) = 5; node_connect_d(1, 3) = 5; % element 3 node_connect_d(2, 3) = 3; node_connect_d(1, 4) = 2; % element 4 node_connect_d(2, 4) = 4; node_connect_d(1, 5) = 1; % element 5 node_connect_d(2, 5) = 5; node_connect_d(1, 6) = 5; % element 6 node_connect_d(2, 6) = 4; % plot the whole truss system % loop over the elements for i = 1 : n_elem % for element i, do the following: % node_1 = global node number corresponding to the local node 1 node_1 = node_connect_d(1,i); % node_2 = global node number corresponding to the local node 1 node_2 = node_connect_d(2,i); % xx : 1x2 array containing x coordinates of node_1 and node_2 xx = [x(node_1),x(node_2)]; % yy : 1x2 array containing y coordinates of node_1 and node_2 yy = [y(node_1),y(node_2)]; % plot the element i in 2-D using command plot % use axis command to avoid having the plot window too tight axis([-1000 5000 -1000 4000]) % solid line plot(xx,yy,'-r') % hold the current figure for the next element hold on end text(x(node_connect_d(1,1)),y(node_connect_d(1,1)),'Node 1',... 'HorizontalAlignment', 'center') text(x(node_connect_d(1,2)),y(node_connect_d(1,2)),'Node 2',... 'HorizontalAlignment', 'center') text(x(node_connect_d(2,3)),y(node_connect_d(2,3)),'Node 3',... 'HorizontalAlignment', 'center') text(x(node_connect_d(2,4)),y(node_connect_d(2,4)),'Node 4',... 'HorizontalAlignment', 'center') text(x(node_connect_d(2,4)),y(node_connect_d(2,4)),'Node 5',... 'HorizontalAlignment', 'center') text(x(node_connect_d(2,1))/2,y(node_connect_d(2,1))/2,'Element 1',... 'HorizontalAlignment', 'center') text( x(node_connect_d(2,1)) + (x(node_connect_d(2,2))-x(node_connect_d(2,1)))/2 , y(node_connect_d(2,1)) + (y(node_connect_d(2,2))-y(node_connect_d(2,1)))/2 ,'Element 2',... 'HorizontalAlignment', 'center') text( x(node_connect_d(2,1)) + (x(node_connect_d(2,2))-x(node_connect_d(2,1)))/2 , y(node_connect_d(2,1)) + (y(node_connect_d(2,2))-y(node_connect_d(2,1)))/2 ,'Element 3',... 'HorizontalAlignment', 'center') text( x(node_connect_d(2,1)) + (x(node_connect_d(2,2))-x(node_connect_d(2,1)))/2 , y(node_connect_d(2,1)) + (y(node_connect_d(2,2))-y(node_connect_d(2,1)))/2 ,'Element 4',... 'HorizontalAlignment', 'center') text( x(node_connect_d(2,1)) + (x(node_connect_d(2,2))-x(node_connect_d(2,1)))/2 , y(node_connect_d(2,1)) + (y(node_connect_d(2,2))-y(node_connect_d(2,1)))/2 ,'Element 5',... 'HorizontalAlignment', 'center') text( x(node_connect_d(2,1)) + (x(node_connect_d(2,2))-x(node_connect_d(2,1)))/2 , y(node_connect_d(2,1)) + (y(node_connect_d(2,2))-y(node_connect_d(2,1)))/2 ,'Element 6',... 'HorizontalAlignment', 'center') % put the title on the figure title('Deformed and Undeformed States of 6-Bar Truss System') % label x axis xlabel('x') % label y axis ylabel('y')
6-Bar Truss System Where Young's Modulus Values Are Not Equal [edit]
The properties of the same 6-bar truss system analyzed above but different and varying values for Young's Modulus are shown in the table below.
| Element Number | Young's Modulus (GPa) | Cross-Sectional Area (m2) | Length (m) | Angle of Inclination |
|---|---|---|---|---|
|
|
|
|
|
![]() |
|
|
|
|
|
![]() |
|
|
|
|
|
![]() |
|
|
|
|
|
![]() |
|
|
|
|
|
![]() |
|
|
|
|
|
![]() |
MATLAB Code [edit]
The following MATLAB code was provided as an online resource from FUNDAMENTAL Finite Element Analysis and Applications With Mathematica and MATLAB Computations, written by M. Asghar Bhatti.
% Six bar truss example e = [150*10^3;180*10^3;200*10^3;200*10^3;220*10^3;250*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(i), 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(i), A, ... nodes(conn(i,:),:), d(lmm(i,:)))]; end format short g results
In order for this code to run properly, it needs three additional MATLAB functions. These functions are listed and shown in detail below.
PlaneTrussElement.m [edit]
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 [edit]
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 [edit]
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 Undeformed and Deformed Structure [edit]
The plot of the undeformed and deformed shapes of the 6-bar truss system with the same values for Young's Modulus and cross-sectional area is shown below with a multiplication factor on the deformation of 3000.
The source code added to the original MATLAB code to produce the above plot is given below.
%----------------------------------------------------------------- % model with 2-D beam elements with 2 dofs per node dof = 2; % dof per node % % input the nodal coordinates % n_node = 5; % total number of nodes n_elem = 6; % total number of elements total_dof = dof * n_node; % total dofs of system % five-bar truss system data % for i=1:n_elem con=conn(i,:); L(i)=PlaneTrussElementMod(nodes(con,:)); end for i=1:n_elem con=conn(i,:); theta(i)=PlaneTrussElementMod2(nodes(con,:)); end position(:, 1) = [ 0; 0]; position(:, 2) = [ L(1); 0]; position(:, 3) = [ 0; L(4)]; position(:, 4) = [ L(1) ; L(4) ]; position(:, 5) = [ L(5)*cos(theta(5)) ; L(5)*sin(theta(5)) ]; % set up the nodal coordinate arrays x, y for i = 1 : n_node x(i) = position(1,i); y(i) = position(2,i); end % set up the element connectivity array node_connect, defined as % follows: % node_connect(local node number, element number) = global node number 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) = 5; % element 3 node_connect(2, 3) = 3; 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; % plot the whole truss system % loop over the elements for i = 1 : n_elem % for element i, do the following: % node_1 = global node number corresponding to the local node 1 node_1 = node_connect(1,i); % node_2 = global node number corresponding to the local node 1 node_2 = node_connect(2,i); % xx : 1x2 array containing x coordinates of node_1 and node_2 xx = [x(node_1),x(node_2)]; % yy : 1x2 array containing y coordinates of node_1 and node_2 yy = [y(node_1),y(node_2)]; % plot the element i in 2-D using command plot % use axis command to avoid having the plot window too tight axis([-1000 10000 -1000 4000]) % solid line plot(xx,yy,'--') % hold the current figure for the next element hold on end text(x(node_connect(1,1)),y(node_connect(1,1)),'Node 1',... 'HorizontalAlignment', 'center') text(x(node_connect(1,2)),y(node_connect(1,2)),'Node 2',... 'HorizontalAlignment', 'center') text(x(node_connect(2,3)),y(node_connect(2,3)),'Node 3',... 'HorizontalAlignment', 'center') text(x(node_connect(2,4)),y(node_connect(2,4)),'Node 4',... 'HorizontalAlignment', 'center') text(x(node_connect(2,4)),y(node_connect(2,4)),'Node 5',... 'HorizontalAlignment', 'center') text(x(node_connect(2,1))/2,y(node_connect(2,1))/2,'Element 1',... 'HorizontalAlignment', 'center') text( x(node_connect(2,1)) + (x(node_connect(2,2))-x(node_connect(2,1)))/2 , y(node_connect(2,1)) + (y(node_connect(2,2))-y(node_connect(2,1)))/2 ,'Element 2',... 'HorizontalAlignment', 'center') text( x(node_connect(2,1)) + (x(node_connect(2,2))-x(node_connect(2,1)))/2 , y(node_connect(2,1)) + (y(node_connect(2,2))-y(node_connect(2,1)))/2 ,'Element 3',... 'HorizontalAlignment', 'center') text( x(node_connect(2,1)) + (x(node_connect(2,2))-x(node_connect(2,1)))/2 , y(node_connect(2,1)) + (y(node_connect(2,2))-y(node_connect(2,1)))/2 ,'Element 4',... 'HorizontalAlignment', 'center') text( x(node_connect(2,1)) + (x(node_connect(2,2))-x(node_connect(2,1)))/2 , y(node_connect(2,1)) + (y(node_connect(2,2))-y(node_connect(2,1)))/2 ,'Element 5',... 'HorizontalAlignment', 'center') text( x(node_connect(2,1)) + (x(node_connect(2,2))-x(node_connect(2,1)))/2 , y(node_connect(2,1)) + (y(node_connect(2,2))-y(node_connect(2,1)))/2 ,'Element 6',... 'HorizontalAlignment', 'center') hold on mult_factor = 3000; d=d*mult_factor; position_d(:, 1) = [ 0; 0]; position_d(:, 2) = [ L(1)+d(3); 0+d(4)]; position_d(:, 3) = [ 0; L(4)]; position_d(:, 4) = [ L(1) ; L(4) ]; position_d(:, 5) = [ L(5)*cos(theta(5))+d(9) ; L(5)*sin(theta(5))+d(10) ]; % set up the nodal coordinate arrays x, y for i = 1 : n_node x(i) = position_d(1,i); y(i) = position_d(2,i); end % set up the element connectivity array node_connect, defined as % follows: % node_connect(local node number, element number) = global node number node_connect_d(1, 1) = 1; % element 1 node_connect_d(2, 1) = 2; node_connect_d(1, 2) = 2; % element 2 node_connect_d(2, 2) = 5; node_connect_d(1, 3) = 5; % element 3 node_connect_d(2, 3) = 3; node_connect_d(1, 4) = 2; % element 4 node_connect_d(2, 4) = 4; node_connect_d(1, 5) = 1; % element 5 node_connect_d(2, 5) = 5; node_connect_d(1, 6) = 5; % element 6 node_connect_d(2, 6) = 4; % plot the whole truss system % loop over the elements for i = 1 : n_elem % for element i, do the following: % node_1 = global node number corresponding to the local node 1 node_1 = node_connect_d(1,i); % node_2 = global node number corresponding to the local node 1 node_2 = node_connect_d(2,i); % xx : 1x2 array containing x coordinates of node_1 and node_2 xx = [x(node_1),x(node_2)]; % yy : 1x2 array containing y coordinates of node_1 and node_2 yy = [y(node_1),y(node_2)]; % plot the element i in 2-D using command plot % use axis command to avoid having the plot window too tight axis([-1000 10000 -1000 4000]) % solid line plot(xx,yy,'-r') % hold the current figure for the next element hold on end text(x(node_connect_d(1,1)),y(node_connect_d(1,1)),'Node 1',... 'HorizontalAlignment', 'center') text(x(node_connect_d(1,2)),y(node_connect_d(1,2)),'Node 2',... 'HorizontalAlignment', 'center') text(x(node_connect_d(2,3)),y(node_connect_d(2,3)),'Node 3',... 'HorizontalAlignment', 'center') text(x(node_connect_d(2,4)),y(node_connect_d(2,4)),'Node 4',... 'HorizontalAlignment', 'center') text(x(node_connect_d(2,4)),y(node_connect_d(2,4)),'Node 5',... 'HorizontalAlignment', 'center') text(x(node_connect_d(2,1))/2,y(node_connect_d(2,1))/2,'Element 1',... 'HorizontalAlignment', 'center') text( x(node_connect_d(2,1)) + (x(node_connect_d(2,2))-x(node_connect_d(2,1)))/2 , y(node_connect_d(2,1)) + (y(node_connect_d(2,2))-y(node_connect_d(2,1)))/2 ,'Element 2',... 'HorizontalAlignment', 'center') text( x(node_connect_d(2,1)) + (x(node_connect_d(2,2))-x(node_connect_d(2,1)))/2 , y(node_connect_d(2,1)) + (y(node_connect_d(2,2))-y(node_connect_d(2,1)))/2 ,'Element 3',... 'HorizontalAlignment', 'center') text( x(node_connect_d(2,1)) + (x(node_connect_d(2,2))-x(node_connect_d(2,1)))/2 , y(node_connect_d(2,1)) + (y(node_connect_d(2,2))-y(node_connect_d(2,1)))/2 ,'Element 4',... 'HorizontalAlignment', 'center') text( x(node_connect_d(2,1)) + (x(node_connect_d(2,2))-x(node_connect_d(2,1)))/2 , y(node_connect_d(2,1)) + (y(node_connect_d(2,2))-y(node_connect_d(2,1)))/2 ,'Element 5',... 'HorizontalAlignment', 'center') text( x(node_connect_d(2,1)) + (x(node_connect_d(2,2))-x(node_connect_d(2,1)))/2 , y(node_connect_d(2,1)) + (y(node_connect_d(2,2))-y(node_connect_d(2,1)))/2 ,'Element 6',... 'HorizontalAlignment', 'center') % put the title on the figure title('Deformed and Undeformed States of 6-Bar Truss System') % label x axis xlabel('x') % label y axis ylabel('y')
Plot Comparing Deformed Structures of Both 6-Bar Truss Systems [edit]
The following plot shows a comparison of the deformed structures of the two 6-bar truss systems analyzed previously using the Finite Element Method. The blue dotted line represents the undeformed structure of the 6-bar truss system, the solid red line represents the deformed structure of the 6-bar truss system with the same values of Young's Modulus, and the solid green line represents the deformed structure of the 6-bar truss system with different values of Young's Modulus.
The MATLAB code used to produce the above plot is shown below.
% model with 2-D beam elements with 2 dofs per node dof = 2; % dof per node % input the nodal coordinates n_node = 5; % total number of nodes n_elem = 6; % total number of elements total_dof = dof * n_node; % total dofs of system % five-bar truss system data for i=1:n_elem con=conn(i,:); L(i)=PlaneTrussElementMod(nodes(con,:)); end for i=1:n_elem con=conn(i,:); theta(i)=PlaneTrussElementMod2(nodes(con,:)); end mult_factor = 3000; % displacement dofs of system with same values for Young's Modulus d = mult_factor*[ 0; 0; 0.21311; 0.24998; 0; 0; 0; 0; -0.0060971; 0.012242] % displacement dofs of system with different values for Young's Modulus d_diff_e = mult_factor*[ 0; 0; 0.26485; 0.26083; 0; 0; 0; 0; 0.00063864; -0.001246] % plot the undeformed shape position(:, 1) = [ 0; 0]; position(:, 2) = [ L(1); 0]; position(:, 3) = [ 0; L(4)]; position(:, 4) = [ L(1) ; L(4) ]; position(:, 5) = [ L(5)*cos(theta(5)) ; L(5)*sin(theta(5)) ]; % set up the nodal coordinate arrays x, y for i = 1 : n_node x(i) = position(1,i); y(i) = position(2,i); end % set up the element connectivity array node_connect, defined as % follows: % node_connect(local node number, element number) = global node number 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) = 5; % element 3 node_connect(2, 3) = 3; 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; % plot the whole truss system % loop over the elements for i = 1 : n_elem % for element i, do the following: % node_1 = global node number corresponding to the local node 1 node_1 = node_connect(1,i); % node_2 = global node number corresponding to the local node 1 node_2 = node_connect(2,i); % xx : 1x2 array containing x coordinates of node_1 and node_2 xx = [x(node_1),x(node_2)]; % yy : 1x2 array containing y coordinates of node_1 and node_2 yy = [y(node_1),y(node_2)]; % plot the element i in 2-D using command plot % use axis command to avoid having the plot window too tight axis([-1000 6000 -1000 4000]) % solid line plot(xx,yy,'--') % hold the current figure for the next element hold on end % plot the deformed shape of the system with same Young's Modulus values position_d(:, 1) = [ 0; 0]; position_d(:, 2) = [ L(1)+d(3); 0+d(4)]; position_d(:, 3) = [ 0; L(4)]; position_d(:, 4) = [ L(1) ; L(4) ]; position_d(:, 5) = [ L(5)*cos(theta(5))+d(9) ; L(5)*sin(theta(5))+d(10) ]; % set up the nodal coordinate arrays x, y for i = 1 : n_node x(i) = position_d(1,i); y(i) = position_d(2,i); end % set up the element connectivity array node_connect, defined as % follows: % node_connect(local node number, element number) = global node number node_connect_d(1, 1) = 1; % element 1 node_connect_d(2, 1) = 2; node_connect_d(1, 2) = 2; % element 2 node_connect_d(2, 2) = 5; node_connect_d(1, 3) = 5; % element 3 node_connect_d(2, 3) = 3; node_connect_d(1, 4) = 2; % element 4 node_connect_d(2, 4) = 4; node_connect_d(1, 5) = 1; % element 5 node_connect_d(2, 5) = 5; node_connect_d(1, 6) = 5; % element 6 node_connect_d(2, 6) = 4; % plot the whole truss system % loop over the elements for i = 1 : n_elem % for element i, do the following: % node_1 = global node number corresponding to the local node 1 node_1 = node_connect_d(1,i); % node_2 = global node number corresponding to the local node 1 node_2 = node_connect_d(2,i); % xx : 1x2 array containing x coordinates of node_1 and node_2 xx = [x(node_1),x(node_2)]; % yy : 1x2 array containing y coordinates of node_1 and node_2 yy = [y(node_1),y(node_2)]; % plot the element i in 2-D using command plot % use axis command to avoid having the plot window too tight axis([-1000 6000 -1000 4000]) % solid line plot(xx,yy,'-r') % hold the current figure for the next element hold on end % plot deformed shape for the system with different Young's Modulus values position_d(:, 1) = [ 0; 0]; position_d(:, 2) = [ L(1)+d_diff_e(3); 0+d_diff_e(4)]; position_d(:, 3) = [ 0; L(4)]; position_d(:, 4) = [ L(1) ; L(4) ]; position_d(:, 5) = [ L(5)*cos(theta(5))+d_diff_e(9) ; L(5)*sin(theta(5))+d_diff_e(10) ]; % set up the nodal coordinate arrays x, y for i = 1 : n_node x(i) = position_d(1,i); y(i) = position_d(2,i); end % set up the element connectivity array node_connect, defined as % follows: % node_connect(local node number, element number) = global node number node_connect_d_diff_e(1, 1) = 1; % element 1 node_connect_d_diff_e(2, 1) = 2; node_connect_d_diff_e(1, 2) = 2; % element 2 node_connect_d_diff_e(2, 2) = 5; node_connect_d_diff_e(1, 3) = 5; % element 3 node_connect_d_diff_e(2, 3) = 3; node_connect_d_diff_e(1, 4) = 2; % element 4 node_connect_d_diff_e(2, 4) = 4; node_connect_d_diff_e(1, 5) = 1; % element 5 node_connect_d_diff_e(2, 5) = 5; node_connect_d_diff_e(1, 6) = 5; % element 6 node_connect_d_diff_e(2, 6) = 4; % plot the whole truss system % loop over the elements for i = 1 : n_elem % for element i, do the following: % node_1 = global node number corresponding to the local node 1 node_1 = node_connect_d_diff_e(1,i); % node_2 = global node number corresponding to the local node 1 node_2 = node_connect_d_diff_e(2,i); % xx : 1x2 array containing x coordinates of node_1 and node_2 xx = [x(node_1),x(node_2)]; % yy : 1x2 array containing y coordinates of node_1 and node_2 yy = [y(node_1),y(node_2)]; % plot the element i in 2-D using command plot % use axis command to avoid having the plot window too tight axis([-1000 6000 -1000 4000]) % solid line plot(xx,yy,'-g') % hold the current figure for the next element hold on end % put the title on the figure title('Comparison of Deformed States of 6-Bar Truss Systems') % label x axis xlabel('x') % label y axis ylabel('y')
Finite Element Analysis of 3-Bar Space Truss [edit]
The setup of the 3-bar space truss system as given on page 230 of FUNDAMENTAL Finite Element Analysis and Applications With Mathematica and MATLAB Computations, written by M. Asghar Bhatti is shown in the figure below.
The element and node properties of the 3-bar space truss system are shown in the following two tables.
| Element Number | Young's Modulus (GPa) | Cross-Sectional Area (mm2) |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
| Node Number | x (m) | y (m) | z (m) |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
In order to properly create MATLAB code to solve the 3-bar space truss system using the Finite Element Method, the conn and lmm arrays must be populated. The proper assembly of the conn array is shown below.
![\texttt{conn}=\left[ \begin{array}{cc} 1 & 4 \\ 2 & 4 \\ 3 & 4 \end{array} \right]](http://upload.wikimedia.org/math/5/d/0/5d04f7211ec9e575bc2cae66323ae271.png)
The proper assembly of the lmm array is shown below.
![\texttt{lmm}=\left[ \begin{array}{cccccc} 1 & 2 & 3 & 10 & 11 & 12 \\ 4 & 5 & 6 & 10 & 11 & 12 \\ 7 & 8 & 9 & 10 & 11 & 12 \end{array} \right]](http://upload.wikimedia.org/math/f/0/c/f0c59ce8641da44c3d9cdcf9b325374d.png)
Analysis 3-Bar Space Truss Using MATLAB and the Finite Element Method [edit]
MATLAB Code [edit]
The MATLAB code, shown below, and used to solve the 3-bar space truss system was provided as an online resource by FUNDAMENTAL Finite Element Analysis and Applications with Mathematica and MATLAB Computations, written by M. Asghar Bhatti.
% 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
The following additional functions were called in the above code and were necessary to properly solve the 3-bar truss system using MATLAB.
SpaceTrussElement.m [edit]
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 [edit]
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 [edit]
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];
MATLAB Results [edit]
The output in the MATLAB command window after running the above code is shown below.
K =
1.0e+004 *
Columns 1 through 11
0.1460 0.2919 -0.3041 0 0 0 0 0 0 -0.1460 -0.2919
0.2919 0.5839 -0.6082 0 0 0 0 0 0 -0.2919 -0.5839
-0.3041 -0.6082 0.6335 0 0 0 0 0 0 0.3041 0.6082
0 0 0 0.3567 -0.3567 0.4954 0 0 0 -0.3567 0.3567
0 0 0 -0.3567 0.3567 -0.4954 0 0 0 0.3567 -0.3567
0 0 0 0.4954 -0.4954 0.6880 0 0 0 -0.4954 0.4954
0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 6.0000 0 0
-0.1460 -0.2919 0.3041 -0.3567 0.3567 -0.4954 0 0 0 0.5026 -0.0647
-0.2919 -0.5839 0.6082 0.3567 -0.3567 0.4954 0 0 0 -0.0647 0.9405
0.3041 0.6082 -0.6335 -0.4954 0.4954 -0.6880 0 0 -6.0000 0.1913 -1.1036
Column 12
0.3041
0.6082
-0.6335
-0.4954
0.4954
-0.6880
0
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
The computed reactions of the 3-bar space truss system are shown below.
![\mathbf{R}= \left[ \begin{array}{c} R_{1} \\ R_{2} \\ R_{3} \\ R_{4} \\ R_{5} \\ R_{6} \\ R_{7} \\ R_{8} \\ R_{9} \\ \end{array} \right] = \left[ \begin{array}{c} 6667 \\ 13333 \\ -13889 \\ -6667 \\ 6667 \\ -9259 \\ 0 \\ 0 \\ 23148 \\ \end{array} \right]](http://upload.wikimedia.org/math/3/2/c/32c5e957f2dd6a12e0c7d8953afe8f5b.png)
| Element Number | Axial Strain | Axial Stress | Axial Force |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Determination of Statically Determinate or Indeterminate System [edit]
The 3-bar space truss system analyzed above is a statically determinate system. This is because each of the three members of the system have an axial force directed along the member, which gives the system 3 unknown forces. Because the space truss system has 3 displacement DOFs at each node, the summation of forces can be performed in the x-direction, y-direction, and z-direction. This gives 3 unique equations. Because there are 3 equations and 3 unknowns, this system can be solved using only the methods of statics.
In order to verify that the results obtained from the MATLAB code shown above, the calculation of axial force, axial stress, and axial strain using statics is shown below for the 3-bar space truss system.
Three unique equations were obtained by summing forces in the x, y, and z directions, as shown below.






Element 1 [edit]
Knowing the axial force in element 1, the axial stress and axial strain can be calculated as shown below.



Element 2 [edit]
Knowing the axial force in element 2, the axial stress and axial strain can be calculated as shown below.



Element 3 [edit]
Knowing the axial force in element 3, the axial stress and axial strain can be calculated as shown below.



Comparing these values with the values obtained from the Finite Element Method solution above, it can be seen that both methods are in complete agreement.
Plots of Undeformed and Deformed Structure using MATLAB [edit]
The following sections show plots of the undeformed and deformed shapes of the 3-bar space truss system described above. These plots were created using the following MATLAB code, which was added to the end of the MATLAB code used to solve the 3-bar space truss system using the Finite Element Method.
%----------------------------------------------------------------- % model with 2-D beam elements with 2 dofs per node dof = 3; % dof per node % % input the nodal coordinates % n_node = 4; % total number of nodes n_elem = 3; % total number of elements total_dof = dof * n_node; % total dofs of system % five-bar truss system data % for i=1:n_elem con=conn(i,:); [L(i) ls(i) ms(i) ns(i)] = SpaceTrussElementMod(nodes(con,:)); end position(:, 1) = 1000*[ 0.96 ; 1.92 ; 0 ]; position(:, 2) = 1000*[ -1.44 ; 1.44 ; 0 ]; position(:, 3) = 1000*[ 0 ; 0 ; 0 ]; position(:, 4) = 1000*[ 0 ; 0 ; 2 ]; % set up the nodal coordinate arrays x, y for i = 1 : n_node x(i) = position(1,i); y(i) = position(2,i); z(i) = position(3,i); end % plot the whole truss system % loop over the elements for i = 1 : n_elem % for element i, do the following: % node_1 = global node number corresponding to the local node 1 node_1 = conn(i,1); % node_2 = global node number corresponding to the local node 1 node_2 = conn(i,2); % xx : 1x2 array containing x coordinates of node_1 and node_2 xx = [x(node_1),x(node_2)]; % yy : 1x2 array containing y coordinates of node_1 and node_2 yy = [y(node_1),y(node_2)]; % zz : 1x2 array containing z coordinates of node_1 and node_2 zz = [z(node_1),z(node_2)]; % plot the element i in 2-D using command plot % use axis command to avoid having the plot window too tight axis([-2000 1500 -3000 2500 -500 2500]) % solid line view([1000,1000,1000]) plot3(xx,yy,zz,'--') % hold the current figure for the next element hold on end text(x(conn(1,1)),y(conn(1,1)),z(conn(1,1)),'Node 1',... 'HorizontalAlignment', 'center') text(x(conn(2,1)),y(conn(2,1)),z(conn(2,1)),'Node 2',... 'HorizontalAlignment', 'center') text(x(conn(3,1)),y(conn(3,1)),z(conn(3,1)),'Node 3',... 'HorizontalAlignment', 'center') text(x(conn(3,2)),y(conn(3,2)),z(conn(3,2)),'Node 4',... 'HorizontalAlignment', 'center') text(x(conn(1,2))/2,y(conn(1,2))/2,z(conn(1,2))/2,'Element 1',... 'HorizontalAlignment', 'center') text( x(conn(1,2)) + (x(conn(2,2))-x(conn(1,2)))/2 , y(conn(1,2)) + (y(conn(2,2))-y(conn(1,2)))/2, z(conn(1,2)) + (z(conn(2,2))-z(conn(1,2)))/2 ,'Element 2',... 'HorizontalAlignment', 'center') text( x(conn(1,2)) + (x(conn(2,2))-x(conn(1,2)))/2 , y(conn(1,2)) + (y(conn(2,2))-y(conn(1,2)))/2, z(conn(1,2)) + (z(conn(2,2))-z(conn(1,2)))/2 ,'Element 3',... 'HorizontalAlignment', 'center') hold on mult_factor = 1; d=d*mult_factor; position_d(:, 1) = 1000*[ 0.96 ; 1.92 ; 0 ]; position_d(:, 2) = 1000*[ -1.44 ; 1.44 ; 0 ]; position_d(:, 3) = 1000*[ 0 ; 0 ; 0 ]; position_d(:, 4) = 1000*[ 0+d(10) ; 0+d(11) ; 2+d(12) ]; % set up the nodal coordinate arrays x, y for i = 1 : n_node x(i) = position_d(1,i); y(i) = position_d(2,i); z(i) = position_d(3,i); end % plot the whole truss system % loop over the elements for i = 1 : n_elem % for element i, do the following: % node_1 = global node number corresponding to the local node 1 node_1 = conn(i,1); % node_2 = global node number corresponding to the local node 1 node_2 = conn(i,2); % xx : 1x2 array containing x coordinates of node_1 and node_2 xx = [x(node_1),x(node_2)]; % yy : 1x2 array containing y coordinates of node_1 and node_2 yy = [y(node_1),y(node_2)]; % zz : 1x2 array containing z coordinates of node_1 and node_2 zz = [z(node_1),z(node_2)]; % plot the element i in 2-D using command plot % use axis command to avoid having the plot window too tight axis([-2000 1500 -3000 2500 -500 2500]) % solid line view([1000,1000,1000]) plot3(xx,yy,zz,'-r') % hold the current figure for the next element hold on end % put the title on the figure title('Deformed and Undeformed States of 3-Bar Space Truss System') % label x axis xlabel('x') % label y axis ylabel('y') % label z axis zlabel('z')
Plane View Down x-axis [edit]
Plane View Down y-axis [edit]
Plane View Down z-axis [edit]
Perspective Views [edit]
A perspective view of the undeformed and deformed shapes of the 3-bar space truss analyzed using the Finite Element Method is shown below. This perspective view is from the coordinates: x = -2 m, y = -2 m, z = 3 m
In order to obtain a more clear image of the deformation of the 3-bar space truss system, a perspective view from the coordinates of x = 1 m, y = 1 m, and z = 1 m is shown below.
Contributing Team Members [edit]
Andrew McDonald - Eml4500.f08.bike.mcdonald 21:25, 2 November 2008 (UTC)
Garrett Pataky - Eml4500.f08.bike.pataky 20:25, 3 November 2008 (UTC)
Sam Bernal - Eml4500.f08.bike.bernal 03:32, 7 November 2008 (UTC)
Bobby Sweeting - Eml4500.f08.bike.sweeting 22:10, 2 November 2008 (UTC)
Shawn Gravois - Eml4500.f08.bike.gravois 06:09, 5 November 2008 (UTC)
Eric Viale - Eml4500.f08.bike.viale 21:44, 6 November 2008 (UTC)
equation (2)
![\mathbf{W} \cdot ( \mathbf{\hat{k}q-P} ) = 1[ \sum^6_{j=1}\mathbf{\hat{k}}_{1j} \mathbf{q}_j- \mathbf{P}_1] + 0[ \sum^6_{j=1}\mathbf{\hat{k}}_{2j} \mathbf{q}_j- \mathbf{P}_2] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{3j} \mathbf{q}_j- \mathbf{P}_3] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{4j} \mathbf{q}_j- \mathbf{P}_4] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{5j} \mathbf{q}_j- \mathbf{P}_5] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{6j} \mathbf{q}_j- \mathbf{P}_6]](http://upload.wikimedia.org/math/2/d/8/2d8cf87d0b8416cfa1385ddb69921958.png)



![\mathbf{W} \cdot ( \mathbf{\hat{k}q-P} ) = 0[ \sum^6_{j=1}\mathbf{\hat{k}}_{1j} \mathbf{q}_j- \mathbf{P}_1] + 1[ \sum^6_{j=1}\mathbf{\hat{k}}_{2j} \mathbf{q}_j- \mathbf{P}_2] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{3j} \mathbf{q}_j- \mathbf{P}_3] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{4j} \mathbf{q}_j- \mathbf{P}_4] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{5j} \mathbf{q}_j- \mathbf{P}_5] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{6j} \mathbf{q}_j- \mathbf{P}_6]](http://upload.wikimedia.org/math/c/9/6/c96e978e62e29b8cee2a42fa0c57b0cb.png)



![\mathbf{W} \cdot ( \mathbf{\hat{k}q-P} ) = 0[ \sum^6_{j=1}\mathbf{\hat{k}}_{1j} \mathbf{q}_j- \mathbf{P}_1] + 0[ \sum^6_{j=1}\mathbf{\hat{k}}_{2j} \mathbf{q}_j- \mathbf{P}_2] + 1 [ \sum^6_{j=1}\mathbf{\hat{k}}_{3j} \mathbf{q}_j- \mathbf{P}_3] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{4j} \mathbf{q}_j- \mathbf{P}_4] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{5j} \mathbf{q}_j- \mathbf{P}_5] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{6j} \mathbf{q}_j- \mathbf{P}_6]](http://upload.wikimedia.org/math/0/d/5/0d521a97315f1cedba7149e2ed13d07b.png)



![\mathbf{W} \cdot ( \mathbf{\hat{k}q-P} ) = 0[ \sum^6_{j=1}\mathbf{\hat{k}}_{1j} \mathbf{q}_j- \mathbf{P}_1] + 0[ \sum^6_{j=1}\mathbf{\hat{k}}_{2j} \mathbf{q}_j- \mathbf{P}_2] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{3j} \mathbf{q}_j- \mathbf{P}_3] + 1 [ \sum^6_{j=1}\mathbf{\hat{k}}_{4j} \mathbf{q}_j- \mathbf{P}_4] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{5j} \mathbf{q}_j- \mathbf{P}_5] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{6j} \mathbf{q}_j- \mathbf{P}_6]](http://upload.wikimedia.org/math/b/2/a/b2a4b48822c4192792d9a619eb861134.png)



![\mathbf{W} \cdot ( \mathbf{\hat{k}q-P} ) = 0[ \sum^6_{j=1}\mathbf{\hat{k}}_{1j} \mathbf{q}_j- \mathbf{P}_1] + 0[ \sum^6_{j=1}\mathbf{\hat{k}}_{2j} \mathbf{q}_j- \mathbf{P}_2] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{3j} \mathbf{q}_j- \mathbf{P}_3] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{4j} \mathbf{q}_j- \mathbf{P}_4] + 1 [ \sum^6_{j=1}\mathbf{\hat{k}}_{5j} \mathbf{q}_j- \mathbf{P}_5] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{6j} \mathbf{q}_j- \mathbf{P}_6]](http://upload.wikimedia.org/math/9/2/8/928c5ac9c2c4e55bc90686f8e784cfa9.png)


![\mathbf{W} \cdot ( \mathbf{\hat{k}q-P} ) = 0[ \sum^6_{j=1}\mathbf{\hat{k}}_{1j} \mathbf{q}_j- \mathbf{P}_1] + 0[ \sum^6_{j=1}\mathbf{\hat{k}}_{2j} \mathbf{q}_j- \mathbf{P}_2] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{3j} \mathbf{q}_j- \mathbf{P}_3] + 0 [ \sum^6_{j=1}\mathbf{\hat{k}}_{4j} \mathbf{q}_j- \mathbf{P}_4] + 0[ \sum^6_{j=1}\mathbf{\hat{k}}_{5j} \mathbf{q}_j- \mathbf{P}_5] + 1 [ \sum^6_{j=1}\mathbf{\hat{k}}_{6j} \mathbf{q}_j- \mathbf{P}_6]](http://upload.wikimedia.org/math/9/6/b/96bc97c7a3c116d7e28a86cc3e504943.png)

















