Skip to main content

Question:

How to set up a DOE in Python for nTop Automate

Applies to:

  • nTop Automate
  • DOE
  • Python

Answer:

  1. Prepare your nTop notebook by setting up the Inputs and Outputs for running in nTop Automate (Preparing an nTop Notebook for nTop Command Line). The inputs for this example are Unit Cell Size and Thickness, which we wish to change for multiple values and get the relative density values as output.
An example notebook setup for running the notebook using Python and nTop Automate. A walled TPMS Unit Cell. The Thickness, Unit Cell Size, and Bounding box are labeled.
Tip: These learning center courses have step-by-step instructions and examples for automating your nTop files (https://learn.ntop.com/courses/230-intro-to-automation/and https://learn.ntop.com/courses/330-ntop-automate/)
  1. Run the -t template command in ntopcl with the nTop file to generate the input_template.json and output_template.json
  1. Open your preferred code editor and create a new .py file to run the script to generate multiple input JSON files for running multiple values.
This article (Running nTop Command Line in Python scripts) has a Python template file you can use as a base and modify for your use case. Tips: There are two important things to remember while using a list of values to run multiple iterations. You can use a list directly for one of the inputs; see below for how we have used thickness values. To use another list input, we will create multiple input.json files to run DOE; see below how we have used cellsize_values. Python Script to download
  1. When you run this script, the folder will have multiple input and output JSON files generated.
After running the script, a JSON file is generated for each input and output configuration of the unit cell.
  1. You can then write a script to read the output JSON files to plot as needed.
3D Plotting the JSON file results to compare Thickness, Relative Density, and Cell Size. A 2D plot showing Relative Density as a function of Thickness.

Attachments

RelDensity.ntop

Keywords:

lattice question ntopcl python json doe relative density ntop automate loop