tespy icon indicating copy to clipboard operation
tespy copied to clipboard

Maximum iterations in solve() method using max_iter parameter

Open govind-menon110 opened this issue 4 years ago • 4 comments

Hi @fwitte, Is max_iter statically fixed at 50 and any value above 50 in nw.solve(max_iter=num) ignored if num > 50?

Regards, Govind

govind-menon110 avatar May 24 '21 18:05 govind-menon110

Hi, it should not, see

https://github.com/oemof/tespy/blob/2df2b6a4f239acf31dfbcc6ba30be13660609a70/src/tespy/networks/network.py#L1682

However, There is a termination criterion, if the iteration count is larger than 40 and no progress in residual value is found (some 10 lines below).

https://github.com/oemof/tespy/blob/2df2b6a4f239acf31dfbcc6ba30be13660609a70/src/tespy/networks/network.py#L1695-L1699

In general, 10 to 20 Newton iterations should always find the solution in a well determined model. Maybe you need to double-check the model specifications?

fwitte avatar May 24 '21 20:05 fwitte

Hi @govind-menon110, any news on this? Best Francesco

fwitte avatar Jul 14 '21 06:07 fwitte

Hi @govind-menon110, any news on this? Best Francesco

Hi @fwitte , I tried changing the parameters and the design case solved pretty quick. However an offdesign case with changed mass flow rates still cut off at 50 iterations though the maximum iterations were 100. Will update you again in a while.

Regards, Govind

govind-menon110 avatar Jul 14 '21 06:07 govind-menon110

Well, my guess is that there are some specifications regarding design/offdesign parameters, that do not work well/as intended. The algorithm should really be able to find the solution within less than 10 to 20 iterations. Good luck on finding the issue :).

fwitte avatar Jul 14 '21 06:07 fwitte

@govind-menon110: I will close this for the time being, if you still need help please feel free to comment or open a discussion :)

fwitte avatar Oct 02 '22 08:10 fwitte