-
-
September 29, 2025 at 12:27 am
abasirat
SubscriberHi,
A response/output variable in my Variables tab is of type XYDATA and has value of [1:1]. I have a few basic questions regarding this variable (Force_mag):
1. What does [1:1] mean mathematically?
2. How can I display/view the X and Y values of Force_mag?
3. What expression will help me extract Y? Looking through the manual, it seems like indexing needs to be used. I added a second Force variable and want it to be a real scalar varibale so that I can use it for optimization objectives.
Thank you in advance. -
September 30, 2025 at 3:26 pm
Markus
Ansys EmployeeHi abasirat,
in the variables tab of the Ansys EDT node you find in the bottom right the options “Instant visualization” and “Add variable” (see picture 1, A).
Checkmark “Instant visualization” to see the “REAL XYDATA”, a Signal with X and Y values.
In that plot you can also switch between a table and a graph view (see picture 1, B). Here X=1, Y=2.
To use the “Force_mag” in the objective formulation we first need to make a scalar out of it. This incudes 3 steps:
1) Now click the “Add variable” button beside “Instant visualization” checkmark (in A).
(The following actions are in the picture 1, line 4)
A new variable is created, you can give it a name like: “Force_mag_x_vector” (double click in the field to change the name).
In the tab “Expression” we extract a vector from “REAL XYDATA” with this command: extract(Force_mag,0)
”0″ stands here for the abcissa of the signal, here the x axis. You see that the “Type” is now “Real VECTOR”.
2) Click again the “Add variable” button, rename it to e.g. “Force_mag_x_”
(The following actions are in the picture 1, line 5)
In the tab “Expression” we extract a real value from “REAL VECTOR” with this command: Force_mag_x_vector[0]
”0″ stands for the vector index, so here the first entry you want to get, in this case the first one.
You see that the “Type” is now “Real” and in “Value” you see the 1.
3) Now drag and drop this Variable to the “Responses” field in the Dialog. Now it will be used as optimization criteria.Additional hint: (The follinging actions are in the picture 1, line 6)
You can do the same with the Y axis and (as a alternative) both operations together in one expression with ordinate = 1, index = 0 like this:
extract(Force_mag,1)[0].I hope this helps,
Markus
I have an additional comment. Please make sure your AEDT model is solved before connecting it to optiSLang.
Sometimes you have a longer signal and need to first define which value you want to extract from the signal.-
November 5, 2025 at 12:17 am
abasirat
SubscriberHi Markus,
Thank you for the detailed steps. I followed them carefully, however, my signal and scalar variables are showing a “Value” of 0.
Please review the steps I performed and advise where I’m going wrong:
1. I clicked “Analyze All” on my Magnetostatic project in AEDT and verified the “Results“. The magnitude of the EM force is calculated to be 0.103N:
2. After saving the analyzed project: In Project Maneger, I right-click on Optimetrics and added an “optiSLang Setup“. In the optiSLang Setup I added the following calculation:

According to the calculations: Force_mag is 0.103N.
3. In Project Manager, I right-clicked optiSLangSetup1 and selected Create optiSLang Project:4. In this step I followed your instructions to extract scalar variables for the objective formulation:


As seen above, even when I exctract scalar Variables, I cannot see a value of 0.103N. There is no way for me to tell which scalar variable, Force_mag_x or Force_mag_y, is the variable which should be drag-and-drop to the “Responses” field. Please advise.
Just out of curiosity, I dragged and dropped one of the REAL variables to the Responses field and did a quick Optimization. I found that out of the two designs that were chosen by the optimizer both had failed (screenshot of steps shown below):


-
-
- You must be logged in to reply to this topic.
- optiSLang: general question about output variables & expressions
- Basic questions about HPC license
- 3-Way System Coupling (Thermal-Structural-Fluid)
- Keeping concentration same for different sized particles in discrete phase model
- optiSLang & AEDT Optimetrics: response variable has value of 0
- Thermal Desktop: Running RadCAD and SINDA outside of AutoCAD
-
4202
-
1493
-
1364
-
1197
-
1021
© 2025 Copyright ANSYS, Inc. All rights reserved.
