from typing import Union
from typing import Optional


def ekill(self, elem: Union[str, int] = "",
          **kwargs) -> Optional[str]:
    """Deactivates an element (for the birth and death capability).

    APDL Command: EKILL

    Parameters
    ----------
    elem
        Element to be deactivated. If ALL, deactivate all
        selected elements [ESEL]. A component name may also be
        substituted for ELEM.

    Notes
    -----
    Deactivates the specified element when the birth and death
    capability is being used. A deactivated element remains in
    the model but contributes a near-zero stiffness (or
    conductivity, etc.) value (ESTIF) to the overall matrix. Any
    solution-dependent state variables (such as stress, plastic
    strain, creep strain, etc.) are set to zero. Deactivated
    elements contribute nothing to the overall mass (or
    capacitance, etc.) matrix.

    The element can be reactivated with the EALIVE command.

    ANSYS, Inc. recommends using element deactivation/reactivation
    (EKILL/EALIVE) for linear elastic materials only. For all other
    materials, validate the results carefully before using them.

    This command is also valid in PREP7.
    """
    command = f"EKILL,{elem}"
    return self.run(command, **kwargs)