Truss3 in Larrys Toolbox not returning an answer (NaN)
Show older comments
I've been trying to get 'Larrys Toolbox' working after watching the introduction video on how to use it to solve for space frame trusses.
I have been able to run both the example files ('truss3ex.m' and 'truss3ex2.m') with no problems (beyond replacing a 'VIEW' with a 'view') however when I try and create a file to input my own geometry and loads the script will only partially complete. I have attached the files in question in a .zip.
When I run the files in the attached .zip, the script will output a graph of the undeformed geometry, 

but then it gives the following output:
>> brads_truss
Current plot held
Warning: System may be partially constrained.
> In truss3 (line 222)
In brads_truss (line 31)
Warning: Matrix is singular to working precision.
> In truss3 (line 224)
In brads_truss (line 31)
peak_klb =
162
maxMforce_klb =
NaN
maxDX_in =
NaN
maxDY_in =
NaN
maxDZ_in =
NaN
I'm not sure what 'NaN' means but the MATLAB documentation says it is the IEEE representation for 'not a number'.
This is the same with both my original 'brads_truss.m' file and the 'brads_truss_customary_units.m' file. The original file has SI units, while the second one is converted to U.S. customary units.
I've looked in the truss3.m file, but I cannot see any constants that could be removed or changed to account for the change from customary units to SI.
Does anyone know what I might be doing wrong?
*****************************************************************************************************************
MATLAB 'ver' info included below:
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.5.0.1033004 (R2018b) Update 2
MATLAB License Number: nnnnnnn
Operating System: Microsoft Windows 10 Home Version 10.0 (Build 18362)
Java Version: Java 1.8.0_152-b16 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.5 (R2018b)
Simulink Version 9.2 (R2018b)
Computer Vision System Toolbox Version 8.2 (R2018b)
Control System Toolbox Version 10.5 (R2018b)
DSP System Toolbox Version 9.7 (R2018b)
Data Acquisition Toolbox Version 3.14 (R2018b)
Image Processing Toolbox Version 10.3 (R2018b)
Instrument Control Toolbox Version 3.14 (R2018b)
MATLAB Coder Version 4.1 (R2018b)
Optimization Toolbox Version 8.2 (R2018b)
Robotics System Toolbox Version 2.1 (R2018b)
Signal Processing Toolbox Version 8.1 (R2018b)
Simscape Version 4.5 (R2018b)
Simscape Multibody Version 6.0 (R2018b)
Simulink Control Design Version 5.2 (R2018b)
Statistics and Machine Learning Toolbox Version 11.4 (R2018b)
Symbolic Math Toolbox Version 8.2 (R2018b)
>>
Accepted Answer
More Answers (1)
Christoph Hahn
on 1 Oct 2019
Edited: Christoph Hahn
on 1 Oct 2019
1 vote

Hi Brad,
I am using here Larry's example 'truss3x2.m' for illustration purpose.
He uses 3 types of joints (one could also say nodes)
- blue: joints are constrained in x,y,z. there are recation forces in x,y,z.
- red: loads are introduced at these joints
- green: joints are neither constrained nor loaded.
Note: Read the comments in 'truss3.m' to get all details how loads and boundary conditions can be introduced.
In your case, members and joints seem to be meaningful, because it can be plotted. Something seems to be messed up with the loads / boundary conditions -> so you need to look into defining forceJ carefully.
So, I suggest you start with a very simple case for forceJ such as depicted in the image. I used the same color scheme as in my example above.

Hope this helps.
Best, Christoph
Categories
Find more on Structural Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

