A method for reducing the transition time and the amount of off-specifications polymer produced, during the change of specification from one homo- or co-polymer grade to another, in a double loop slurry reactor with a Ziegler-Natta or a metallocene catalyst system and wherein the polymer is prepared from olefin monomer(s), said method comprising the steps of: a) selecting n input variables, linked to the reactor conditions; b) defining a constrained neural network model of general form C 1 = 1 / 1 + exp − a 11 * X 1 + a 12 X 2 + a 13 X 3 +... + b 1 C 2 = 1 / 1 + exp − a 21 * X 1 + a 22 X 2 + a 23 X 3 +... + b 2 C 3 = 1 / 1 + exp − a 31 * X 1 + a 32 X 2 + a 33 X 3 +... + b 3 Res = 1 / ( 1 + exp ( − ( a n + 1 1 * C 1 + a n + 1 2 * C 2 + a n + 1 3 * C 3 +... + b n + 1))) wherein the Xi's are the n normalised input variables, the aij's and bi's are numerical coefficients, the Ci's are intermediate functions and Res is the scaled resulting polymer property estimate corresponding to the reaction conditions defined by the n input variables; c) adjusting the (n+1)*n aij and (n+1) bi parameters to minimise the error on Res under appropriate constraints, said constraints being imposed by equalities or inequalities related to any one of Xi's, aij's, bi's, Ci's, Res or combination thereof, or to any of their partial derivatives of any order, and wherein partial derivatives measure the variation of the result derived from an equation when one and only one of the variables is changed by an infinitesimal step; d) predicting in real time the density and melt flow index of the polymer leaving the reactor from the time evolution of the n input variables in the equations of step b), and including whenever appropriate, dynamic step responses to any varying input conditions; e) inferring appropriate values for any combination of 2 input variables Xi and Xj, knowing the other (n-2) variables, and the desired values of density and melt index; f) from a given law of time evolution of the n input variables between two steady-state conditions corresponding to two product specifications, calculating the time at which at least one polymer characteristics leaves the product specifications of the first polymer grade and the time at which the latest polymer characteristics reaches the product specifications of the second polymer grade; g) calculating the time of off-specifications production by computing the difference between the two times calculated in step f); h) minimising the time of off-specifications production of step g) by modifying the law of evolution of the n input variables, subject to process limitations. a) selecting n input variables, linked to the reactor conditions; b) defining a constrained neural network model of general form C 1 = 1 / 1 + exp − a 11 * X 1 + a 12 X 2 + a 13 X 3 +... + b 1 C 2 = 1 / 1 + exp − a 21 * X 1 + a 22 X 2 + a 23 X 3 +... + b 2 C 3 = 1 / 1 + exp − a 31 * X 1 + a 32 X 2 + a 33 X 3 +... + b 3 Res = 1 / ( 1 + exp ( − ( a n + 1 1 * C 1 + a n + 1 2 * C 2 + a n + 1 3 * C 3 +... + b n + 1))) wherein the Xi's are the n normalised input variables, the aij's and bi's are numerical coefficients, the Ci's are intermediate functions and Res is the scaled resulting polymer property estimate corresponding to the reaction conditions defined by the n input variables; c) adjusting the (n+1)*n aij and (n+1) bi parameters to minimise the error on Res under appropriate constraints, said constraints being imposed by equalities or inequalities related to any one of Xi's, aij's, bi's, Ci's, Res or combination thereof, or to any of their partial derivatives of any order, and wherein partial derivatives measure the variation of the result derived from an equation when one and only one of the variables is changed by an infinitesimal step; d) predicting in real time the density and melt flow index of the polymer leaving the reactor from the time evolution of the n input variables in the equations of step b), and including whenever appropriate, dynamic step responses to any varying input conditions; e) inferring appropriate values for any combination of 2 input variables Xi and Xj, knowing the other (n-2) variables, and the desired values of density and melt index; f) from a given law of time evolution of the n input variables between two steady-state conditions corresponding to two product specifications, calculating the time at which at least one polymer characteristics leaves the product specifications of the first polymer grade and the time at which the latest polymer characteristics reaches the product specifications of the second polymer grade; g) calculating the time of off-specifications production by computing the difference between the two times calculated in step f); h) minimising the time of off-specifications production of step g) by modifying the law of evolution of the n input variables, subject to process limitations.