A general procedure to determine the transfer matrix of Francis turbine conduits in presence of cavitating and periodically detaching flow