A method for controlling a synchronous double stator electric machine being formed of at least one double stator unit comprising a rotor being rotatable around a shaft axis (X-X), the rotor comprising a first set of magnetic poles and a second set of magnetic poles, a first stator facing towards the first set of magnetic poles, whereby the first set of magnetic poles and the first stator form a first electric machine within the double stator electric machine, the first electric machine being controlled by a first frequency converter, a first load angle (δi) being formed between the magnetic flux (Ψsi) of the first stator and the magnetic flux (Ψri) of the first set of magnetic poles, a second stator facing towards the second set of magnetic poles, whereby the second set of magnetic poles and the second stator form a second electric machine within the double stator electric machine, the second electric machine being controlled by a second frequency converter, a second load angle (δo) being formed between the magnetic flux (Ψso) of the second stator and the magnetic flux (Ψro) of the second set of magnetic poles, whereby the first stator and the second stator has an equal number of slots, one of the two electric machines (510, 520) comprises a mechanical shift with a predetermined angle (γ) between the rotor and the stator (200, 300) causing the synchronous double stator electric machine to operate in a shifted topology compared to an un-shifted topology in which the rotor and the two stators (200, 300) are aligned, the method comprising producing an electrical shift to the control of at least the mechanically shifted electric machine (510, 520) with the respective frequency converter (250, 350) in order to at least partly compensate for the mechanical shift in the mechanically shifted electric machine (510, 520), characterized in that the electrical shift being produced by rotating the magnetic flux (Ψsi, Ψso) of the respective stator (200, 300) in a direction opposite to the direction of the mechanical shift, or rotating the magnetic flux (Ψsi, Ψso) of the respective stator (200, 300) back to the position it had in the un-shifted topology, or restoring the values of the load angles (δi, δo) in the shifted topology to the values of the load angles (δi, δo) in the un-shifted topology for both electric machines (510, 520), or rebalancing the power and/or the torque between the two electric machines (510, 520) so that the sum of the torque harmonics of the two electric machines (510, 520) remains under a predetermined value, or rebalancing the power and/or the torque between the two electric machines (510, 520) so that the amplitude of the torque harmonics in the two electric machines (510, 520) are substantially equal. a rotor being rotatable around a shaft axis (X-X), the rotor comprising a first set of magnetic poles and a second set of magnetic poles, a first stator facing towards the first set of magnetic poles, whereby the first set of magnetic poles and the first stator form a first electric machine within the double stator electric machine, the first electric machine being controlled by a first frequency converter, a first load angle (δi) being formed between the magnetic flux (Ψsi) of the first stator and the magnetic flux (Ψri) of the first set of magnetic poles, a second stator facing towards the second set of magnetic poles, whereby the second set of magnetic poles and the second stator form a second electric machine within the double stator electric machine, the second electric machine being controlled by a second frequency converter, a second load angle (δo) being formed between the magnetic flux (Ψso) of the second stator and the magnetic flux (Ψro) of the second set of magnetic poles, whereby the first stator and the second stator has an equal number of slots, one of the two electric machines (510, 520) comprises a mechanical shift with a predetermined angle (γ) between the rotor and the stator (200, 300) causing the synchronous double stator electric machine to operate in a shifted topology compared to an un-shifted topology in which the rotor and the two stators (200, 300) are aligned, the method comprising producing an electrical shift to the control of at least the mechanically shifted electric machine (510, 520) with the respective frequency converter (250, 350) in order to at least partly compensate for the mechanical shift in the mechanically shifted electric machine (510, 520), characterized in that the electrical shift being produced by rotating the magnetic flux (Ψsi, Ψso) of the respective stator (200, 300) in a direction opposite to the direction of the mechanical shift, or rotating the magnetic flux (Ψsi, Ψso) of the respective stator (200, 300) back to the position it had in the un-shifted topology, or restoring the values of the load angles (δi, δo) in the shifted topology to the values of the load angles (δi, δo) in the un-shifted topology for both electric machines (510, 520), or rebalancing the power and/or the torque between the two electric machines (510, 520) so that the sum of the torque harmonics of the two electric machines (510, 520) remains under a predetermined value, or rebalancing the power and/or the torque between the two electric machines (510, 520) so that the amplitude of the torque harmonics in the two electric machines (510, 520) are substantially equal.