Computer-implemented method for operating a shut-off device for a fluid, with a housing conducting the fluid, with an inflow opening for the fluid, which opening is provided in the housing and with an outflow opening for the fluid, which opening is provided in the housing, with a flow channel formed in the housing for the fluid between the inflow opening and the outflow opening, and with a blocking device arranged in the flow channel with an adjustable flow cross-section for the fluid in the blocking device and thus in the flow channel and with a control and evaluation unit for activating the blocking device and for detecting state variables of the shut-off device, characterized in that the relationship between at least two state variables of the shut-off device, between which there is a physical dependency, is described as a mathematical model of the shut-off device, that values for the state variables are detected at the shut-off device, that at least one of the following method steps is carried out: - checking a state variable for the presence of a detection error when detecting the value of the state variable: calculating a calculation value for the state variable to be checked by inserting the values for the other state variables into the mathematical model, calculating calculation values for the other state variables by inserting the calculation value for the state variable to be checked and the values of the other state variables into the mathematical model, signaling a detection error in the checked state variable if the calculated value of the state variable to be checked differs from the detected value of the state variable to be checked and the calculated values of the other state variables do not differ from the corresponding detected values of the other state variables, - replacing the detected value of the state variable for which a detection error has occurred by a corrected value by: calculating a calculation value for the state variable for which a detection error has occurred by inserting the values for the other state variables into the mathematical model, and replacing the detected value for the state variable for which a detection error has occurred by the calculated calculation value for that state variable. that the relationship between at least two state variables of the shut-off device, between which there is a physical dependency, is described as a mathematical model of the shut-off device, that values for the state variables are detected at the shut-off device, that at least one of the following method steps is carried out: - checking a state variable for the presence of a detection error when detecting the value of the state variable: calculating a calculation value for the state variable to be checked by inserting the values for the other state variables into the mathematical model, calculating calculation values for the other state variables by inserting the calculation value for the state variable to be checked and the values of the other state variables into the mathematical model, signaling a detection error in the checked state variable if the calculated value of the state variable to be checked differs from the detected value of the state variable to be checked and the calculated values of the other state variables do not differ from the corresponding detected values of the other state variables, - replacing the detected value of the state variable for which a detection error has occurred by a corrected value by: calculating a calculation value for the state variable for which a detection error has occurred by inserting the values for the other state variables into the mathematical model, and replacing the detected value for the state variable for which a detection error has occurred by the calculated calculation value for that state variable. - checking a state variable for the presence of a detection error when detecting the value of the state variable: calculating a calculation value for the state variable to be checked by inserting the values for the other state variables into the mathematical model, calculating calculation values for the other state variables by inserting the calculation value for the state variable to be checked and the values of the other state variables into the mathematical model, signaling a detection error in the checked state variable if the calculated value of the state variable to be checked differs from the detected value of the state variable to be checked and the calculated values of the other state variables do not differ from the corresponding detected values of the other state variables, - replacing the detected value of the state variable for which a detection error has occurred by a corrected value by: calculating a calculation value for the state variable for which a detection error has occurred by inserting the values for the other state variables into the mathematical model, and replacing the detected value for the state variable for which a detection error has occurred by the calculated calculation value for that state variable.