A cogeneration plant of electrical and heat energy configured such as to realise a Rankine or Rankine-Hirn thermodynamic cycle for producing electrical and heat energy, the plant comprising: - a rotary expander comprising: - a housing (11, 12) provided with an internal cavity defining a toroidal cylinder or an annular cylinder; wherein the annular cylinder is provided with a first inlet opening and a second inlet opening for inlet of high-pressure steam into the cylinder, and with a first outlet opening and a second outlet opening for discharge of exhausted steam; - a first pair of pistons (24, 25) and a second pair of pistons rotatably housed internally of the toroidal cylinder or the annular cylinder, with said respective pistons alternated between one another; - a casing and a three-shaft kinetic transmission housed in said casing, the transmission comprising a primary shaft, a first secondary shaft and a second secondary shaft, each secondary shaft being connected to a respective pair of pistons (24-25; 34-35), in which a continuous rotation of the primary shaft determines a periodical cyclical variation of the rotation velocity of the first secondary shaft and the second secondary shaft; - a steam generator arranged upstream of the rotary expander and connected thereto such as to provide a flow of water steam able to set in rotation the two pairs of pistons (24-25; 34-35); - an electrical alternator/generator connected to the rotary expander in order to receive mechanical energy from the two pairs of rotary pistons (24-25; 34-35) and produce a quantity of electrical energy destined for sending to a user plant; - an exchanger/condenser arranged downstream of the rotary expander and connected thereto such as to receive therefrom a flow of exhausted steam such as to extract therefrom a quantity of heat; characterized in that steam transport ducts inject the flow of steam produced by the steam generator into the rotary expander entirely via the first inlet opening, in order to produce a rotation of the pairs of pistons, and expelled entirely via the first outlet opening, and from there it is entirely re-injected into the rotary expander through the second inlet opening, in order to produce a rotation of the pairs of pistons, and entirely expelled through the second outlet opening towards the exchanger/condenser, such as to determine a pathway in series of the steam in arrival from the steam generator, the pathway including an initial injection of steam into a chamber of the rotary expander though the first inlet opening, a first expulsion from the chamber via the first outlet opening, a subsequent re-injection into a further rotary expansion chamber through the second inlet opening and a subsequent expulsion from the further chamber via the second outlet opening. - a rotary expander comprising: - a housing (11, 12) provided with an internal cavity defining a toroidal cylinder or an annular cylinder; wherein the annular cylinder is provided with a first inlet opening and a second inlet opening for inlet of high-pressure steam into the cylinder, and with a first outlet opening and a second outlet opening for discharge of exhausted steam; - a first pair of pistons (24, 25) and a second pair of pistons rotatably housed internally of the toroidal cylinder or the annular cylinder, with said respective pistons alternated between one another; - a casing and a three-shaft kinetic transmission housed in said casing, the transmission comprising a primary shaft, a first secondary shaft and a second secondary shaft, each secondary shaft being connected to a respective pair of pistons (24-25; 34-35), in which a continuous rotation of the primary shaft determines a periodical cyclical variation of the rotation velocity of the first secondary shaft and the second secondary shaft; - a housing (11, 12) provided with an internal cavity defining a toroidal cylinder or an annular cylinder; wherein the annular cylinder is provided with a first inlet opening and a second inlet opening for inlet of high-pressure steam into the cylinder, and with a first outlet opening and a second outlet opening for discharge of exhausted steam; - a first pair of pistons (24, 25) and a second pair of pistons rotatably housed internally of the toroidal cylinder or the annular cylinder, with said respective pistons alternated between one another; - a casing and a three-shaft kinetic transmission housed in said casing, the transmission comprising a primary shaft, a first secondary shaft and a second secondary shaft, each secondary shaft being connected to a respective pair of pistons (24-25; 34-35), in which a continuous rotation of the primary shaft determines a periodical cyclical variation of the rotation velocity of the first secondary shaft and the second secondary shaft; - a steam generator arranged upstream of the rotary expander and connected thereto such as to provide a flow of water steam able to set in rotation the two pairs of pistons (24-25; 34-35); - an electrical alternator/generator connected to the rotary expander in order to receive mechanical energy from the two pairs of rotary pistons (24-25; 34-35) and produce a quantity of electrical energy destined for sending to a user plant; - an exchanger/condenser arranged downstream of the rotary expander and connected thereto such as to receive therefrom a flow of exhausted steam such as to extract therefrom a quantity of heat;