Table Internet Application Configurer

This tutorial allows you to build an application to design a table.

To build this application:

  • Gather the customer inputs

    • Required size

    • Load

    • Maximum cost

  • Calculate costs

  • Prove the design using simulation

  • Store the design

Tutorial Workflow

CAx Experts:

  • Python expert: Create Table top model

  • MATLAB expert: Create Table leg model

  • Excel expert: Create Table cost model

  • optiSLang expert: Create Table load model

Simulation expert: Create sub-optiSLang Table load project.

Workflow expert:

  • Combine simulation models

  • Calculate total table cost and table load if the total cost is less than the maximum cost

  • Add load simulation

  • Publish workflow

User (manager or a customer): Run and use the workflow.

CAx Experts

Python Expert

Calculate volume and area of the table top using Python.

MATLAB Expert

Calculate volume and area of one table leg using MATLAB.

Excel Expert

Calculate table costs using Excel.

optiSLang Expert

Calculate table stress level using optiSLang.

CAx Workflow Expert

Simulation Expert

Create the Table load optiSLang project. For more details, see Creating the Table Load Model using optiSLang.

CAx System Expert

Workflow Expert

Creates and publishes the workflow. For more details, seeCreating the Table Workflow and Publishing the Workflow.

Product Analyst

User

The user runs and uses the workflow.

Prerequisites

You must install the optiSLang Web Service (web interface for optiSLang) before starting this tutorial.

Preparation

Before you start the tutorial, download the table zip file from here , and extract it to your working directory.

Creating the Table Load Model using optiSLang

In this section of the tutorial, you will:

  • Generate a solver chain using text based optiSLang solver

  • Define the parameters and responses

  • Define the solver call setup

  • Specify parameter properties

Creating a New Table Load Project

  1. Start optiSLang.

  2. Create a new guided project.

  3. Expand Preferences.

  4. Clear the Create in parametric system check box.

  5. From the solver list, click Common text based.

Selecting the Input File

  1. In the Select input file dialog box, browse to the table folder and select table.s.

  2. Click Open.

Defining the Input Parameters

  1. In the text editor, highlight object read, , table_top_length.

  2. Right-click the selection and select Use object read, , table_top_length as marker from the context menu.

  3. Highlight the number to the right of object read, , table_top_length.

  4. Rename the parameter to table_top_length.

  5. To register the parameter, click Add.

  6. Repeat this procedure for table_top_width, table_top_height, table_leg_height, table_leg_radius, load.

  7. Click Next.

Editing the Parameter Properties

  1. Double-click the range numbers for row 1 (table_top_length).

  2. Change the lower bound to 0.8 and the upper bound to 1.2.

  3. Double-click the range numbers for row 2 (table_top_width).

  4. Change the lower bound to 1 and the upper bound to 5.

  5. Double-click the range numbers for row 3 (table_top_height).

  6. Change the lower bound to 0.01 and the upper bound to 0.07.

  7. Double-click the range numbers for row 4 (table_leg_height).

  8. Change the lower bound to 0.7 and the upper bound to 0.9.

  9. Double-click the range numbers for row 5 (table_leg_radius).

  10. Change the lower bound to 0.01 and the upper bound to 0.02.

  11. Double-click the range numbers for row 6 (load).

  12. Change the lower bound to 0 and the upper bound to 500.

  13. Click Next.

Selecting the Output File

  1. In the Choose a file to open dialog box, browse to the table folder and select table.out.

  2. Click Open.

Defining the Response

  1. From the File format list, ensure Plain text file is selected and click OK.

  2. Highlight the text in line 4 (stress_level_top).

  3. Right-click the selection and select define marker > use "stress_level_top" as marker from the context menu.

  4. Click Use as response.

  5. Repeat steps 2-4 with stress_level_leg.

Adding a New Variable

  1. Switch to the Variables tab.

  2. Click Add variable.

  3. Click the ID cell of the new variable, type load_proofed and press Enter.

  4. Right-click the Expression cell of row 3 (load_proofed) and select Open Calculator from the context menu.

  5. Enter the following conditional expression:

    #IF (stress_level_leg<= 1.0)&& (stress_level_top<= 1.0) #THEN 1#ELSE 0
  6. Click OK.

  7. Drag the load_proofed row into the Responses pane to register it as a response.

  8. Click Next.

