<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def var_define(self, variable, ty, fname, descr='', uname=''):
 """ Define a variable in the model :param fname: LaTex formatted variable name string :param uname: unformatted variable name string, `variable` as default :param variable: variable name :param ty: type code in ``('x', 'y')`` :param descr: variable description :type variable: str :type ty: str :type descr: str :return: """

        assert ty in ('x', 'y')
        if not uname:
            uname = variable

        if ty == 'x':
            self._states.append(variable)
            self._fnamex.append(fname)
            self._unamex.append(uname)
            if descr:
                self._states_descr.update({variable: descr})
        elif ty == 'y':
            self._algebs.append(variable)
            self._fnamey.append(fname)
            self._unamey.append(uname)
            if descr:
                self._algebs_descr.update({variable: descr})