A new method for measurement of compliance and resistance of lungs and thorax