-
-
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.
-
- You must be logged in to reply to this topic.
-
3977
-
1461
-
1272
-
1124
-
1021
© 2025 Copyright ANSYS, Inc. All rights reserved.