def linear_force(params, t, force):
    """
    Calculation of the residual to perform linear fit on a function forcing its intercept to be at the origin
    
    This auxiliary function returns the residual which is passed to the main wrap around fitting function: linear_fit_nob
    
    Parameters:
    ---------- 
    params :  numpy.ndarray
        parameters defined by the non-linear optimization wrap around function: nls_fit
    t : numpy.ndarray
        independent variable (generally time trace)
    force : numpy.ndarray
        dependent variable (generally force trace)
    
    Returns:
    ----------
    (model - force) : numpy.ndarray
        residual calculated to be passed to the optimization function: linear_fit_nob    
    """
    p = params.valuesdict()
    A = p['A']
    model = A * t
    return model - force
