No BSD License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

### Highlights from Truss Analysis

4.3125
4.3 | 16 ratings Rate this file 79 Downloads (last 30 days) File Size: 92.9 KB File ID: #14313 Version: 1.0

# Truss Analysis

### Hossein Rahami (view profile)

17 Mar 2007 (Updated )

A very simple M-file for analysis of any truss

File Information
Description

A very simple M-file for analysis of any truss (2-D & 3-D), calculating of forces, deflections , reactions and drawing the truss and deformation shape

Acknowledgements
MATLAB release MATLAB 7 (R14)
Tags for This File   Please login to tag files.
 Please login to add a comment or rating.
Comments and Ratings (18)
01 May 2016 Zeeshan Chughtai

### Zeeshan Chughtai (view profile)

03 Dec 2015 Johnny Domina

### Johnny Domina (view profile)

I cannot get this program to run with a simple truss I am trying to use and I cannot figure out what is wrong with the data.

Coord=[0 16.25 0;16 16.25 0;24 16.25 0;0 0 0;8 0 0;24 0 0]; % coordinates of nodes
Con=[1 2;2 3;2 5;4 5;5 6;3 6];
Re=[1 1 1;0 0 1;0 0 1;1 1 1;0 0 1;0 0 1];
Load=zeros(size(Coord)); Load(6,:)=[0 -10 0];
%Load=[0 0 0;0 -1e5 0;0 0 0;0 -1e5 0;0 0 0;0 0 0];
E=ones(1,size(Con,1))*102000; %*1e7; % Elasticity ( Youngs Modulous)
%E=[1 1 1 1 1 1 1 1 1 1]*1e7;
A=[.25 .25 .25 .25 .25 .25];
D=struct('Coord',Coord','Con',Con','Re',Re','Load',Load','E',E','A',A');

The output:
F =

0 0 0 0 0 12.2596

U =

1.0e+13 *

0 0 0 0 0 0
0 0 -5.7399 0 0 -5.7399
0 0 0 0 0 0

R =

0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0

Comment only
11 Dec 2012 Chris Jobes

### Chris Jobes (view profile)

Very concise code, a bit hard to understand for a novice without a lot of work, but pretty straight forward for those of us in the field. I decided to compare it to a MATLAB script that I wrote based upon Moaveni's book many years ago. It was not nearly as concise, but much more understandable.

I do have an issue with the ST.m code, however. There appears to be an error that only appears if a load is applied to a node that has constrained movement in that direction.

A quick check of the applied loads and reaction force sums should yield 0 in the x and y directions. In one of my test scripts, it did not. The test was a roof truss with snow load concentrations applied at the upper nodes. Two of those nodes had vertical constraints where the truss rested on the wall top plates and the reaction forces I calculated using this script were incorrect.

The fix is easily made and only appears in an odd case. Line 9 should be:

R=reshape(S*U(:),w)-D.Load;R(f)=0;

since R=KU-F. I have not yet tested your MSA code, but at a glance, it appears to have the same issue.

Otherwise, great job.

31 Oct 2012 tong mu

### tong mu (view profile)

06 Sep 2012 Frank McHugh

### Frank McHugh (view profile)

For the convience of those who found this code to obtuse, I've uploaded a copy with the ST function reformatted and extensive comments added at
http://www.mathworks.com/matlabcentral/fileexchange/38044
No actual code changes but should be easier to understand, and have confidence in this code

Comment only
25 Aug 2011 Jeffrey Kantor

### Jeffrey Kantor (view profile)

Amazingly brief, but hard to decipher. Sorry to be a killjoy, but this would be better if the functions included even minimal comments and documentation, and was written for clarity rather than brevity.

21 Mar 2011 mohan l

### mohan l (view profile)

24 Feb 2009 Guillermo Rein

### Guillermo Rein (view profile)

Thanks for sharing this excellent script. I have used it for two years now in my Mechanical Design course (~60 students each). The students find difficulties in the Help.doc document but otherwise the code is robust, simple and fast to solve trusses.

04 May 2008 helen joli
29 Feb 2008 Charlie Seviour

Thanks

20 Feb 2008 Emilio Elli
02 Nov 2007 ali yaseri

thanks

01 Jul 2007 mohamad ordelalu

tanks alot

27 May 2007 navid amiry

thanks for this file

23 May 2007 Ali Özgül

Documentation:
+Publis M-files application and theory (1)
+Graphical program interface (5)
+Workable program description (2)
+Works references (3)

Programming:
+M-files complexity (4)
+Mlint error message (5)
+Help problems (2)
+Filename of clashes (5)
+Clone the code line (5)
+Program's symbolic manuscript (3)
+Program samples and runing test (3)
+System requirements (5)
+Program running speed (5)

Files archive:
Seleceted file name (3)
Per files comment (3)
All files usefuly (4)

Thanks:
Nice works, I think needs improvements.
Good works.

10 Apr 2007 Menza T

Nicely written.

23 Mar 2007 anjo mirend

great works :) thanks

20 Mar 2007 edurzimo porteynizm

that's very brief! excelent

Updates
20 Mar 2007

A New Help

21 Mar 2007

Updating

26 Mar 2007

Changing Category

26 Mar 2007

Plot The Truss

26 Mar 2007

Draw Truss and Deformation Shape

27 Mar 2007

Adding an image

12 Apr 2007

Reactions

Contact us