The capillary tube is the simplest type of expansion device you could use. Essentially, it is a very small bore tube that is selected such that the frictional pressure drop equals the required pressure drop between the condensing and evaporating pressures.
Since there are already some fittings in the liquid line and at the evaporator there is a distributor, tails and the evaporator itself, these pressure drops must be included.
Going from 3 to 4 is complicated by the change in refrigerant quality. We solve the problem by a step-by-step simulation where at each step, the incremental length to achieve a temperature difference of 1°C is calculated.