1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Building a truss with matlab -- Need help

  1. Nov 22, 2015 #1
    1. The problem statement, all variables and given/known data
    I am suppose to build a truss using a matlab code given to me. I have to identify the joint coordinates, member assembly, and load matrix. The code is suppose to calculate the deflections like fea. I have put everything in but when the code runs my deflections are "NaN" which means not a number. I have no idea what to do since this is my first time using matlab. What could be the reason for this result?

    2. Relevant equations

    % class design project example


    % all of the members are quenched steel

    % k = 2000 k-lb, Pmax = 1500 k-lb (A = 100 sq-inch)



    n = 24; m = 60; LOADZ = -20000/2; LOADY = 1000/2; A = 100;

    joint = [0,0,0;0,0,-10;0,0,-20;12,0,0;12,0,-10;12,0,-20;...




    assembly = [1,2;1,4;1,7;2,3;2,4;2,5;2,6;2,7;2,8;3,6;3,8;...






    forceJ = [3,1,1,1;3,1,1,1;3,1,1,1;3,1,1,1;3,1,1,1;...


    -1,0,0,0; -1,0,0,0;-1,0,LOADY,LOADZ;-1,0,0,0;...



    for i = 1:m; stretch(i) = 2000*1000; end; stretch(1);


    index = 1;

    [Jforce,Mforce,Jdispl,Mdispl] = ...



    peak_klb = 18*A

    maxMforce_klb = max(abs(Mforce/1000))

    maxJdispl = max(abs(Jdispl*12));

    maxDX_in = maxJdispl(2),maxDY_in = maxJdispl(3),maxDZ_in = maxJdispl(4)

    3. The attempt at a solution
  2. jcsd
  3. Nov 22, 2015 #2


    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    In order for the stiffness matrix equations to have a solution, at least one or more nodes need to have an initial displacement specified. Thus usually is accomplished by specifying a zero displacement at the support points of the structure.

    It's not clear from your code where such initial conditions are specified by the user. Without being able to specify an initial displacement for at least one node, the stiffness matrix equations are probably giving a singular result when the deflections are being solved for.

    See p. 11 of the following article:

    http://www.engr.sjsu.edu/ragarwal/ME273/pdf/Chapter 4 - Beam Element.pdf
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted

Similar Discussions: Building a truss with matlab -- Need help
  1. Truss help immediate (Replies: 12)

  2. Statics Help (Trusses) (Replies: 1)

  3. MATLAB building matrix (Replies: 8)