<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_val(self, eq, val):
 """Return the name of the equation having the given value"""

        if eq not in ('f', 'g', 'q'):
            return
        elif eq in ('f', 'q'):
            key = 'unamex'
        elif eq == 'g':
            key = 'unamey'
        idx = 0
        for m, n in zip(self.system.varname.__dict__[key], self.__dict__[eq]):
            if n == val:
                return m, idx
            idx += 1
        return