  It is a universal phenomenon that the state and input of the continuous
stirred tank reactor (CSTR) systems are both disturbed. This paper proposes a
(state, input)-disturbed port-Hamiltonian framework that can be used to model
and further designs a stochastic passivity based controller to asymptotically
stabilize in probability the (state, input)-disturbed CSTR (sidCSTR) systems.
The opposite entropy function and the availability function are selected as the
Hamiltonian for the model and control purposes, respectively. Furthermore, the
proposed (state, input)-disturbed port-Hamiltonian model can simultaneously
characterize the first law and the second law of thermodynamics when the
opposite entropy function acts as the Hamiltonian. A simple CSTR example
illustrates how the port-Hamiltonian method is utilized for modeling and
controlling sidCSTR systems.

Optimization and Control