<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def headloss_rect(FlowRate, Width, DistCenter, Length, KMinor, Nu, PipeRough, openchannel):
 """Return the total head loss in a rectangular channel. Total head loss is a combination of the major and minor losses. This equation applies to both laminar and turbulent flows. """

    #Inputs do not need to be checked here because they are checked by
    #functions this function calls.
    return (headloss_exp_rect(FlowRate, Width, DistCenter, KMinor).magnitude
              + headloss_fric_rect(FlowRate, Width, DistCenter, Length,
                                   Nu, PipeRough, openchannel).magnitude)