A respiratory monitor device comprising: an airway pressure sensor configured to acquire airway pressure data as a function of time and an airway flow sensor configured to acquire airway flow data as a function of time; a breath detector comprising an electronic processor programmed to detect a breath interval in at least one of the airway pressure data and the airway flow data; and a per-breath respiratory variables estimator comprising an electronic processor programmed to estimate respiratory muscle pressure as a function of time over the detected breath interval by operations including: fitting the airway pressure and airway flow data over the breath interval to an equation of motion of the lungs relating airway pressure, airway flow, and a single-breath parameterized respiratory muscle pressure profile (40, 42) to generate optimized parameter values for the single-breath parameterized respiratory muscle pressure profile, wherein the parameters to be optimized by fitting include: a respiratory muscle pressure at the start of the breath interval; a maximum negative respiratory muscle pressure; a respiratory muscle pressure at the end of the breath interval; a first time parameter corresponding to the time value at which the maximum negative respiratory muscle pressure is reached; and a second time parameter corresponding to the time value at which the respiratory muscle pressure at the end of the breath interval is reached, and wherein generating the optimized first and second time parameters comprises selecting a plurality of possible pairs of the first time parameter and the second time parameter and fitting the plurality of pairs using a grid search method, and estimating the respiratory muscle pressure as a function of time over the detected breath interval as the single-breath parameterized respiratory muscle pressure profile with the optimized parameter values. an airway pressure sensor configured to acquire airway pressure data as a function of time and an airway flow sensor configured to acquire airway flow data as a function of time; a breath detector comprising an electronic processor programmed to detect a breath interval in at least one of the airway pressure data and the airway flow data; and a per-breath respiratory variables estimator comprising an electronic processor programmed to estimate respiratory muscle pressure as a function of time over the detected breath interval by operations including: fitting the airway pressure and airway flow data over the breath interval to an equation of motion of the lungs relating airway pressure, airway flow, and a single-breath parameterized respiratory muscle pressure profile (40, 42) to generate optimized parameter values for the single-breath parameterized respiratory muscle pressure profile, wherein the parameters to be optimized by fitting include: a respiratory muscle pressure at the start of the breath interval; a maximum negative respiratory muscle pressure; a respiratory muscle pressure at the end of the breath interval; a first time parameter corresponding to the time value at which the maximum negative respiratory muscle pressure is reached; and a second time parameter corresponding to the time value at which the respiratory muscle pressure at the end of the breath interval is reached, and wherein generating the optimized first and second time parameters comprises selecting a plurality of possible pairs of the first time parameter and the second time parameter and fitting the plurality of pairs using a grid search method, and estimating the respiratory muscle pressure as a function of time over the detected breath interval as the single-breath parameterized respiratory muscle pressure profile with the optimized parameter values. fitting the airway pressure and airway flow data over the breath interval to an equation of motion of the lungs relating airway pressure, airway flow, and a single-breath parameterized respiratory muscle pressure profile (40, 42) to generate optimized parameter values for the single-breath parameterized respiratory muscle pressure profile, wherein the parameters to be optimized by fitting include: a respiratory muscle pressure at the start of the breath interval; a maximum negative respiratory muscle pressure; a respiratory muscle pressure at the end of the breath interval; a first time parameter corresponding to the time value at which the maximum negative respiratory muscle pressure is reached; and a second time parameter corresponding to the time value at which the respiratory muscle pressure at the end of the breath interval is reached, and a respiratory muscle pressure at the start of the breath interval; a maximum negative respiratory muscle pressure; a respiratory muscle pressure at the end of the breath interval; a first time parameter corresponding to the time value at which the maximum negative respiratory muscle pressure is reached; and a second time parameter corresponding to the time value at which the respiratory muscle pressure at the end of the breath interval is reached, and wherein generating the optimized first and second time parameters comprises selecting a plurality of possible pairs of the first time parameter and the second time parameter and fitting the plurality of pairs using a grid search method, and estimating the respiratory muscle pressure as a function of time over the detected breath interval as the single-breath parameterized respiratory muscle pressure profile with the optimized parameter values.