COS 323 - Computing for the Physical and Social Sciences

Fall 2013

Course home Outline and lecture notes Assignments


Assignment 1: The Pratt Truss Bridge

Due Tuesday, Oct. 8


Calhoun Street Bridge, Trenton NJ

In this assignment, you will analyze the design of a truss bridge. The inputs will be the length and height of the bridge, the number of truss sections, and the amount of weight it needs to support. You will write a Matlab function that computes a matrix relating the net force on each joint to the tensile and compressive forces in the beams, and solve the resulting linear system to tell you how much tension or compression each beam undergoes. Finally, you will analyze how the optimal design depends on the number of sections and the height. Your computed forces will look like this:


1. The Pratt truss structure

We will be working with a design called the Pratt truss, originally designed by Thomas and Caleb Pratt in 1844. Here is how it looks:

This particular (6-section) structure has 21 truss members or beams and 12 joints. A joint is any point at which at least two members meet. In general, we can extend the design to more or fewer sections (to keep things simple, let's only consider symmetric structures with an even number), and end up with 2n joints and 4n-3 members where n is the number of sections of the bridge. You may assume that the number of sections, n, is greater than or equal to 2 and even only. You may also assume and use symmetry in the Truss design. Here are the designs for n = 4 and n = 2. The latter is called the King truss, and has been used since the middle ages.

We are interested in computing the compression or tension on each beam, once forces are applied to the structure. To simplify things, we ignore the weight of the structure itself, and consider that the entire load is split evenly among the center sections while support forces are applied at the ends:

As a result of these applied forces, the truss members will have compressive and tensile forces applied to them. We adopt the convention that compression is positive and tension is negative, so a beam with a positive internal force will be pushing on the two joints it connects, while a member with negative force will be pulling. Now, we have the condition that the sum of forces at each joint must be zero. (Otherwise the joint would be accelerating -- very much not what we want!) So, let's number the joints and members as follows

and consider the force diagram for J5:

Therefore, we have two equations for each joint, one giving the horizontal balance of forces and one for vertical. The unknowns are the internal forces in each beam, plus the three support forces, giving us a total of 4n equations and 4n unknowns (the horizontal support will always be 0 in the case of a level structure, but we include it anyway to make the number of unknowns equal to the number of equations).

We ask that you adopt the convention of numbering joints and members shown above, and that you put the first joint at the origin. We provide the following three files. The first of these constructs a structure representing the bridge (span, height, and number of sections); the second is a visualization of the bridge (and later the forces on it), and the last is a helper function to draw arrows. We define span as the total length of the base of the bridge (i.e., distance from J1 to J12 above).

We first need to locate the joints and members and figure out which joints are attached to which members. You can do so by completing the files:

drawBridge makes calls to the above two functions; once those are completed, you can use it to check the member and joint positions.


2. Solving the equations

Write a Matlab function that takes as input:

The function should return a matrix A and vector b such that The Matlab function should have the following declaration and be in a file called solveBridgeForces.m: function [A, b] = solveBridgeForces(bridge, total_load)
Please follow this declaration exactly, so that we can call your code in our testing code.

The rows of A represent equations for each joint, and the columns represent the dependence on an unknown force. Any arrangement of the rows and columns of A (and b), and a multiplication of each equation by a non-zero scalar will produce an equivalent system. To make your arrangement compatible with the visualization we provide, we ask that you follow these conventions:

The thing that makes this tricky is dealing with n as a parameter to the function. You may find it easiest to first create A as a matrix full of zeros

A = zeros(4*n,4*n);
then loop through the members, or through the joints, filling in the appropriate nonzero entries. Think carefully about how you want to do this and how you might be able to use functions from the previous part. You did a lot of case analysis in the previous part that you do not want to repeat. Hint: A will be a sparse matrix with a very small set of values in it that should be clear from your case analysis.

Once you can create A and b, solving for x is as easy as

x = A\b;

With drawBridge, you can visualize the bridge, the bridge with load forces (from b), and the bridge with internal forces (using b and x). Compression forces are blue, and tension forces are red. Make sure you are happy with the solutions; if you wish, you can test a particular case here:

http://www.jhu.edu/~virtlab/bridge/bridge.htm

Produce visualizations of forces for two bridges with 4 sections, of span 4, of heights 1 and 2, and save these as images. Your code that creates the requested bridge images should be in a file named visualizeBridge.m


3. Analysis

Look at the pattern of compressive and tensile forces in the structure. Are the innermost diagonal members under compression or tension? Which beams have the greatest stresses for very tall bridges? For very short bridges?

Explain why the Calhoun Street Bridge in Trenton NJ shown above can use cables for the diagonal members.

Compute the maximum compressive or tensile force in any beam in the bridge (using the max and abs functions). Assuming all the beams are made with the same cross section, this will determine how thick the beams have to be. Since the capacity of a beam is proportional to its cross sectional area, and since the cost of the materials is proportional to length times area, the materials cost of the bridge is just proportional to

|max force| * (total length of beams)
(ignoring things like safety margins, cost of the joints, resistance to wind forces, etc.) So, you can evaluate different designs for bridges that use different values for height and n (while holding total load and span constant):

This graph shows the cost (y axis) for a given height-to-span ratio (x axis), for n = 2 (red) and n = 6 (blue). Produce graphs such as this for values of n from 2 to 10. Based on these, what can you say about when it's best to use different values of n? (e.g., for fairly low bridges, is it better to use more or fewer sections?) Your code that creates the requested graph of the height-to-span ratio vs. cost should be in a file named plotCosts.m. The plotCosts.m code may use any other functions you would like. Clearly comment how you solve for the max forces and costs and indicate which file(s) include the corresponding code in your write up file.

4. Optimization

Implement the golden-section search method for function minimization. Use it to find the optimal height-to-span ratio for any given n. Generate and submit a plot showing the optimal height-to-span ratio as a function of n.  Implement the golden-section method in a file named goldenSection.m for a function named goldenSection. This goldenSection function must return only one value, the optimal height-to-span value, and must accept at least one input, n, the number of sections, but you can design it to have as many other input arguments (such as even the function to optimize) as you would like. Be clear in how to use your function in your comments. Your code to plot the optimal height-to-span ratios should be saved in a file named plotOptima.m



Submitting

This assignment is due Tuesday, October 8, 2013 at 11:59 PM. Please see the course policies regarding assignment submission, late assignments, and collaboration.

Please submit:

The Dropbox link to submit your assignment is  here.

If you're feeling ambitious, you can also investigate some of the other designs illustrated here, such as the Warren and Howe trusses.


Disclaimer: I am not a structural engineer. I don't even play one on TV. Consult someone experienced before designing any real bridges. --- smr


Last update 30-Sep-2013 13:09:15
smr at princeton edu