def apply_nonlinear(self, params, unknowns, resids):

        y2_actual = params['y2_actual']
        y2_command = unknowns['y2_command']

        resids['y2_command'] = y2_actual - y2_command
Don't solve; just calculate the residual.
dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/test/sellar.py/StateConnection.apply_nonlinear