Tutorial 4: Bridge
In this Tutorial we are going to create, analyze and optimize a bridge. For this exercise you need the full version of Karamba3D You can get the file used for this tutorial here: Karamba3D: Tutorial 4
Note: When opening the file ignore the message of the missing installation of the
"Bifocals" add-on. If however you wish to install it, you can direct here: Bifocals
Contents
- 1 Step 1: Create a Space Truss
- 2 Step 2: Create Supports
- 3 Step 3: Specify the Structural Elements
- 4 Step 4: Loads
- 5 Step 5: Cross Sections
- 6 Step 6: Specify Material
- 7 Step 7: Assemble the Model and Analyse it
- 8 Step 8: Checking Supports and Loads
- 9 Step 9: Preview results
- 10 Step 10: Stress Data
- 11 Step 11:Prepare the Objectives of the Optimization
- 12 Step 12: Octopus
Step 1: Create a Space Truss
For this step you are going to need the LunchBox Add-On. You can refer to the Installing and using Grasshopper Plugins for installation instructions
- Create two base lines in Rhino and connect them to the Curve Parameter. In this example a 14 meters length and a 3m span are used, but you can try other numbers as well.
- Connect the initial curves to the Loft component found at
- Connect the lofted surface to the Space Truss Structure 1 component found at
- Set the U division to "1".
- Set a V division.
Step 2: Create Supports
- Get the endpoints of the base curves using the End Points
- Connect the Start and End points to the Support(Karamba3D) component as in the previous tutorials.
- Create one Support that does not allow translations, by opening the Conditions and selecting the Tx, Ty, Tz options.
- Create one Support that allows translations only along the length axis of the bridge, in this case it is the y axis, therefore you need to enable the Tx and Tz options.
Note: We will verify later the fixations at the supports with the Model View at Step 8.
Step 3: Specify the Structural Elements
From the Space Truss that we created with LunchBox we get the structure lines in separate outputs.
- Connect the 2 sets of Primary Lines and the Web Lines to three different Line to Beam components specifying each time a different Identifier in this case beam1, beam2 and beam3.
- Gather all the elements using the Merge component and flatten its output
Step 4: Loads
Uniform Mesh Load
Let's assume a Uniformly Distributed Load of 5kN per square metre on the bridge's floor. This load will be transferred to the bridge via the top joints with Point Loads.
- Take the lofted surface from step one and use Mesh Surface component to turn the surface into a Mesh.
This time we want the Vertices of the Mesh to coincide with the Point Loads.
- Set the U Count to 1 and the V Count to the number of the V Divisions of the Space Truss Structure 1.
- Specify the LCase in this case it is 0.
- Open the Generation Option and choose the Point loads to restrict the Mesh Load only to the Points.
Note: It is advised that you later check the loads with the Model View. This will be done at Step 8.
Gravity
- Create a Gravity Load as in Tutorial 1: Simple Beam at Step 6.
- Specify the Load Case by connecting a panel with a unique number to the LCase, in this case it is "1".
- Gather all the Loads using the Merge component.
Step 5: Cross Sections
- Create a Cross Section Selector as in Tutorial 1: Simple Beam at Step 3.
- Specify the Maximum height and the Maximum width of the cross section.
Let's pick a cold formed circular hollow section:
- Choose EU from Country, O from Shape and CHS(EN10219-2) from family
If the maximum height and width of the cross section is 20 cm, we get a range of 81 cross sections. Let's specify different cross sections for our beams:
- Create three Cross Section Range Selectors and input the identifiers of the beams.
- Input a slider at the 'Name or list index of cross section. The minimum value has to be 0, the maximum 81 and the results integer numbers. For now leave the slider in a random number.
Step 6: Specify Material
We are now going to create a steel material:
- Create a new Material with Material Selection and choose Steel from family and A36 from Name.
Step 7: Assemble the Model and Analyse it
- Use the Assemble Model component and connect all the entities to the Assembly. Make sure all the lists are flatten.
- Connect the Model from the Assemble Model to the Analyze component.
Step 8: Checking Supports and Loads
Before getting the results, verify that the settings for the supports and loads are correct:
- Connect the Calculated model from the Analyze component to the Model View component
- Open the Display Scales bar and check Loads and Supports. You can tweak the size of the preview by moving the slider bellow.
- Open the Tags bar and check Load values.
Now you are able to see the reaction forces at the supports and the point loads.
Step 9: Preview results
Let's visualise the stresses on the beams:
- Connect the Calculated model from the Analyze component to the Beam View *Choose in the Render Settings the property that you want to see rendered, in this case it is the Axial Stress.
- Connect the Legend C (Legend Colors) and the Legend T (Legend Tags) to the Legend component
Notice that the lower beams have larger absolute results.
Step 10: Stress Data
- Connect the Calculated model from the Analyze component to the Utilization of Elements component found at
The outputs sig-max , sig-min and tau-max include the maximum axial normal stress, the minimum axial normal stress and the maximum shear stress respectively, for each beam separately.
Step 11:Prepare the Objectives of the Optimization
In the following steps, we are going to optimize our structure for less material usage and minimization of the stresses at the beams.
You are required to install the Octopus add-on. You can download it from here.
Octopus allows Multi-Objective Evolutionary Optimization, that means we can optimize for more than one objective. In this case those are:
1. Material Mass
2. Stress
Note: The algorithm always tries to reduce the value of our objectives so if the goal is to maximize them then simply convert them to negatives.
a. Maximum Absolute Stress value
Something that we need to keep in mind when using Multi-Objective optimizers is that the less objectives, the faster and easier is the process. For this reason, in order to reduce the computational time, out of all the values of stresses, we are gonna isolate the maximum absolute one.
- Merge the sig-max , sig-min and tau-max outputs from the Utilization of Elements into a single list.
- Get the absolute values with the Absolute Component.
- Sort the values with Sort List component.
- Retrieve the last item of the list by selecting the index -1 with List Item.
- Connect the value to the Number component. Then right click to the battery and tap "Stress" to the top area, to specify a name for the objective.
b. Material Mass
To get the total mass of the structure:
- Connect the Mass output from the Assemble Model to the Number.
- Right click to the battery and tap "Material" to the top area.
Step 12: Octopus
Connect Objectives and Parameters
Now lets see how we can connect the objectives to Octopus:
- Use the Octopus component found at
The O must contain the objectives that Octopus will try to reduce. The G all the Parameters that will change during the optimization process. To connect the objectives and parameters to the octopus:
- Left click inside the O or G and hold the mouse pressed.
- Then drag the arrow on top of the number that contains objectives and parameters.
- To add more numbers repeat the process by holding the Shift key pressed.
- To remove numbers repeat the process by holding the Ctrl key pressed.
Connect to the G input of Octopus:
- The sliders containing the index of cross section, from the Cross Section Selector.
- The sliders containing the V Divisions from the Space Truss Structure 1.
Also connect the Objectives to the O input
Interface
Now let's prepare the settings óf the optimization:
- Double click the Octopus battery to open its window. Note that you might need to persist.
On the window that has open you can see:
- The Design space in the centre.
- On the right the available algorithms (keep the default options).
Before running the optimization:
- Set the maximum desired values of the objectives. Check the box next to the Stress objective and input "22.06" as a maximum value (see the image on the right). That is the yield stress value of the material.
The algorithm will start from a population of randomly generated individual solutions, and is an iterative process, with the population in each iteration called a Generation.
- Set a maximum number of Maximum Generations (see the image on the right).
Lets run the optimization! Click the Start Button on the top right side of the window.
Results
As soon as you hit start the OctopusStopDialog a Stop/Pause window will open and you will see solutions being generated inside the Design Space.
When the maximum generated solutions are reached, the optimization stops and you can see all the available solutions. The ones closer to the beginning of the axes are the ideal ones.
Lets pick a solution that provides a minimum value for both of our objectives:
- Left click one of the generated points and choose Generate solution.
Lets see the provided solution. Notice that Octopus managed to predict that the lower beams require larger cross sections than the top ones.