In this example, we will use Speos and optiSLang to optimize a prismatic lightguide to illuminate a glovebox. The goal is to achieve an evenly distributed light pattern and good efficiency.
[[NOTES:]]Software Prerequisites
To be able to use this example, the following tools and assets need to be installed on your computer:
- Ansys Speos 2023 R2
- Ansys optiSLang 2023 R2
Overview
Understand the simulation workflow and key results
In automotive lighting applications, interior lighting based on LED is standard to light many different parts of the interior. Design Elements in the car Interior need to comply to high standards in terms of homogeneity and appearance. Lightguides and lens systems are used to create these design elements. To perform this optimization, we use a design created with Ansys Speos Optical Part Design. Ansys optiSLang will be used to drive the parameter change and subsequently find the best design.
Step 1: Ansys Speos model
Demonstrate Speos Lightguide simulation with a photometric Radiance map.
Step 2: optiSLang sensitivity study
Demonstrate design exploration capabilities by performing a Sensitivity study to identify important parameters.
Step 3: optiSLang optimization
Demonstrate optimization capabilities by performing optimization based on Metamodels followed by a single objective direct optimization to achieve the best possible design.
Run and results
Instructions for running the model and discussion of key results
Step 1: Ansys Speos model
- Open the Ansys Speos model HMI_optiSLang.scdocx. (located “.\ optiSLang_project_with_reference\01_reference\”).
- Perform a local Compute of the Direct Simulation “Direct.Glove.Box”.
- Select Workbench Tab
-
Click on Publish Parameters
- Select Lightguide Feature in Speos Design tab
-
Check End Angle for control point 1 to 6
The lightguide used in the simulation was created by Speos Optical Part Design. To understand how to create and modify the lightguide please read the related Knowledge Base Article: Creating a Lightguide.
The radiance map result shown below is used to measure the optical performance in terms of illumination and homogeneity. The radiance within the Polygon defined by the four points is used to assess the homogeneity performance. The goal is to optimize the structure to achieve a maximum average radiance with reduced RMS contrast within the polygon.
All SpaceClaim and All Published Speos Parameters will be visible for Optimization in optiSLang.
Step 2: optiSLang sensitivity study
-
Open the optiSLang project file (*.opf)
(located in “.\optiSLang_project_with_reference\”).
The “AMOP”-system shows the necessary solver chain to perform the lightguide analysis and is used to run the sensitivity analysis to get a design understanding and to identify important input parameter.
Double-click on the AMOP Module to see the defined sampling method, parameter ranges and optimization criteria.
The system is defined to include pictures and to keep the result files of each simulation. Due to the size these pictures and result files are not delivered with this example. To regenerate them you can rerun the study. -
Optional:
To re-run the sensitivity study right-click on AMOP and select “Start from here”.
HINT: The step-by-step tutorial shows how to create the automated workflow (solver chain) and how to setup the sensitivity analysis. (The tutorial can be found in the download folder: “.\Glove_Box_LightGuide_Optimization_Tutorial.pdf”). - To review the results of the sensitivity analysis, right-click on AMOP and select 'show Postprocessing'. The file already contains the results for the metamodels.
The main concern when working with metamodels is the prediction quality on how good the model predicts the outputs based on new given input values. optiSLang catches this in the Coefficient of Optimal Prognosis, short COP. The best way to review the sensitivity study is to review the COP matrix. The COP matrix shows that all values are well predicted (shown in the column “Total”). The models can be used to optimize for homogeneity. In addition, the COP matrix shows for each result (here average and RMS contrast) the quantitative influence of the input parameter on the variation of the result.
The Metamodel of Optimal Prognosis (MOP) approximates the response as a function of all important input parameters. By clicking on one of the “Total” updates the 3d Response surface plot. This plot is the representation of the Metamodel based on the two main contributors and the remaining ones are set to a fixed value. By using the sliders (see picture below) you can see the influence of the other dimensions.
Step 3: optiSLang optimization
Global multi-objective optimization based on MOP
-
Go Back to the optiSLang Project (*.opf)
Double-click on the “One-Click Optimization” system. Settings including the optimization method, maximum number of samples and the defined criteria are set up for this system. -
Optional:
To re-run the multi-objective analysis right-click on “One-Click Optimization”-system and select “Start from here”.
HINT: The step-by-step tutorial shows how to setup the multi-objective optimization based on sensitivity analysis (The tutorial can be found in the download folder: “.\Glove_Box_LightGuide_Optimization_Tutorial.pdf”). - Go back to optiSLang scenery, right-click on the “One-Click Optimization” system and select “Show Postprocessing”.
The optimization algorithm sampled 4000 designs on the MOP to find the best combination of input parameter values that leads to the best design. The result of the multi-objective optimization is visualized in the “Pareto Plot” (see also picture below). The plot shows the trade-off between the two objectives where the set of best designs are marked with red dots (defined as Pareto front). The workflow validates automatically 20 of the best designs with a real solver call (shown as green dots). The differences between predicted and validated values are acceptable due to the good COP values. You can see the difference is stronger for RMS Contrast than average due to better COPs. By selecting one of the designs the corresponding parameter values and responses are shown in the other plots in the optiSLang Postprocessing.
The picture shows the validated design 677
To improve the design further it is possible to run a local and single objective optimization by converting one of the objectives to a constraint.
Local single objective optimization
- Go Back to the optiSLang Project (*.opf)
- Double-click on the “One-Click Optimization (1)” -system. Settings including the optimization method, maximum number of samples and criteria are set up for this system.
- Optional: To re-run the local single-objective analysis right-click on One-Click Optimization (1)”-system and set “Data flow” to active. Then right-click on the system again and select “Start from here”.
- To review the results right-click on “One-Click Optimization (1)” and select 'Show Post-processing'. The file already contains the results for the optimization.
For the single objective optimization we converted the average objective into a constraint and define that it has to be bigger than 10 cd/m²
The single objective optimization took all designs from Sensitivity and all Validated Designs as Start designs. The first 320 designs are not recalculated but used as Start Points for the Optimization.
In the picture, you can see the optimization history. The best design (384) is only marginally better than the design from the Multi-objective optimization.
Summary optimization
|
Initial design |
Multi Objective Optimization based on MOP |
Local single Objective Optimization |
RMS contrast |
0.78 |
0.62< 0.84 <1.40 |
0.70 |
Average Luminance in cd/m² |
1.83 |
6.84< 11.02 <12.92 |
10.35 ≥ 10
|
Results |
Initial design
|
best trade off
|
best design
|
Important model settings
Description of important objects and settings used in this model
Speos model settings
Lightguide meshing
A precise meshing of the lightguide is extremely important. The prisms can get extremely small. If this is not accounted for in the meshing, no light will be extracted from the lightguide. Use Local Meshing on important optical geometries.
Maximum number of surface interaction
A lightguide relies on Total internal reflection to guide the light, resulting in a lot of surface interactions. The default value of 100 is often too low.
XML Template
The XML template in the sensor definition is used to export the Measurements to make them usable in optiSLang
optiSLang
Speos settings
Double click on “Ansys Speos” node to change the settings:
-
Parametrization Tab:
- Define parameter that should be considered in the variation analysis
-
Execution settings Tab:
- define the Speos version to use (minimum version is 2023R2)
- choose batch mode / GUI mode (Gui mode might be useful for bug fixing)
-
add a Python script that executes before or after the design is updated
(e.g. needed for coupling Speos with CAD-Tools like Catia / Inventor / NX / Creo)
-
Speos Simulation Tab:
- select the simulations to be exported in the design directory and resolved by the Speos Core node
-
Export Tab:
- selected formats are written as result files in the design directory (e.g., export image file of the design and include it in the optiSLang post processing to increase design understanding)
Solver settings
Double click on the “SpeosCore” node to change the settings:
- number of used cores
- activate solve on GPU
Sensitivity settings
Double click on the “AMOP” – system:
- to change the parameter ranges in the “Parameter” tab
- to change constraint limitation in the “Criteria” tab
- to change maximum number of samples in the “Adaption” tab
- to view the results in the “result designs” tab.
multi-objective optimization
Double click on the “One-Click Optimization” – system:
- to change the constraint limitation in the “Criteria” tab
- to change the maximum number of design evaluations in the “Settings” tab
- to add optimization algorithms to the competition in the “Settings” tab under advanced and expert settings
- to view the results in the “result designs” tab.
single-objective optimization
Double click on the “One-Click Optimization (1)” – system:
- to change the constraint limitations in the “Criteria” tab
- to change the maximum number of design evaluations in the “Settings” tab
- to add optimization algorithms to the competition in the “Settings” tab under advanced and expert settings
- to view the results in the “result designs” tab.
Updating the model with your parameters
Instructions for updating the model based on your device parameters
Add more Parameters:
To add new parameters you need to use the Publish parameter feature in the Workbench tab and you can select any Speos feature to publish any available Property of this Object. (
Defining the Speos Parameters to Use in optiSLang
)
You can also create SpaceClaim Driving dimension or SpaceClaim script parameters. All SpaceClaim parameters will be automatically displayed and read by the Speos integration in optiSLang.
Create a new optiSLang Optimization study
To define an optiSLang Sensitivity study from scratch you can use the Step-by-Step Tutorial added to this data. It will allow you to understand the creation Process of an optiSLang Optimization with Speos.
Add new outputs to the simulation report
To add new outputs, it is needed to add new measurements to the XML-Templates selected in the simulation setup. The easiest way to do this is to replace the existing XML-Templates from the input files or reselecting it in the sensor definition. XML-Templates are created by creating a measurement on the XMP map and then exporting this Measurement to an XML-Template.
By editing the Speos reader node, the outputs will be added to the optiSLang Project.
Taking the model further
Information and tips for users that want to further customize the model
To increase the design understanding, the activation of the result images in the optiSLang postprocessing, as well as the “Parallel coordinates plot” (PCP) can be used. With the PCP it is possible to visualize the dependencies between the input and the output parameter, as well as to identify the trade-offs between the objectives. Furthermore, a coloring of a design set helps to identify the regions where the optimization algorithms search for the best design.
How to do this is shown in the step-by-step tutorial (The tutorial can be found in the download folder: “.\Glove_Box_LightGuide_Optimization_Tutorial.pdf”).
A big advantage when doing an optiSLang study is that when you want to change a measurement it is not necessary to rerun the Optimization. All data and results are stored and kept. It is possible to add a node after your workflow or reevaluate your system. This creates a new MOP and which can be used to run new Optimizations without rerunning all initial designs.
Additional resources
Additional documentation, examples and training material
Related KB pages:
- How to Build a Speos OPD Lightguide
- Exterior Lightguide Optimization
- Evaluating Robustness of Exterior Lightguide