The instantaneous pressure required to unload the elastic work of inspiring against the user-specified elastance is the specified elastance times the instantaneous inspired volume.
Calculating instantaneous inspired volume simply by integrating respiratory airflow with respect to time does not work in practice for three reasons: firstly leaks cause explosive run-away of the integration.