# 14 - Automate Combinations Analysis

## 1.0 Introduction

The Automate Compute option helps users quickly generate results for several SWedge analysis cases at a time by reading in various model inputs from Excel. In this tutorial, we will familiarize you with the Automate Compute feature by automating the computation of several Combinations analysis cases to see how sensitive the Factor of Safety is to varying Joint Water levels.

Topics Covered in this Tutorial:

• Combinations Analysis SWedge Model
• Input Excel File Format
• Pre-processing Input Excel File for Sensitivity Analysis
• Adding Input Excel File(s) to Automate Compute File Queue
• Output SWedge Automate Compute Results File
• Post-processing Output Excel File to Plot Sensitivity Graph

Finished Product:

The finished products of this tutorial can be found in the Tutorial 14 Automate Compute - Combination Analysis folder, located in the Examples > Tutorials folder in your SWedge installation folder. Inside, you will find:

• Tutorial 14 Automate Compute - Combinations_base file.swd7 SWedge model file setup for automation
• Tutorial 14 Automate Compute - Combinations_inputs.xlsx Excel input file
• Tutorial 14 Automate Compute - Combinations_inputs folder containing the computed results files
• Tutorial 14 Automate Compute - Combinations_post-process.xlsx Excel file with all raw combined results data, Excel formula computations, and Excel graph

## 2.0 Creating a New File

1. If you have not already done so, run the SWedge program by double-clicking the SWedge icon in your installation folder or by selecting Programs > Rocscience > SWedge > SWedge in the Windows Start menu.

When the program starts, a default model is automatically created. If you do NOT see a model on your screen:

1. Select: File > New

Whenever a new file is created, the default input data forms valid slope geometry, as shown in the image below.

If the SWedge application window is not already maximized, maximize it now so that the full screen is available for viewing the model.

Before we are ready to run Automate Compute, we must first set up the model environment in the following dialogs:

1. Project Settings
2. Input Data
3. Scale Wedge
This SWedge model file is meant to be used as a base file for automation. It contains the appropriate settings to be used for all automated cases and the engine for computation. It is not meant to be used for model creation and result viewing, as it does not save the model state for every case.

## 3.0 Project Settings

First, set the model Units, Analysis Type, and Block Shape.

1. Select Project Settings from the Analysis menu to open the Project Settings dialog.
2. Set the Units = Metric, stress as MPa
3. Set the Analysis Type = Combinations
4. Set the Block Shape = Wedge
5. Select OK to close the dialog.
The above Project Settings will apply to all cases analyzed in Automate Compute. Each case being analyzed is Combinations (i.e., potentially multiple wedges formed by permutation of joint combinations) in this case.

## 4.0 Input Data

Next, set the optional input data.

1. Select Input Data from the Analysis menu to open the Combinations Input Data dialog.
2. Open the Slope tab.
3. We will keep all the check box controls in the default state. Keep in mind that the following are required input parameters that have to be specified later on in the Input Excel File:

• Slope Dip
• Slope Dip Direction
• Slope Height
• Upper Face Dip
• Upper Face Dip Direction
• Rock Unit Weight
4. Open the Joints tab.
5. Enter the following Joint Planes:
6.  Dip Dip Direction 45 125 70 225 45 185 60 200 65 220 40 130
7. Set Joint Shear Strength Model = Mohr-Coulomb
8. We will keep all the check box and combo box controls in the default state. Keep in mind that the following are required input parameters that have to be specified later on in the Input Excel File:

• Joint Waviness
• Joint Cohesion
• Joint Friction Angle
9. Open the Forces tab.
10. We will leave all the check box controls in the default state (unchecked). No input parameters are required since no Seismic or External Forces are applied.

11. Open the Water tab.
12. Check the Joint Water Pressure check box control.
13. Set the Pressure Distribution Model = Peak Pressure - Beneath Crest
14. Set the radio control to Percent Filled
15. We will leave the Ponded Water Pressure check box controls unchecked. Keep in mind that the following are required input parameters that have to be specified later on in the Input Excel File:

• Joint Water Unit Weight
• Percent Filled
• Hu
16. Select OK to close the dialog.
You can learn about SWedge input data in detail in Overview of SWedge Input Data.

## 5.0 Input Excel File

Now, let's take a look at the structure of the input Excel file.

