<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_independent_variable(self, variable):
 """ Add a global independent variable to this model, such as time. :param variable: an IndependentVariable instance :return: none """


        assert isinstance(variable, IndependentVariable), "Variable must be an instance of IndependentVariable"

        if self._has_child(variable.name):

            self._remove_child(variable.name)

        self._add_child(variable)

        # Add also to the list of independent variables
        self._independent_variables[variable.name] = variable