Defining the Optimization Criteria

  1. Do not adjust or add to the currently displayed values for parameters, responses, and criteria.

  2. Click Next.

Importing the Solver Call File

  1. To the right of the Absolute path field, click the orange folder.

  2. Browse to the table folder and select table.bat for Windows systems or table.sh for Linux systems.

  3. Click Open.

  4. Click Next.

Finishing the Solver Wizard

  1. Ensure the Create a template from solver chain check box is clear.

  2. Click Finish.

    The solver chain is displayed in the Scenery pane.

Saving and Running the Table Load Project

  1. To save the project, click  .

  2. Browse to the location to save the project and type table_load_slang in the File name field.

  3. Click Save.

  4. To run the project, click  .

  5. To review the result, select Project > Project overview and switch to the Result designs tab.

Creating the Table Workflow

In this section of the tutorial, you will:

  • Generate a solver chain

  • Define the parameters and responses

  • Use conditional execution

Creating a New Table Workflow Project

  1. Start optiSLang.

  2. From the Start screen, click Guided.

  3. Expand Preferences.

  4. Clear the Create in parametric system check box.

  5. From the solver list, click Python.

Selecting the Table Top Input File

  1. In the Select input file dialog box, browse to the table folder and select table_top.py.

  2. Click Open.

Selecting the Table Top Parameters and Outputs

  1. From the Detect assignments drop-down list, select Test run.

  2. In the Python table, select table_top_height, table_top_length and table_top_width and drag them to the Parameter pane.

  3. In the Python table, select table_top_area and table_top_volume and drag them to the Output slots pane.

  4. Click Next.

Editing the Table Top Parameter Properties

  1. Double-click the range numbers for row 1 (table_top_height).

  2. Change the lower bound to 0.01 and the upper bound to 0.07.

  3. Double-click the range numbers for row 2 (table_top_length).

  4. Change the lower bound to 1 and the upper bound to 5.

  5. Double-click the range numbers for row 3 (table_top_width).

  6. Change the lower bound to 0.8 and the upper bound to 1.2.

  7. Click Next.

Defining the Table Top Optimization Criteria

  1. Do not adjust or add to the currently displayed values for parameters, responses, and criteria.

  2. Click Next.

Finishing the Table Top Solver Wizard

  1. Ensure the Create a template from solver chain check box is clear.

  2. Click Finish.

    The solver chain is displayed in the Scenery pane.

Starting the Table Leg Solver Wizard

  1. From the Wizards pane, drag the Solver wizard to the Scenery pane and let it drop.

  2. Expand Preferences.

  3. Clear the Create in parametric system check box.

  4. From the solver list, click Calculator.

Selecting the Table Leg Parameters and Outputs

  1. From the Add variable drop-down list, select Import variable(s).

  2. In the Open optiSLang variables from file dialog box, browse to the table folder and select table_leg.ovdb.

  3. Click Open.

  4. In the Variables table, select all rows and drag them to the Parameter pane.

  5. In the Value field for table_leg_height enter 0.8 and click OK.

  6. In the Value field for table_leg_radius enter 0.015 and click OK.

  7. In the Variables table, select all rows and drag them to the Output slots pane.

  8. Click Next.

Editing the Table Leg Parameter Properties

  1. Double-click the range numbers for row 4 (table_leg_height).

  2. Change the lower bound to 0.7 and the upper bound to 0.9.

  3. Double-click the range numbers for row 5 (table_leg_radius).

  4. Change the lower bound to 0.01 and the upper bound to 0.02.

  5. Click Next.

Defining the Table Leg Optimization Criteria

  1. Do not adjust or add to the currently displayed values for parameters, responses, and criteria.

  2. Click Next.

Finishing the Table Leg Solver Wizard

  1. Ensure the Create a template from solver chain check box is clear.

  2. Click Finish.

  3. Right-click the Calculator node and select Rename from the context menu.

  4. Type table_leg and press Enter.

Creating the Construction Node

  1. Under Modules, expand Analysis.

  2. Drag a Calculator node onto the Scenery pane and let it drop.

  3. Right-click the Calculator node and select Rename from the context menu.

  4. Type construction and press Enter.

  5. From the menu bar select View > Slot flyout view mode > Full.

  6. Hover over the right side of the table_top node.

  7. Make the following connections by clicking the items on the table_top node list and dragging them onto the list on the left side of the construction node.

    • ODesign to IDesign

    • table_top_area to New slot

    • table_top_volume to New slot

  8. Hover over the right side of the table_leg node.

  9. Make the following connections by clicking the items on the table_leg node list and dragging them onto the list on the left side of the construction node.

    • ODesign to IDesign

    • table_leg_area to New slot

    • table_leg_volume to New slot

  10. Double-click the construction node.

  11. To add three new variables, click Add variable three times.

  12. Double-click the ID cell for variable_1, type number_of_legs, and press Enter.

  13. Double-click the Expression cell, type 4, and press Enter.

  14. Double-click the ID cell for variable_2, type table_area, and press Enter.

  15. Double-click the Expression cell, type table_top_area+number_of_legs*table_leg_area, and press Enter.

  16. Double-click the ID cell for variable_3, type table_volume, and press Enter.

  17. Double-click the Expression cell, type table_top_volume+number_of_legs*table_leg_volume, and press Enter.

  18. In the Variables table, select rows 2 and 3 (table_area and table_volume) and drag them to the Responses pane.

  19. In the Variables table, select row 3 (table_volume) and drag tit to the Output slots pane.

  20. Click OK.

Saving and Running the First Part of the Table Workflow Project

  1. To save the project, click  .

  2. Browse to the location to save the project and type table in the File name field.

  3. Click Save.

  4. To run the project, click  .

  5. Check that all nodes have executed successfully.

Creating the Table Costs Node

  1. Under Modules, expand Process chain elements and Integrations.

  2. Drag an Excel node onto the Scenery pane and let it drop.

  3. Right-click the Excel node and select Rename from the context menu.

  4. Type costs and press Enter.

  5. Double-click the costs node.

  6. To the right of the Absolute path field, click the orange folder.

  7. In the Choose a file to open dialog box, browse to the table folder and select table_cost.xlsx.

  8. Click Open.

  9. In the Excel table, select row 1 (table_volume) and drag it to the Input slots pane.

  10. In the Excel table, select row 2 (total_cost) and drag it to the Responses and Output slots panes.

  11. Click OK.

  12. Hover over the right side of the construction node.

  13. Make the following connections by clicking the items on the construction node list and dragging them onto the list on the left side of the costs node.

    • ODesign to IDesign

    • table_volume to table_volume

Saving and Running the Second Part of the Table Workflow Project

  1. To save the project, click  .

  2. To run the project, click  .

  3. Check that all nodes have executed successfully.

Creating the Variable Nodes

  1. Under Modules, expand Advanced and Types.

  2. Drag two Variable nodes onto the Scenery pane.

  3. Right-click the Variable node and select Rename from the context menu.

  4. Type max_cost and press Enter.

  5. Right-click the Variable (1) node and select Rename from the context menu.

  6. Type max_load and press Enter.

  7. Double-click the max_cost node.

  8. From the data kind list, select Scalar.

  9. Double-click the row 1 cell.

  10. Type 300 and press Enter.

  11. Click OK.

  12. Double-click the max_load node.

  13. From the data kind list, select Scalar.

  14. Double-click the row 1 cell.

  15. Type 50 and press Enter.

  16. Click OK.