1. Obtain the SWedge Combinations Excel Template by selecting File > Automate Compute > Combinations Excel Template.
2. A Read-Only Excel workbook titled SWedge Automation Template_Combinations.xlsx will be automatically opened (if you have Excel installed on your local machine).

The SWedge Combinations Input Data Automation Template Excel workbook and worksheets are protected to prevent any accidental modification to the tab structure and headers. The input Excel template contains 5 worksheets for inputting numerical parameters for automation.

3. Create a folder called Tutorial 14 Automate Compute - Combinations.
4. Navigate to the SLOPE worksheet.
5. Under the Wedge ID column, provide the names of the wedges. We will name them according to Joint Water Percent Filled. Each row in the input Excel file represents one Combinations Analysis case in SWedge. We will run a case for each Percent Filled ranging from 0 to 100 percent, by 1 percent increments.
6. Enter the following:
7.  Wedge ID Slope Upper Face Rock Properties Dip Dip Direction Height Dip Dip Direction Unit Weight PF 0 65 185 30 15 185 0.026 PF 1 65 185 30 15 185 0.026 PF 2 65 185 30 15 185 0.026 ... ... ... ... ... ... ... PF 100 65 185 30 15 185 0.026
As set up previously in the SWedge Combinations Input Data dialog, only the above input data are required since Slope Length, Bench Width, and Tension Crack are not applicable (i.e., check box controls are unchecked). Be aware of units set in SWedge Project Settings when entering data into the input Excel file. The units should be the same for both!

The SLOPE worksheet should look like this:

8. Navigate to the JOINTS worksheet.
9. Under the Wedge ID column, provide the names of the wedges.
10. Enter the following:
11.  Wedge ID Joint Cohesion Friction Angle Waviness PF 0 0 32 0 PF 1 0 32 0 PF 2 0 32 0 ... ... ... ... PF 100 0 32 0
As set up previously in the SWedge Combinations Input Data dialog, only the above input date is required since other Shear Strength Model parameters (i.e., Barton-Bandis, Power Curve) are not applicable. Be aware of units set in SWedge Project Settings when entering data into the input Excel file. The units should be the same for both! The Joint Plane orientations (i.e., Dip and Dip Direction) are not automatable inputs. The same Joint Plane orientation(s) will be used for all cases.

The JOINTS worksheet should look like this:

12. Navigate to the WATER worksheet.
13. Under the Wedge ID column, provide the names of the wedges.
14. Enter the following:
15.  Wedge ID Joint Water Pressure Unit Weight Percent Hu PF 0 0.00981 0 1 PF 1 0.00981 1 1 PF 2 0.00981 2 1 ... ... ... ... PF 100 0.00981 100 1
As set up previously in the SWedge Combinations Input Data dialog, only the Joint Water parameters are applicable. Be aware of units set in SWedge Project Settings when entering data into the input Excel file. The units should be the same for both!

The WATER worksheet should look like this:

We do not need to enter any data in the BASAL PLANE, FORCES, or SCALE WEDGE worksheets since those are not applicable.

16. Save the Excel file as Tutorial 14 Automate Compute - Combinations_inputs.xlsx to the Tutorial 14 Automate Compute - Combinations folder previously created.
Since the SWedge Automation Template_Combinations.xlsx file is Read-Only, you must rename and save it in a new location.

We are now ready to automate computations in SWedge by reading from the input Excel file.

## 6.0 Automate from Excel

The Automate Compute dialog allows you to add Excel input automation files to the queue, select an output format, and compute the results.

### 6.1 ADD FILES TO FILE QUEUE

To add multiple files to the File Queue:

1. Select Automate from Excel from the Analysis menu to open the Automated Compute dialog.
2. Select the Open button to open a standard dialog to choose an Excel input file. Navigate to the Tutorial 14 Automate Compute - Combinations folder and select the Tutorial 14 Automate Compute - Combinations_inputs.xlsx file.

You will see the Excel input file appear under the File Queue list box.

## 7.0 Output Result Files

Results files are automatically generated and saved into the same directory as the input Excel file after Automated Compute is complete. Before we run Compute, first ensure that the Output File Format is set to the desired format. Users can select from either Text File or Excel File format.

### 7.1 TEXT FILE FORMAT

