The macroscopic fundamental diagram in urban network: analytical theory and simulation