TAGGED: if-statement, tolerance
-
-
November 19, 2020 at 10:43 amFordPrefectSubscriberDear all,nI use a *DOWHILE-Loop to generate new load steps as long as the previous load steps reach their maximum load. I use the command *GET,time_LS,ACTIVE,0,set,time at the end of every *DO trip to check the parameter time_LS against the assigned maximum time of the load step LF. If time_LS less than LF, the loop index LS_check becomes 0 and the *DOWHILE-loop ends. nHowever, it seems that tolerance based on which ANSYS determines if the IF-conditions is met are quite strict. If the remaining time increment at the end of the load step is around 0.9e-8 or greater ANSYS considers the condition to end the *DOWHILE-loop as met (i.e. time_LS < LF), although according to a note the maximum load of the load step was reached. In previous load steps with a remaining time increment of around 1.0e-9 and less, time_LS was considered equal to LF and the *DOWHILE-loop continued. nThe output says:n *** LOAD STEP 15 SUBSTEP 21 COMPLETED. CUM ITER = 123n *** TIME = 15.0000 TIME INC = 0.914890E-08 MAX DISPLACEMENT = -19.15 n *** NOTE *** CP = 249821.406 TIME= 10:31:00n Maximum load for load step 15 was reached. n *GET TIME_LS FROM ACTI ITEM=SET TIME VALUE= 15.0000000 n *IF time_LS ( = 15.0000 ) LT n LF ( = 15.0000 ) THEN n PARAMETER LS_CHECK = 0.000000000nnAny suggestions? nIs there an exact parameter or flag to determine wether the maximum load for a load step was reached or not?nSo long, and thanks for all the fish!n
-
December 10, 2020 at 8:44 pmdloomanAnsys EmployeeThe *IF documentation does say, A tolerance of 1.0E-10 is used for comparisons between real numbers so what you say sounds correct. Can you increase the difference between the values somehow? For example, *if,(time_ls-15.0),lt,0 might avoid the tolerance issue.n
-
Viewing 1 reply thread
- The topic ‘Tolerances for IF-conditions too strict?’ is closed to new replies.
Ansys Innovation Space
Trending discussions
Top Contributors
-
421
-
192
-
178
-
162
-
140
Top Rated Tags
© 2024 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.