TAGGED: geometry, mathematical-model
-
-
November 12, 2024 at 3:30 pm10172100207Subscriber
Xmin = [80,300,30,160,10]; # D,P,H,G min
Xmin = [100,400,50,20,10];
Xmax = [160,700,200,320,200];Â
p1(i,j) = Xmin(j) + rand*(Xmax(j) - Xmin(j));
But I want the rand(between 0 and 1)*(Xmax(j) - Xmin(j)) to be an int number, not float.Â
-
November 12, 2024 at 9:33 pmKirillAnsys Employee
Hello Subscriber,
1.      Consider using the following functions, which take a floating-point argument and return an integer: ceil (rounds up), floor (rounds down), and round (rounds to the nearest integer).
2.      The rand function itself can also return an integer directly when used with 3 arguments. Please check the linked documentation for details.
Â
Additionally, you may find it helpful to review the Ansys Optics Scripting Language section, as well as the Ansys Lumerical Scripting Course.
Â
Best regards,
Kirill
-
- You must be logged in to reply to this topic.
- Difference between answers in version 2024 and 2017 lumerical mode solution
- Errors Running Ring Modulator Example on Cluster
- INTERCONNECT – No results unless rerun simulation until it gives any
- Import material .txt file with script
- Help for qINTERCONNECT
- Trapezoidal ring
- Issues with getting result from interconnent analysis script
- Topology Optimization Error
- Edge Coupler EME Example Issue
- How to measure transmission coefficients on a given plane .
-
1231
-
543
-
523
-
225
-
209
© 2024 Copyright ANSYS, Inc. All rights reserved.