TAGGED: effective-index, eigensolver-analysis, precision, script
-
-
July 28, 2023 at 10:29 pm
King Lam
SubscriberUsing script, the getresult("mode1", "neff"); returns the effective index to 5 decimal places, e.g, 2.14161+1.99136e-11i. In modal analysis, effective index data exported to a text file contains more significant figures, e.g.
f
3.747405725000e+14effective_index(real),effective_index(imag),loss
2.141613322230e+00,1.991363184436e-11,1.358484420378e-03
2.125338278328e+00,2.536038929807e-11,1.730055774125e-03Is it possible to change the number of signficant figures? I am hoping to achieve this using script, rather than manually exporting the data file. Thanks
-
July 31, 2023 at 11:52 pm
Guilin Sun
Ansys EmployeeThe getresult by default gives short-format data, which has 6 digits in total. The saved data seems using long format to give more digitst. This might be desired for example later those data are used in INTERCONNECT and the component can be very long, say meters or kilimeters.Â
You can use
format long;
?getresult("mode1", "neff");Â
and then
format short;
?getresult("mode1", "neff");Â
Â
If you want to have short format data, you can write the data into a text file using "write":
https://optics.ansys.com/hc/en-us/articles/360034411134-write-Script-command
Â
Â
-
- The topic ‘Effective index data in MODE Eigensolver Analysis with more significant figures’ is closed to new replies.
-
6575
-
1906
-
1463
-
1311
-
1022
© 2026 Copyright ANSYS, Inc. All rights reserved.