Question: Task 6 : Implement the connect _ warren _ truss _ vertices function in the code cell below. # This function adds truss elements to

Task 6: Implement the connect_warren_truss_vertices function in the code cell below.
# This function adds truss elements to connect each of the top and bottom vertices according to the pattern of a War
# It also computes and returns a list of the element ids of the "green" elements across the bottom of the bridge.
# Parameters:
# - bridge a SystemElements object from the AnaStruct module (to which we can add truss elements).
# - top_vertices a list of the x,y coordinates of the vertices in the top row (ordered from left to right)
# - bottom_vertices a list of the x,y coordinates of the vertices in the bottom row (ordered from left to right)
# Return values:
# - a list of the element ids of the "green" elements across the bottom of the bridge.
def connect_warren_truss_vertices(bridge, top_vertices, bottom_vertices) : # do not change this line in any way - th
pass # ToDo: replace this line by your code
Tests ...Warren Truss - Connect Vertices
The logic for connecting all these vertices according to the Warren Truss pattern can become overwhelming complicated. So, as always, proceed step by step with each category of edges. First work out how to add each of the (orange) top edges. Once you've tested that and it works, go on to progressively add each of the (green) bottom edges, then the purple diagonally up edges and finally the pink diagonally down edges. Make sure you test after each step and get it working before proceeding. The tests below (for various sized bridges) will provide you with a visual depiction of the edges you have created, so you can easily spot any obvious mistakes. Importantly, note how the top and bottom vertices are numbered in the diagram above. For example the pink edges are from node 0 of the top list to node 1 of the bottom list, from node 1 of the top list to node 2 of the bottom list and so on. Work out the pattern and use it to write a loop that indexes appropriately into the top and bottom vertex lists.
Python task: Implement the connect_warren_truss_vertices function in the code cell below.
# This function adds truss elements to connect each of the top and bottom vertices according to the pattern of a Warren Truss. # It also computes and returns a list of the element ids of the "green" elements across the bottom of the bridge. # Parameters: # - bridge a SystemElements object from the AnaStruct module (to which we can add truss elements). # - top_vertices a list of the x,y coordinates of the vertices in the top row (ordered from left to right) # - bottom_vertices a list of the x,y coordinates of the vertices in the bottom row (ordered from left to right) # Return values: # - a list of the element ids of the "green" elements across the bottom of the bridge. def connect_warren_truss_vertices(bridge, top_vertices, bottom_vertices): # do not change this line in any way - the function name and parameters must remain exactly as specified here
pass # ToDo: replace this line by your code
Task 6 : Implement the connect _ warren _ truss _

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!