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:
since R=KU-F. I have not yet tested your MSA code, but at a glance, it appears to have the same issue.
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
No actual code changes but should be easier to understand, and have confidence in this code
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.
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
29 Feb 2008
20 Feb 2008
02 Nov 2007
01 Jul 2007
27 May 2007
thanks for this file
23 May 2007
+Publis M-files application and theory (1)
+Graphical program interface (5)
+Workable program description (2)
+Works references (3)
+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)
Seleceted file name (3)
Per files comment (3)
All files usefuly (4)
Nice works, I think needs improvements.