## General Mechanical

Topics relate to Mechanical Enterprise, Motion, Additive Print and more

#### Tolerances for IF-conditions too strict?

• FordPrefect
Subscriber
Dear 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
• Dave Looman
Ansys Employee
The *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
• You must be logged in to reply to this topic.