I have this line of code (below) within a for loop and every iteration, the computation time (solveTime) increases yet there is no change to the inputs other than a single initial condition of the T on a single edge of a 2D square mesh. I have pre-allocated memory for the output variable (although this would have no effect on solveTime as written in code) and experimented with the thermalmodel.Solveroptions but no change to this increasing computation time.
My initial iteration is approximately 0.03s then increases gradually until approximately 1.4s for my 5000th iteration. I have also tried beginning at iteration 1000 and again it starts at 0.03s then increases as before. tlist is a constant also of [0 0.5].
for i = 1:nn tic R = solve(thermalmodel,tlist); % Transient
solveTime = toc;end
Any advice would be helpful. Thanks!! 🙂
Best Answer