Load Cases Not Resetting Between Iterations

I am working on a dynamic analysis of a bridge and investigating the effects of track irregularities on the deck response. My goal is to introduce a stochastic variation while ensuring deterministic (reproducible) results. However, I am encountering an issue in the final loop of my code.

It seems that the load cases are not being properly reset when a new iteration starts. While different iterations (e.g., i = 3 and i = 5) produce distinct results, within each iteration (e.g., i = 3), all analyses appear to use the same accumulated load cases.

From the report, it looks like all generated loads—both the train/vehicle load (1002) and the track irregularity loads (e.g., 20000, 20001, 20002, etc.)—are being applied simultaneously within each iteration, instead of being reset before each analysis step. For example, when i = 3, the analysis seems to be using LC1002, LC20000, LC20001, and LC20002 together for all three analyses within that iteration. This suggests that the load cases are stacking instead of being cleared before each new analysis cycle.

I’ve attached the full code. I would really appreciate any insights into why this happens and how I can properly structure the loop to ensure the load cases are reset before each analysis.

TrackIrregularitiesLoop.dat (8.8 KB)
TrackIrregularitiesLoop.pdf (416.6 KB)

Thanks in advance!

Best regards, Tone Kristiansen