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

Python Task: Implement the connect_howe_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 Howe 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_howe_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 codeTests:test_bridge1= anastruct.SystemElements()v0=(0.5,0.5)test_top_vertices =[v0]v1=(0,0)v2=(0.5,0)v3=(1.0,0)test_bottom_vertices =[v1, v2, v3]bottom_elements_result = connect_howe_truss_vertices(test_bridge1, test_top_vertices, test_bottom_vertices)code_analyser.inspect_bridge(test_bridge1, bottom_elements_result, [v0, v1, v2, v3],[(0,1),(0,2),(0,3),(1,2),(2,3)],"f01")test_bridge2= anastruct.SystemElements()v0=(0.25,0.25)v1=(0.5,0.25)v2=(0.75,0.25)test_top_vertices =[v0, v1, v2]v3=(0,0)v4=(0.25,0)v5=(0.5,0)v6=(0.75,0)v7=(1.0,0)test_bottom_vertices =[v3, v4, v5, v6, v7]bottom_elements_result = connect_howe_truss_vertices(test_bridge2, test_top_vertices, test_bottom_vertices)code_analyser.inspect_bridge(test_bridge2, bottom_elements_result, [v0, v1, v2, v3, v4, v5, v6, v7],[(0,1),(0,3),(0,4),(1,2),(1,4),(1,5),(1,6),(2,6),(2,7),(3,4),(4,5),(5,6),(6,7)],"f02")test_bridge3= anastruct.SystemElements()v0=(0.16666666666666666,0.16666666666666666)v1=(0.3333333333333333,0.16666666666666666)v2=(0.5,0.16666666666666666)v3=(0.6666666666666666,0.16666666666666666)v4=(0.8333333333333333,0.16666666666666666)test_top_vertices =[v0, v1, v2, v3, v4]v5=(0,0)v6=(0.16666666666666666,0)v7=(0.3333333333333333,0)v8=(0.5,0)v9=(0.6666666666666666,0)v10=(0.8333333333333333,0)v11=(0.9999999999999999,0)test_bottom_vertices =[v5, v6, v7, v8, v9, v10, v11]bottom_elements_result = connect_howe_truss_vertices(test_bridge3, test_top_vertices, test_bottom_vertices)code_analyser.inspect_bridge(test_bridge3, bottom_elements_result, [v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11],[(0,1),(0,5),(0,6),(1,2),(1,6),(1,7),(2,3),(2,7),(2,8),(2,9),(3,4),(3,9),(3,10),(4,10),(4,11),(5,6),(6,7),(7,8),(8,9),(9,10),(10,11)],"f03")
The switch from diagonally up to diagonally down always happens at the midpoint of the bridge. A Howe Truss bridge must therefore always consist of an even number of segments.
Task 8: Implement the connect_howe_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 Hon
# 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 modute (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_howe_truss_vertices(bridge, top_vertices, bottom_vertices): # do not change this line in any way - the pass # TODo: replace this line by your code
Python Task: Implement the connect _ howe _ 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!