While still in the Automated Compute dialog:

1. Set the Output File Format dropdown to Text File.
2. Select the Compute button to start the automated computing process.

The Total Progress can be seen at the bottom of the dialog. When files have finished computing, they will appear in the Completed Files list box.

1. When all files have finished computing, select Exit to close the dialog.

For each input Excel file case, a text file (.txt) containing all results data is generated.

For a Combinations Analysis (Tutorial 14 Automate Compute - Combinations_inputs.xlsx), the results data for each case are output to a separate text file since each case tends to contain multiple wedges formed by joint combinations. Inside each text file, results for all joint combinations wedges in the case are outputted following the header row. Each row of data represents one joint combination wedge. Each data type is separated by a comma (,) for easy parsing.

• Take a look at the ResultsPF 0[0].txt result file.

Note that a total of 101 files with the same format (i.e., ResultsPF 0[0].txt, ResultsPF 1[1].txt, ..., ResultsPF 100[2].txt ) have been created; one file per case. Each of these cases contains 15 wedges formed by joint combinations; some valid and some invalid.

### 7.2 EXCEL FILE FORMAT

Now, we will do the same as before, but this time we will generate the results as an Excel output file format.

1. Select Automate from Excel from the Analysis menu to open the Automated Compute dialog.
2. Select the Open button to open a standard dialog to choose an Excel input file. Navigate to the Tutorial 14 Automate Compute - Combinations folder and select the Tutorial 14 Automate Compute - Combinations_inputs.xlsx file.
3. You will see the Excel input file appear under the File Queue list box.

4. Set the Output File Format dropdown to Excel File.
5. Select the Save As SWedge File(s) checkbox. This will save each automated compute case as an SWedge file.
6. Select the Compute button to start the automated computing process.
7. Since there are already Text File results in the results directory, a popup will appear with the message "Results folder(s) not empty. Duplicated results file(s) will be overwritten. Continue?". Select Yes.
8. When all files have finished computing, select Exit to close the dialog.

For each input Excel file case, an Excel file (.xlsx) containing all results data is generated.

For a Combinations Analysis (Tutorial 14 Automate Compute - Combinations_inputs.xlsx), the results data for each case are output to a separate Excel file since each case tends to contain multiple wedges formed by joint combinations. Inside each text file, results for all joint combinations wedges in the case are outputted following the header row. Each row of data represents one joint combination wedge. Each data type is separated by column.

• Take a look at the ResultsPF 0[0].xlsx result file.

Note that a total of 101 files with the same format (i.e., ResultsPF 0[0].xlsx, ResultsPF 1[0].xlsx, ..., ResultsPF 100[0].xlsx ) have been created; one file per case.

## 8.0 Error Log

As you may have noticed, an Error Log is also generated for each input Excel file. For each input Excel file, an Error Log text file (Automate Compute Error Log.txt) is generated and saved into the same directory as the output file directories. Always check that the Error Log reports "No errors found" before post-processing the raw results data. If any errors do occur as a result of missing (i.e., blank cells) or invalid inputs, the Error Log will indicate which worksheet(s) and cell(s) are problematic.

## 9.0 Sensitivity Analysis Using Post-Processed Results Data

For demonstration purposes, we are going to post-process the results generated from Automate Compute in Excel. We want to generate a plot of Safety Factor vs. Joint Water Percent Filled.

1. Open a new Excel worksheet.
2. Grab the raw data from all Results Excel files.
1. Under the Data tab, select Get Data > From File > From Folder.
2. Browse for the Automate Compute Results Excel Files folder containing the Results Excel files.
3. Select Combine > Combine & Load.
4. Select Combinations Values and OK to extract the data from each Excel file.
5. Wait while Excel runs the background query. The combined data will contain all the computed data.
3. Post-process the data in Excel.
1. Consider only valid wedges (i.e., Safety Factor is not "N/A")
4. Plot Safety Factor vs. Percent Filled in Excel.

The Safety Factor decreases as Joint Percent Filled increases for all joint combinations.

The following joint Combinations have Safety Factors well above 1:

 Joint 1 Joint 2 Dip Dip Direction Dip Dip Direction 45 125 40 130 70 225 65 220

All other joint combinations forming valid wedges must be carefully inspected since they have relatively low Safety Factors.

This concludes the tutorial.