A method of controlling an electric system comprising first and second terminals (P, N), electric cells (C 1 , C 2 , C 3 , C 4 ), each corresponding to an electrical charge storage element, and switches (SW 1,1 , SW 2,1 , SW 3 ) configured to connect or disconnect the cells in series and/or in parallel between the first and second terminals (P, N), the method comprising the steps of, for the delivery of a voltage between the first and second terminals (P, N), or the delivery of a current to the first terminal, or the connection of a number of electric cells, in order to follow a set point: a) determining a first priority table comprising first cell priority levels for a system charge operation and a second priority table comprising second cell priority levels for a system discharge operation, the first priority levels and the second priority levels being determined, for each cell, taking into account at least one criterium among the criteria selected in the group comprising the state of charge of the cell, the cell temperature, the cell capacity, the state of health of the cell, the intern impedance of the cell, the current crossing the system, the type of cell, and an emergency level; b) determining a connection sequence of the cells to follow the set point, the cells being ordered in the connection sequence according to implementation numbers of the cells in the connection sequence, and determining data representative of the average current (Imoy) or of the average electric power exchanged by each cell over a time window according to the implementation number of the cell in the cell connection sequence; c) determining a classification of at least part of the implementation numbers of the cells, the classification being performed by increasing or decreasing order of the data representative of the average current or of the average electric power; d) assigning the ranks to the cells according to the classification, the assigning being performed order by increasing or decreasing order of the priority levels of at least one of the first or second priority tables; and e) controlling the switches (SW) to connect or disconnect the cells according to the order of the assigned ranks. a) determining a first priority table comprising first cell priority levels for a system charge operation and a second priority table comprising second cell priority levels for a system discharge operation, the first priority levels and the second priority levels being determined, for each cell, taking into account at least one criterium among the criteria selected in the group comprising the state of charge of the cell, the cell temperature, the cell capacity, the state of health of the cell, the intern impedance of the cell, the current crossing the system, the type of cell, and an emergency level; b) determining a connection sequence of the cells to follow the set point, the cells being ordered in the connection sequence according to implementation numbers of the cells in the connection sequence, and determining data representative of the average current (Imoy) or of the average electric power exchanged by each cell over a time window according to the implementation number of the cell in the cell connection sequence; c) determining a classification of at least part of the implementation numbers of the cells, the classification being performed by increasing or decreasing order of the data representative of the average current or of the average electric power; d) assigning the ranks to the cells according to the classification, the assigning being performed order by increasing or decreasing order of the priority levels of at least one of the first or second priority tables; and e) controlling the switches (SW) to connect or disconnect the cells according to the order of the assigned ranks. <EOS>