Forcing Multiple Recalc using Scripting

3.63K viewsScripting
0

Hi:

I have a model that has very long circular formulas that need to be recalculated multiple times before the values become stable. It seems like a script that runs recalc multiple times would be useful. I am tired of hitting recalc and coming back 2 hrs later and hitting F9, and repeat several times!

I saw one of the posts was using “model.ensureCalculated()” to recalculate the model when it is in uncalculated state. But, this doesn’t seem to work in my case because after the first recalc, the model is in the recalculated mode even though the values being calculated by circular formulas have not stabilized yet.

Is there another action that would force a recalc even though the model is already in the calculated mode? Thanks.

Henry

0

Hi Henry,

Sorry this response is so late in coming. With specific issues like this one, it’s helpful if we can take a look at the model. Is it possible to post either the model you are using, or a mock-up that reproduces the problem? If your model is proprietary (and therefore unsuitable for transfer via public forum), let me know and we can arrange a more secure method.

Regards,
Ben

0

Ben:

Can you please confirm one thing? Does the iteration setting for the circular cells only apply when the calculation is set to auto calculations? I am guessing that is why our numbers are not converging without multiple manual recalcs. Thanks.

Best regards,

Henry

0

Hi Ben:

Thanks for the info. But, I am not sure if Quantrix is actually doing the iterations. I checked the setting and it is set to 10,000 and the “value change is less than:” is set to 1.0E-04.

It is currently taking about 2 hours for a single recalc. And, it takes about 9 recalc’s to get the values to converge.

Any thoughts on what is going on? Thanks.

Best regards,

Henry

0

Hi Henry,

I think your goal can be achieved by increasing the number of iterations in each calculation, a setting you can access by clicking Tools -> Calculation -> Calculation Settings… in the Quantrix window. You can specify a number of iterations greater than 1, and the calculation engine will iterate on your circular formulas as many times as you specify (or until the resulting value change reaches a specified degree of smallness) before concluding the calculation.

Regards,
Ben