In this example, we will use Speos and optiSLang to optimize a prismatic lightguide to fulfill the automotive Day-Time-Running-Lights regulation and improve the homogeneity of the lightguide to achieve a better lit appearance in an automated way.
[[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 or later
- Ansys optiSLang 2023 R2 or later
Overview
In automotive lighting applications, Day-Time-Running-Lights are used to create a unique Lighting signature. These lightguides are nearly on all the time and need to comply to high homogeneity standards and the regulation posed by the government. 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 colorimetric radiance map and an intensity map with regulation check. Publish parameters for optimization.
Step 2: optiSLang Sensitivity Analysis
Demonstrate design exploration capabilities by performing a sensitivity study to identify important input parameters and to get design understanding by creating metamodels showing the relationship between input and output parameters.
Step 3: optiSLang Optimization
Demonstrate optimization capabilities by performing multi-objective optimization based on metamodels followed by a local and single-objective direct optimization to achieve the best possible design.
Run and results
Step 1: Ansys Speos model
- Open the Ansys Speos model [[Headamp_LightGuide.scdocx]]. (located in [[ .\optiSLang_project_with_reference\01_reference\ ]] ) .
- Perform a local Compute of the “Lightguide” direct simulation.
- Select Workbench tab.
-
Click on
Publish Parameters
.
- Select "Lightguide" Feature in Speos Design panel.
-
Check
Trimming
ratio for control points 1 to 5.
The two results, intensity map and radiance map, are used to measure the optical performance in terms of regulation and homogeneity.
The grid view of the intensity map highlights the regulation compliance.
Each of the boxes represent a measurement point of intensity, regulated by the regulation. The center value represents the simulation result, the bottom left represents the Minimum limit to pass, the top left value is the Maximum limit to pass the regulation, the right side will represent personally set safety margins. If a regulation fails, it will be highlighted in red, if the safety margin is not met, it will be highlighted in yellow, if the regulation is passed, it is highlighted in green.
In the radiance map, the measurements for the homogeneity performance are defined. The measurements are based on an 18-point polyline. Along the line, the radiance will be evaluated. This will be used to measure the average and RMS contrast.
These are the outputs which will be used for the optimization. The goal is to reduce the RMS contrast and maximize the average of the polyline, while maintaining the ECE regulation.
All SpaceClaim and all published Speos parameters will be visible for optimization in optiSLang.
Step 2: optiSLang Sensitivity Analysis
-
Open [[LG_optimization_AnsysSPEOS.opf.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 in order to get a design understanding and to identify important input parameters.
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 may re-run 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: [[ .\optiSLang_Prismatic_Light_Guide_2023R2_SPEOS_3.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 is able to predict 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 except for the number of failed rules are well predicted (shown in the column “Total”). The models can be used to optimize for homogeneity but not for the validation of the regulation. This needs to be validated with an actual call of the solver.
The Metamodel of Optimal Prognosis (MOP) approximates the response as a function of all important input parameters. By clicking on one of the “Total” blocks, it 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 used optimization methods, maximum number of design evaluations and the defined criteria are set up for this system.
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 re-run the optimization. -
Optional:
To re-run the multi-objective analysis, right-click on “One-Click Optimization” system and set "Data flow" to active. Then right-click on system again 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: [[.\optiSLang_Prismatic_Light_Guide_2023R2_SPEOS_3.pdf]]). - Go back to optiSLang scenery, right-click on the "Validator Postprocessing" system and select “Show Postprocessing”.
The "One-Click-Optimizer" sampled 4000 designs on the MOP in order to find the best combination of input parameter values that lead to the best designs. For this purpose, different optimization algorithms are running in competition with each other in the background. The result of the multi-objective optimization is visualized in the “Objective 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 automatically validates 20 of the best designs with a real solver call (shown as green dot’s). The differences between predicted and calculated (validated) value is small due the good COP values. By selecting one of the designs, the corresponding parameter values and responses are shown in the other plots of the optiSLang "Postprocessing".
The picture shows the validated design, "Design 2808".
To improve the design further, it is possible to run a local and single-objective optimization by converting one of the objectives into 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 used optimization methods, maximum number of design evaluations and criteria are set up for this system.
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 may re-run the optimization. -
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 system again and select “Start from here”.
HINT: The step-by-step tutorial shows how to setup the single-objective optimization based on sensitivity analysis (The tutorial can be found in the download folder: [[.\optiSLang_Prismatic_Light_Guide_2023R2_SPEOS_3.pdf]]). - To review the results, right-click on “One-Click Optimization (1)” and select "Show Postprocessing". The file already contains the results for the optimization.
The single-objective optimization takes all designs from the sensitivity study and sample iterative additional designs.
The optimization converges very fast. The best design is "Design 370". The result provides good homogeneity and fulfills all regulations from the government.
Summary optimization
Initial Design | Multi-Objective Optimization based on MOP | Local Single-Objective Optimization | |
RMS contrast | 0.74 | 0.25 < 0.48 < 1 | 0.115 |
Average Luminance in kcd/m² | 183 | 157 < 187 < 190 |
167 >165 constraint fulfilled |
Number of failed rule (regulation) | 0/42 (constraint fulfilled, regulation passed) | ||
Results |
initial design |
best trade off |
best design |
Important model settings
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 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. This results 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 inside optiSLang.
optiSLang
Speos Settings
Double-click on the “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 the design understanding).
-
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 the design understanding).
Speos Core settings
Double-click on the “SpeosCore” node to change the settings:
- Number of cores used.
- Activate GPU Solver.
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 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.
Updating the model with your parameters
Add more Parameters
To add new parameters, you need to use the
Publish Parameter
feature in the
Workbench
tab, and you may select any Speos feature to publish any available property of this object. (
Defining the Speos Parameters to Use in optiSLang (ansys.com
))
You can also create a SpaceClaim
Driving Dimension
or a SpaceClaim
Script Parameter
. 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 may 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 a XML-Template.
By editing the Speos reader node the outputs will be added to the optiSLang Project. You can find a detailed step-by step-guide within the Ansys Learning Hub as well as the step-by-step guide in the reference folder.
Taking the model further
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 parameters 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 a best design.
How to do this is shown in the step-by-step tutorial. (The tutorial can be found in the download folder: [[.\optiSLang_Prismatic_Light_Guide_2023R2_SPEOS_3.pdf]]).
A big advantage when doing an optiSLang study is that when you want to change a measurement it is not necessary to re-run the optimization. All data and results are stored and kept. It is possible to add a node after your workflow or re-evaluate your system. This creates a new MOP, which can be used to run new Optimizations without re-running all initial designs.
Additional resources
Related KB pages:
Related Ansys Courses: