A method for controlling a cooling system delivering coolant to a heat exchanger in a vehicle, wherein the cooling system comprises - a radiator line directing coolant to a radiator in which the coolant is cooled to a first temperature (t 1), - a radiator bypass line directing coolant past the radiator, - a heat exchanger line receiving coolant from the radiator line and the radiator bypass line and directing the coolant to a heat exchanger, - a heat exchanger bypass line receiving coolant from the radiator line and the radiator bypass line and directing the coolant past the heat exchanger, - a thermostat receiving a coolant flow rate (ṁ) at a second temperature (t 2), wherein the thermostat in a closed position directs the entire coolant flow rate (ṁ) to the radiator bypass line, in a partly open position directs a first coolant flow rate (ṁ 1) to the radiator line and a second coolant flow rate (ṁ 2) to the radiator bypass line, and in a fully open position directs the entire coolant flow rate (ṁ) to the radiator line, and - a flow regulating mechanism directing coolant from the radiator line and the radiator bypass line to the heat exchanger line and/or the heat exchanger bypass line, wherein, during operating conditions when the thermostat is in the partly open position, the method comprises the steps of - estimating a desired cooling temperature of a medium in the heat exchanger, - estimating the cooling effect Q r of the coolant in the radiator by means of information about the cooling air flow through the radiator and performance data of the radiator at varying air flows, - calculating the coolant flow rate (ṁ 1) through the radiator line by means of information of the cooling effect (Q r) of the coolant in the radiator, the temperature drop (t 1 -t 2) of the coolant in the radiator and the specific heat capacity (c p) of the coolant, - calculating the coolant flow rate (ṁ 2) through the radiator bypass line as the second coolant flow rate (ṁ 2) = a total coolant flow rate (ṁ) - the first coolant flow rate (ṁ 1), - calculating a coolant flow rate (ṁ 3) and coolant temperature (t 3) combination at which the medium in the heat exchanger is cooled to the desired temperature, - adjusting the flow regulating mechanism such that coolant at the selected flow rate (ṁ 3) and temperature (t 3) combination is directed to the heat exchanger line and the heat exchanger wherein the coolant flow rate (ṁ 3) to the heat exchanger is regulated by adjusting the flow resistance in the heat exchanger bypass line by the flow regulating mechanism.. - a radiator line directing coolant to a radiator in which the coolant is cooled to a first temperature (t 1), - a radiator bypass line directing coolant past the radiator, - a heat exchanger line receiving coolant from the radiator line and the radiator bypass line and directing the coolant to a heat exchanger, - a heat exchanger bypass line receiving coolant from the radiator line and the radiator bypass line and directing the coolant past the heat exchanger, - a thermostat receiving a coolant flow rate (ṁ) at a second temperature (t 2), wherein the thermostat in a closed position directs the entire coolant flow rate (ṁ) to the radiator bypass line, in a partly open position directs a first coolant flow rate (ṁ 1) to the radiator line and a second coolant flow rate (ṁ 2) to the radiator bypass line, and in a fully open position directs the entire coolant flow rate (ṁ) to the radiator line, and - a flow regulating mechanism directing coolant from the radiator line and the radiator bypass line to the heat exchanger line and/or the heat exchanger bypass line, wherein, during operating conditions when the thermostat is in the partly open position, the method comprises the steps of - estimating a desired cooling temperature of a medium in the heat exchanger, - estimating the cooling effect Q r of the coolant in the radiator by means of information about the cooling air flow through the radiator and performance data of the radiator at varying air flows, - calculating the coolant flow rate (ṁ 1) through the radiator line by means of information of the cooling effect (Q r) of the coolant in the radiator, the temperature drop (t 1 -t 2) of the coolant in the radiator and the specific heat capacity (c p) of the coolant, - calculating the coolant flow rate (ṁ 2) through the radiator bypass line as the second coolant flow rate (ṁ 2) = a total coolant flow rate (ṁ) - the first coolant flow rate (ṁ 1), - calculating a coolant flow rate (ṁ 3) and coolant temperature (t 3) combination at which the medium in the heat exchanger is cooled to the desired temperature, - adjusting the flow regulating mechanism such that coolant at the selected flow rate (ṁ 3) and temperature (t 3) combination is directed to the heat exchanger line and the heat exchanger wherein the coolant flow rate (ṁ 3) to the heat exchanger is regulated by adjusting the flow resistance in the heat exchanger bypass line by the flow regulating mechanism..