Creating the optiSLang Node

  1. Under Modules, expand Process chain elements and Integrations.

  2. Drag an optiSLang node onto the Scenery pane and let it drop.

  3. Right-click the optiSLang node and select Rename from the context menu.

  4. Type load_slang and press Enter.

  5. Hover over the right side of the costs node.

  6. Make the following connections by clicking the items on the costs node list and dragging them onto the list on the left side of the load_slang node.

    • ODesign to IDesign

    • total_cost to New slot

  7. Hover over the right side of the max_cost node.

  8. Click OVar and drag tit onto the list onto the New slot on the left side of the load_slang node.

  9. Hover over the left side of the load_slang node.

  10. Right-click the OVar input slot and select Rename from the context menu.

  11. Type max_costs and press Enter.

  12. Double-click the load_slang node.

  13. To the right of the Absolute path field, click the orange folder.

  14. In the Choose a file to open dialog box, browse to the location where you saved the table_load_slang project and select table_load_slang.opf.

  15. Click Open.

  16. In the Parameters table, select row 6 (load) and drag it to the Input slots pane.

  17. In the Parameters table, select rows 1-5 and drag them to the Parameter pane.

  18. In the Responses table, select rows 1 (load_proofed) and drag it to the Responses pane.

  19. Click  .

  20. Select the Conditional Execution check box.

  21. Click OK.

  22. Switch to the Conditional Execution tab.

  23. From the Continuation behaviour list, select Skip execution if a predecessor did not run.

  24. Click Add expression.

  25. In the Expression field type total_cost<max_cost and press Enter.

  26. Click OK.

  27. Hover over the right side of the max_load node.

  28. Click OVar and drag tit onto the list onto the load input slot on the left side of the load_slang node.

  29. Right-click the load_slang node and select Design flow > Send back designs.

Saving and Running the Third Part of the Table Workflow Project

  1. To save the project, click  .

  2. To run the project, click  .

  3. Check that all nodes have executed successfully.

Publishing the Workflow

In this section of the tutorial, you will:

  • Define the project placeholders

  • Publish the workflow

To complete this section of the tutorial, perform the following steps:

Defining the Project Placeholders

  1. With the table.opf project open, select Project > Project overview from the menu bar.

  2. Expand Show project placeholders.

  3. In the Filter properties field, type Variant.

  4. Under max_cost, drag Variant onto new placeholder.

  5. Click the Id cell for row 1 and change the name to MaxCostVariant

  6. Under max_load, drag Variant onto new placeholder.

  7. Click the Id cell for row 2 and change the name to MaxLoadVariant.

  8. In the Filter properties field, type parameter.

  9. Under table, drag ParameterManager onto new placeholder.

  10. In the Id cell of the new placeholder row, type TableTopHeight.

  11. Double-click the Minimum user level cell and select Computation Engineer from the list.

  12. In the Range cell, type [0.01-0.07].

  13. Double-click the Value cell and select Real from the list.

  14. In the Expression field, type 0.05.

  15. Repeat steps 10-14 to create the following placeholders:

    IdDescriptionMinimum user levelRangeValue
    TableTopLength Computation Engineer[1-5]Real, 1.8
    TableTopWidth Computation Engineer[0.8-1.2]Real, 1.01
    TableLegHeight Computation Engineer[0.7-0.9]Real, 0.8
    TableLegRadius Computation Engineer[0.01-0.02]Real, 0.015
    MaxCostsThe maximum accepted costs (Euros)Computation Engineer[0-1000]Real, 300.1
    MaxLoadThe maximum table load (kg)Computation Engineer[1-500]Real, 50
  16. Double-click the Value cell for row 1 (MaxCostVariant).

  17. Select the Expression check box.

  18. Click   (Edit expression).

  19. Replace 300 with the placeholder value $(MaxCosts).

  20. Click OK.

  21. Repeat steps 16-20 for MaxLoadVariant.

  22. Double-click the Value cell for row 3 (ParameterManager).

  23. Select the Expression check box.

  24. Click   (Edit expression).

  25. Switch to the Text view tab.

  26. Replace table_top_height reference value of 0.05 with the placeholder value TableTopHeight.

  27. Replace table_top_length reference value of 1.8 with the placeholder value TableTopLength.

  28. Replace table_top_width reference value of 1 with the placeholder value TableTopWidth.

  29. Replace table_leg_height reference value of 0.8 with the placeholder value TableLegHeight.

  30. Replace table_leg_radius reference value of 0.015 with the placeholder value TableLegRadius.

  31. Click OK.

  32. To save the placeholders, click OK.

Creating an optiSLang Web Service Application

  1. Start the optiSLang Web Service.

  2. Save the current optiSLang project as an application.

  3. Complete one of the following, depending on which storage location option you selected in the application wizard:

    • Save optiSLang App archive to filesystem: Add the wizard in optiSLang Web Service

    • Upload to optiSLang Web Service: In the optiSLang Web Service user interface, update the Wizard pane and run the application.

  4. Update the look and feel of your custom wizard.