Abstract
Mechanical ventilation is a life-saving treatment for critically ill patients who are struggling to breathe independently due to injury or disease. Globally, per year, there has always been a large number of individuals who have required mechanical ventilation. The COVID-19 pandemic brought to light the significance of mechanical ventilation, which played a significant role in sustaining COVID-19-infected critically ill patients who could not breathe on their own. The pandemic drew the attention of the world to the shortage of ventilators globally. Some of the challenges to providing an adequate number of ventilators include: increased demand for ventilators, supply chain disruptions, manufacturing constraints, distribution inequalities, financial constraints, maintenance and logistics difficulties, training and expertise shortages, and the lack of design and development of affordable mechanical ventilators that satisfy the stipulated requirements. This research work presents the formulation of a detailed Port–Hamiltonian model of a mechanical ventilator integrated with the human respiratory system. The interconnection and coupling conditions for the various subsystems within the mechanical ventilator and the coupling between the mechanical ventilator and the human respiratory system are also presented. Structure-preserving discretization is provided alongside numerical simulations and results. The obtained results are found to be comparable to results presented in the literature. Future work will include the design of suitable controllers for the system.
1. Introduction
The World Health Organization (WHO) has “access to oxygen” on its model list as one of the essentials required by an individual, especially when they are in a critical condition health-wise and are unable to breathe on their own. Oxygen is the only listed medicine that does not have a substitute. Access to oxygen even after the worldwide pandemic is still a major dilemma in middle- and low-income countries [1]. A mechanical ventilator is a medical device that is employed to assist patients in cases where their respiratory system is not functioning well and, thus, the patient has challenges with breathing or has shortness of breath. A mechanical ventilator can also be used in cases where a patient has been sedated and is undergoing surgery.
The basic operation of a mechanical ventilator is to control a high-pressure region during the inspiration stage. In the inspiration stage, the mechanical ventilator is paused. During expiration, air flows out due to the lung’s natural recoil, which creates higher pressure in the alveoli. Due to the high demand for mechanical ventilators both in the past and at present, it is imperative that efficient and affordable mechanical ventilators be researched, modelled, designed and implemented. To ensure that robust mechanical ventilators are designed, it is important to formulate new models that can be used in the research and testing stages of mechanical ventilators.
1.1. Mathematical Models of the Respiratory System
Sound mathematical formulations of the underlying physics of the respiratory system are very important for understanding the anatomy and physiology of the organs. Classical modelling methodologies that employ a physiological or clinical perspective have been previously used mainly for data-fitting for single-compartment model parameters: for example, [2]. Human lungs are usually mathematically viewed to be made up of intricate branching networks of compliant tubes spanning a broad range of scales and flow regimes. The flow may be a highly pulsatile flow or an almost laminar diffusion-dominated process. Flow enters a sponge-like microstructure of lung tissue from the terminal branches of the airway. The lung tissue material’s behaviour is very nonlinear, and for efficient gaseous exchange, the topology is optimized with small embedded blood vessels. Current research developments in the mechanical and mathematical modelling of the lungs have mainly focused on studying isolated effects that are difficult to understand and assess in vivo. These studies seek to advance medical imaging and functional diagnostics and assist with patient-specific treatment planning and optimization. Bates [3] used a system identification approach to provide a mathematical description of lung mechanics, with evolving intricacies in the mathematical formulations. This ranged from single linear compartments to generalized multi-compartmental models. Maury [4] further developed the concept proposed by Bates [3] and described the lung as a resistive tree. Various levels of description have been proposed, including lumped models with a small number of parameters described by ordinary differential equations (ODEs) up to infinite-dimensional models based on partial differential equations (PDEs). Resistive networks and how they can be used to investigate the dependence of the lung’s resistance on geometrical characteristics have also been presented. Analyses of the various models from a theoretical perspective have been provided. The approximate solution techniques that have been provided have shown good correlation with experimental measurements. Other researchers that have proposed similar works are Burrowes et al. [5], Tawhai et al. [6], and Berger et al. [7]. Research has also been conducted by Roth et al. [8] using Navier–Stokes equations for fluid flow from a very mathematical perspective. This research work also provides comprehensive and computationally fully resolved fluid representations of human respiratory models or parts thereof. Solutions of the three-dimensional Navier–Stokes equations on rigid geometries have also been formulated. Information from medical imaging alongside the fluid domain have been used to formulate real fluid–structure interaction effects [8]. As an approach for replicating real fluid–structure effects, techniques have been developed and published that demonstrate this concept in the fluid domain by the application of data from medical imaging information. To quantify particle deposition or drug delivery in the lower and upper airways and for investigation of patterns in the lungs such as jets or vortices, a fully resolved fluid model may be used. Such models are very complex, and in most cases, only parts of the human respiratory system are investigated, thus eliminating the important impact of the entire organ. A holistic human respiratory system model requires a consistent, physiologically realistic representation of the respiratory mechanics in addition to the purely mechanical or structural aspects because the basic physics of respiratory mechanics are governed by the interaction of the fluid with the anatomy. The normal functioning of the lung is possible due to the deformation of the associated muscles, airway tree and lung tissue. Indeed, tissue properties have an influence on airflow and the processes that occur during air transportation: for instance, during gaseous exchange or aerosol transportation.
1.2. Related Works
Tran et al. [9] conducted research work with the main goal of designing, controlling, modelling, and simulating a mechanical ventilator that is lightweight, portable, and suitable for use at home. Tran et al. [9] modelled a mechanical ventilator as a voltage source. El-Hadj et al. [10] applied the fluid–structure interaction (FSI) to couple the computational fluid dynamics used for fluid flow with finite element analysis for the solid domain. This facilitated the investigation of fluid behaviour, structural behaviour, and interactions. Two designs were proposed for the mechanical ventilator. The first design was reported to be uncontrollable, and the second design considers computational fluid dynamics (CDF) with a moving boundary applied to a piston-cylinder-based ventilator. Tharton et al. [11] designed and developed a ventilator prototype to be used by professionals in medical emergencies and in any other context where the regular ventilator is not available. A mechanical ventilator was modelled using a crank rocker mechanism in order to meet specific requirements for mechanical ventilator design. Pivk et al. [12] developed an empirical model for a low-cost mechanical ventilator by observing the response of each of the ventilator subsystems. The current progress made globally in the development of affordable and effective designs is important. However, research in mechanical ventilator development lacks model development. The Port–Hamiltonian approach applied in this research work acts as a modelling template for future energy-based mechanical ventilator modelling and design. Lagrangian modelling and Kane’s approach do not emphasize energy routing in the system through a Dirac structure. Kane’s method is also limited with regard to modelling of the fluid interaction of the mechanical ventilator–human respiratory system. It is important to develop designs that rest on a solid understanding of a significant aspect of the design. Naggar [13] developed a piecewise model of a mechanical ventilator that describes the artificial behaviour of a mechanical ventilator. A pressure-controlled ventilator was created and simulated. The mechanical ventilator was modelled using a periodic function with inequalities to control the beginning of the inspiration and expiration periods. Shi et al. [14] developed a mathematical model of volume-controlled mechanical ventilation. The model is viewed as a pneumatic system wherein the ventilator is regarded as an air compressor. The exhalation valve is considered a throttle. The compressor and the container represent the ventilator. Naggar et al. [15] proposed an integrated mathematical model of the mechanical ventilator and the lung. Linear quadratic and exponential equations were used to model the system. The integrated model was used to simulate volume-controlled artificial ventilation. Giri et al. [16] proposed a simplified design of a mechanical ventilator to reduce cost and automate the mechanical ventilation process. The proposed design was simulated on the MATLAB platform. Hannon et al. [17] reviewed the progress in mathematical modelling and simulation of human anatomy, physiology, and pathophysiology using computers in the context of mechanical ventilation. This study emphasized the clinical applications of computer simulations in various disease states. The research work further discussed the present constraints and the possibility of in silico modelling. There are currently no existing Port–Hamiltonian models of mechanical ventilators.
1.3. Applications of Integrated Mechanical Ventilator–Human Lung System Models
Integrated mechanical ventilator–human lung system models can be used to simulate the behaviour of the respiratory system and to study the effects of mechanical ventilation on lung function. These models have several applications in research, education, and clinical practice. Overall, integrated mechanical ventilator–human lung system models provide a valuable tool for understanding the behaviour of the respiratory system under mechanical ventilation and for developing improved strategies for the diagnosis and treatment of respiratory disorders. The subsections to follow provide examples of applications of integrated models of the mechanical ventilator–respiratory system. In Mehedi et al. [18], the respiratory system was modelled as a combination of the blower-hose patient system with nonlinear lung compliance. There are currently very few studies that have conducted simulations during expiration since the availability of storage for the inhaled volume is required during expiration.
1.4. Motivation of the Port–Hamiltonian Approach
Both the mechanical ventilator and the human respiratory system are multi-physical in nature (they contain components from various domains in physics). As such, a more apt approach to understand the manner in which these systems work, the coupling between them, etc., and, furthermore, to improve the efficiency of mechanical ventilation, is to make use of models that better represent these systems. Thus, a more representative modelling approach would be to account for the multi-physical nature of these systems [19,20]. The Port–Hamiltonian approach for modelling integrated systems has several benefits, including [19,20]:
- The Port–Hamiltonian approach is modular and is based on the topology of the mechanical ventilator and the human respiratory system. Thus, various types of mechanical ventilators and human respiratory systems with different structure/topologies can be simulated/tested numerically under various operating conditions to analyse performance, etc. [19,20].
- The modular nature of the Port–Hamiltonian method, together with its basis in graph theory, means that one can proceed to develop software to automate the modelling of various types of mechanical ventilator/human respiratory system topologies [19,20].
- Properties such as the passivity of the integrated mechanical ventilator–human respiratory system can be shown and studied [19,20].
Currently, there are no energy-based models of MV–patient systems that can be used in systems that have dissipation of energy from the ports. Complex dynamical systems can be modelled and controlled in the Port–Hamiltonian framework because the framework provides a powerful tool for the analysis, modelling and control of such systems. The key attributes of the Port–Hamiltonian (pH) framework are: Firstly, it is established on the multi-domain bond-graph modelling method, which connects various physical elements via ports. The interconnection in the Port–Hamiltonian method is such that there is power conservation. Secondly, there is significance assigned to the energy variables as well as the total energy stored, which is also known as the Hamiltonian and is the foundation for multi-physics system modelling. The Port–Hamiltonian approach provides the basis for understanding energy transfer in the various physical domains that govern the respiratory system. Sampled data can be obtained when the Port–Hamiltonian structure is exploited and preserved in discretization. This research work applies the Port–Hamiltonian system approach to model the MV–human respiratory system. The resulting model explicitly shows the energy storage, energy dissipation and the interconnection underlying the system. The obtained Port–Hamiltonian model has numerous applications: for instance, it may be applied in the design of various medical devices and for respiratory disease diagnostics.
The main contribution in this research work is the development of an integrated Port–Hamiltonian model representation of a mechanical ventilator–human respiratory system. The model consists of electromechanical and electromagnetic components modelled in a finite-dimensional representation and interconnected with fluid components in an infinite-dimensional representation. As a result, this Port–Hamiltonian model is of a mixed finite/infinite dimensional nature. The remainder of this paper is structured as follows: The materials and methods are outlined in Section 2, Section 3 and Section 4 present the detailed Port–Hamiltonian model of a mechanical ventilator and the solenoid valve subsystem. Section 5 and Section 6 give the model network topology and model interconnection with coupling conditions. Section 7 and Section 8 show the structure-preserving discretization, results and discussion. Finally, the conclusion and recommendations are presented in Section 9.
2. Materials and Method
This section presents the mathematical preliminaries of the Port–Hamiltonian approach that are followed in later sections. These definitions are standard definitions from the literature and are mostly derived from the following references: [21,22,23].
Definition 1.
(Dirac structure):
A Dirac structure (DS) is a pair of elements, and , that satisfies the set:
The DS is a subset , where and represent the flows and efforts, respectively.
The DS in electric circuits can be represented as:
Proposition 1.
The subspace
is called a DS if and only if there exist such that
satisfying the condition
Definition 2.
(Resistive Relation).
Any relation is said to be resistive if ,
is satisfied.
Definition 3.
(Port–Hamiltonian (pH) system):
The set defines a pH system where:
- is a DS;
- is an LS;
- a resistive relation.
The elements of the sets:
- and are known as flows and efforts;
- and are known as resistive flows and efforts;
- and are known as external flows and efforts, respectively.
where and .
The dynamics of the pH system are given by the differential inclusion:
where , , and .
Definition 4.
(Interconnection of n pH systems):
Let () denote the space of the pH system in a set of n pH systems that are to be interconnected. The space of flows is divided into an external part and a part to be linked and is given by
Similarly, the space of efforts is divided into an external part and a part to be linked and is expressed as:
The interconnection of two pH systems and with respect to the link results in a new interconnected pH system: . This interconnected system is given by the expression:
Definition 5.
(Directed graph):
A directed graph is a quadruple , where
- 1.
- V is a set of vertices;
- 2.
- E is a set of edges;
- 3.
- maps each edge, e, to an initial vertex;
- 4.
- maps each edge, e, to a terminal vertex.
Definition 6.
(Loop-free directed graph):
If G is a directed graph, then G is said to be loop-free if for all ,
Definition 7.
(Subgraphs).
Given the graphs and , then is said to be a subgraph of if and . Furthermore,
- 1.
- A subgraph is said to be an induced subgraph on if ;
- 2.
- A subgraph is said to be spanning if ;
- 3.
- A subgraph is said to be a proper subgraph if ;
- 4.
- If both V and E are finite, then is said to be finite.
Definition 8.
(Paths, connectivity and cycles):
Let be a directed finite graph.
- 1.
- An n-tuple is called a path from υ to ϖ if
- (a)
- are distinct;
- (b)
- for all ;
- (c)
- .
- 2.
- A path from υ to υ is called a cycle.
- 3.
- Two vertices, υ and ϖ are said to be connected if there exists a path from υ to ϖ.
- 4.
- The existence of paths from vertices gives an equivalence relation on the set of vertices.
- 5.
- A subgraph is a component of the graph.
- 6.
- A graph with only one component is said to be connected.
Definition 9.
(Incidence matrix):
Let be a directed graph that is finite and loop-free such that and . Then the row and column of the incidence matrix of is given by
If , then graph has components, such that k rows can be removed from , resulting in a matrix with the same rank.
Definition 10.
(Kirchhoff–Dirac structure, Kirchhoff–Lagrange submanifold):
The Kirchhoff–Dirac structure of can thus be defined by the set
where i and u are the currents and voltages, respectively, at the edges of the graph, whereas q and ϕ are the charges and potentials, respectively, at the vertices of the graph, respectively.
Assuming that , the Kirchhoff–Lagrange submanifold of with respect to S is defined as
where is a directed graph that
- Is finite;
- Is loop-free;
- Has an incidence matrix .
If are the components of with corresponding vertices so that there exists a subset such that contains at most one vertex from each component, i.e., , then can be constructed by deleting the rows corresponding to the vertices from .
Remark 1.
Definition 10 caters to an introduction of a pH system with dynamics:
where .
Using the equivalence of to and , we see that Equation (3) holds if and only if this condition holds:
On this basis, one can define a DS
with dynamics
and an LS
with dynamics
Together, they form a pH system defined by the set .
Dirac Structure
A key feature of a Dirac structure is the fact that the standard composition of two Dirac structures is again a Dirac structure. The implication of this statement is that any power-conserving interconnection of a Port–Hamiltonian system is also a Port–Hamiltonian system itself. This constitutes the foundational feature of the Port–Hamiltonian approach to modelling, simulation and control of complex physical systems. The intricate Dirac structure is the guide to the algebraic constraints of the interconnected system as well as its Casimir functions [23]. The Casimir functions are significant for the set-point regulation of Port–Hamiltonian systems. The framework of the Port–Hamiltonian approach allows for port-based modelling. Port-based modelling means that we are interconnecting many different elements through ports. Dirac structures are the tools used to connect multiple elements. These various elements are energy-storing elements, energy-dissipating elements and external elements that can supply energy. A diagram to demonstrate the connection structure is given in Figure 1 [23].
Figure 1.
Energy storage, routing and dissipation.
3. Detailed Port–Hamiltonian Model of a Mechanical Ventilator
3.1. Description of the System
The overall mechanical ventilator system diagram is provided in Figure 2. The entire system consists of various subsystems. In this research work, the main subsystem that contributes to the flow of air and, consequently, the air pressure are discussed. Therefore, the following main subsystems will be discussed: the DC motor subsystem, the turbine pump/blower subsystem, the pump-shaft/impeller subsystem and the solenoid valve subsystem.
Figure 2.
Schematic diagram of a mechanical ventilator.
3.2. Blower Model
In this section, the dynamical system model equations for the blower model are presented in the Port–Hamiltonian framework. The blower model comprises three sub-systems: namely, a DC motor that drives the blower-shaft/impeller, a blower-shaft/impeller that couples the DC motor to the fluid by using the rotational motion of the motor to accelerate the fluid, and finally, the fluid being driven.
From the Port–Hamiltonian perspective, the state vector is given by:
where and are the angular momentum and magnetic flux of the DC motor, respectively, while and are the pressure and flow rate of the blower, respectively.
The total energy of the blower is given by the Hamiltonian:
where is the inertia and is the inductance of the DC motor, while and are the hydraulic capacitance and inertance of the air in the blower, respectively.
Thus, the Port–Hamiltonian model of a blower is given by
where
where is the motor torque constant, is the viscous damping, is the armature resistance, and is the motor’s angular momentum/pressure coupling constant. The inputs to the system are the DC motor voltage, the input volumetric flow rate and the pressure, which are given by , and , respectively. One can easily show that and .
Taking the time derivative of the Hamiltonian gives
This system has power and resistive ports.
4. Solenoid Valve Subsystem
Figure 3 shows a solenoid valve in the open and closed positions. It is assumed that the air gaps are sufficiently small such that the effect of fringing of the magnetic flux is negligible. Consider a solenoid in which the permeability of the core and the length of the part of the magnetic circuit inside the core are denoted by and , respectively. The equivalent length of the solenoid’s magnetic circuit is dependent on the displacement of the spool and can be written as:
where is the permeability of air, and is the total air gap. The solenoid coordinate system is represented in Figure 4. Thus, the inductance of the solenoid varies with displacement of the spool and, hence, can be expressed by the function given by:
where is the number of turns in the coil of the solenoid, and is the effective cross-sectional area of the path of the magnetic flux. The magnetic and mechanical subsystems in the solenoid valve are therefore coupled magnetically due to the dependence of the inductance on the displacement of the spool.
Figure 3.
Diagram of a solenoid valve in (i) the open position, which allows fluid flow, and (ii) the closed position, which stops fluid flow.
Figure 4.
Solenoid coordinate system.
The total energy of the solenoid is given by the Hamiltonian , which is a function of the state vector and is expressed as the sum of the magnetic, kinetic and potential energies, which are denoted by , and , respectively. Thus,
given a magnetic flux .
Assuming that the pretension of the spring is set to , the Hamiltonian is
where is the momentum of the spool, is the mass of the spool, is the spring stiffness, and is the acceleration due to gravity.
Hence, the solenoid’s state and output dynamics are expressed in Port–Hamiltonian form in Equations (13) and (14), respectively:
where
where is the resistance of the coil, is the viscous damping acting on the spool, and ∇ is the gradient operator. are the various cross-sectional areas of the surfaces of the spool, and the input vector consists of the input voltage and the supply pressure . It can be seen that possesses skew symmetry, while is positive semi-definite.
Taking the time derivative of the Hamiltonian gives:
This system has power and resistive ports.
4.1. Pipe Model
In this section, a Port–Hamiltonian model of a single pipe segment is developed. The basis of these developments is the Navier–Stokes equations for one-dimensional non-stationary flow of gas in a pipe. The following assumptions are taken for the sake of model simplification [24,25]:
- The pipe is taken as rigid (the cross-section does not expand as a result of fluid flow).
- Frictional and gravitational effects are neglected (this will be relaxed in future works in this research area).
- The model parameters of the gas remain constant along the pipe cross-section but vary in time along the pipe length. Thus, they can be averaged about the cross-section, and thus, the gas flow is one-dimensional.
- The temperatures of the pipe walls are assumed to be constant and equal to the ambient room temperature. Hence, temperature effects are ignored.
Taking into account these assumptions, the coordinate system attached to a segment of pipe is illustrated in Figure 5. Thus, for a given time interval with start time and finish time , the length-normalized one-dimensional Euler equations for gas with a density flowing at a velocity through a pipe of length and cross-sectional area are given by:
where is the pressure, and is the partial derivative with respect to the temporal and spatial variables given by the subscripts .
Figure 5.
Pipe segment coordinate system.
Port–Hamiltonian Formulation of Pipe-Flow Model
The fluid dynamics can be written in terms of mass per unit length, i.e., , as well as the fluid momentum, . Thus, Equations (16) and (17) can be expressed as
Defining the state vector of the gas flow through a pipe segment as , the energy of the gas can be expressed in the form of a Hamiltonian given by
where is the Hamiltonian density, and is the internal energy of the gas, which, in the case of an isentropic fluid, can be expressed as a function of density.
The Port–Hamiltonian dynamics take the following form:
where , which is the formally skew-symmetric operator, and , which is the variational derivative of the Hamiltonian density, are expressed as
where h is the enthalpy, and is a formally skew-symmetric operator.
The rate of change of the Hamiltonian can be found as
where
with components given by
and
Expanding and gives
Thus, the rate of change of the Hamiltonian is
4.2. Electric Circuit Model of the Lung
The Port–Hamiltonian formulation for nonlinear electric circuits is presented in this section. Since the main focus of this article is a mechanical ventilator model, the lung model is simplified by considering an electric circuit analogy. The model under consideration is that of a fully sedated patient who relies completely on the mechanical ventilator to breathe. The circuit model is shown in Figure 6. The circuit can be represented in the form of a network graph using graph theory. The graph of the circuit given in Figure 6 is given in Figure 7. The model has vertices.
Figure 6.
Circuit diagram of an electric model of a lung of a fully sedated patient [26].
Figure 7.
The graph associated with the circuit diagram given in Figure 6.
The complete graph of the circuit, , is
The ventilator input voltage is represented as a source . The set of sources is , and the dimension of the source is . The circuit also consists of capacitors (storage elements) that are represented as , where the index used to distinguish between the components is . Furthermore there are resistors (dissipative elements) that are represented as , where the index is given by .
Selecting node 7 as the ground, the reduced incidence matrix, , is given by
where the dimensions of the components of are , and .
The total energy of the circuit is given by the Hamiltonian
where is the charge of the capacitor for . Thus,
where and are appropriately sized identity and zero matrices, respectively, , and is the node potential. Expanding Equation (30) gives
The Dirac structure is given by the set with the following attributes for :
5. Model Network Topology
Definition 11.
(Directed graph) [27]: A directed graph denotes the pair , where and denote the set of vertices and arcs, respectively. An arc is a distinct ordered-pair of vertices.
The directed graph of a mechanical ventilator model is composed of the disjoint union of the vertices associated with the patient as well as the inspiratory and expiratory limbs of the ventilator, which are given by and , respectively. Similarly, the patient, inspiratory and expiratory arcs are given by and , respectively. Each arc and vertex can further be subdivided into those associated with the blowers, valves, pipes and electric circuits present in the mechanical ventilator. Thus, the totality of vertices and arcs is given by
and
respectively, where the subscripts are used to indicate the patient, blowers, valves, pipes and electric circuit components, respectively.
A simplified graph of the mechanical ventilator shown in Figure 2 is given in Figure 8. This simplified graph indicates the elements belonging to the patient, as well as the inspiratory arcs and vertices belonging to the mechanical ventilator. The arcs belonging to the patient are denoted by , while the vertices are denoted by . The elements of the inspiratory and expiratory arcs and vertices, given by and , respectively. A more detailed representation of the graph of the mechanical ventilator in Figure 8 is given in Figure 9.
Figure 8.
Simplified graph of the mechanical ventilator given in Figure 2 indicating the elements belonging to the patient, given by the arcs and vertices , as well as elements of the inspiratory and expiratory arcs and vertices, given by and , respectively.
Figure 9.
Detailed graph of the mechanical ventilator given in Figure 8 indicating the patient vertex as well as the arcs and vertices along the inspiratory and expiratory paths.
6. Model Interconnection/Coupling Conditions
In this section, the coupling conditions of the Port–Hamiltonian network model of the mechanical ventilator are given. The types of interconnections occurring in this model are given below:
- Pump-to-pipe interconnection: The pressure and flow rate of the fluid exiting the pump, and , respectively, are equal to the pressure and flow rate at the inlet of the pipe, given by and , respectively. Thus,
- Pipe-to-valve interconnection: The pressure and flow rate of the fluid entering/exiting a valve, and , respectively, are equal to the pressure and flow rate at the inlet/outlet of the pipe, given by and for the inlet and and for the outlet. Thus,and
- Pipe-to-circuit interconnection: The pressure and fluid flow rate at the outlet of a pipe can act as inputs to a circuit model; thus,On the other hand, the output voltage and current of a circuit can be interconnected with a fluid pipe at the inlet of the pipe. In this case, the output voltage and or current of the circuit should be equal to the inlet pressure and inlet flow rate, respectively. This relation can expressed mathematically as:The Hamiltonian of the complete system is given by the sum of the Hamiltonian’s of the individual systems:The rate of change of the energy of the complete system isThe terms and are the external pressures and flow rates acting on the system. They should be equal to zero to complete the interconnection.
7. Structure-Preserving Discretization
The Port–Hamiltonian model of the pipe is a partial differential equation that is continuous in space. As such, it is difficult to simulate the dynamics of a pipe section. In order to do this, it is necessary to approximate the model with a discrete model: in this case, a finite difference model that is an approximation of the original system. Within the context of Port–Hamiltonian systems, an additional requirement is the need to ensure that the discrete approximation maintains the structural properties of the original system: e.g., skew symmetry, etc.
Each system state can be replaced with a discrete approximation consisting of a total on n elements, as can be seen in Figure 10. As such, , and . As such, state vector can be replaced by a discrete approximation . The element of is located at , where is the fixed discrete step size between points, and . In addition, the efforts at the boundaries are given by and . Thus, the Hamiltonian given in Equation (20) can be approximated by a discrete approximation such that so that the discrete system effort is now . A finite difference approximation of the spatial derivatives at the point is
The central difference approximation at the point is
In matrix form, this is
and
which can be re-written as
where
The skew-symmetric operator is clear from Equation (43).
Figure 10.
Staggered grid discretization of the one-dimensional Port–Hamiltonian pipe dynamic model.
8. Results and Discussion
The pipe and solenoid valve model parameters used in this work are given in Table 1 and Table 2, respectively. The Lung circuit model parameters are given in Table 3.
Table 1.
Pipe model parameter values.
Table 2.
Solenoid model parameter values [28].
Table 3.
Lung circuit model parameter values [26].
8.1. Model Validation
The model was validated using parameters obtained from the literature. The simulation results provided in the results and discussion section were found to be comparable to those in the existing literature.
8.2. Simulation Environment
Simulations were conducted using MATLAB Version: 9.13.0.2193358 (R2022b) Update 5 on an Intel Core i5 CPU with four cores and 8 GB of RAM. Figure 11 and Figure 12 show ventilation curves for a lung under two conditions: a partially damaged lung with a compliance and resistance of 20 mL/cmH2O and 20 cmH2O-s/L, respectively, and a lung with complete damage, which is represented by a lung compliance and resistance of 10 mL/cmH2O and 50 cmH2O-s/L, respectively. The ventilation curves maintain the same sinusoidal behaviour. For the damaged lung case study, minimum ventilation values of flow over time and air volume are achieved. In the damaged lung, the compliance and resistance of the lung increase the pressure.
Figure 11.
Graph of air pressure versus time.
Figure 12.
Graph of volume flow versus time.
9. Conclusions and Recommendations
In this research work, we formulate a detailed mechanical ventilator in the Port–Hamiltonian framework. This is followed by a Port–Hamiltonian model of the respiratory system, and thereafter, these two systems are integrated. The conducted work demonstrates that the Port–Hamiltonian approach is a valid method for the modelling of an integrated mechanical ventilator–human respiratory system. The Port–Hamiltonian framework is modular in nature. Furthermore, the complete model structure is based on the underlying graph of the mechanical ventilator and human respiratory system. Future research directions include:
- Developing a software framework for the automatic generation of the Port–Hamiltonian dynamics for various mechanical ventilator and human respiratory system configurations as well as their associated integrated models [19];
- Development of various reduced-order models;
- Development of an integrated framework for the modelling of mechanical ventilator/human respiratory systems to enable control and system optimization [19,20];
- Taking advantage of the modular and graph theoretic nature of the Port–Hamiltonian approach to incorporate machine learning and artificial intelligence [19];
- Investigation of the most appropriate structure-preserving discretizations and model-order reductions for various data-driven applications and control system designs.
Author Contributions
Conceptualization, M.C.I.M.; methodology, M.C.I.M.; software, M.C.I.M.; validation, M.C.I.M. and J.E.D.E.; formal analysis, M.C.I.M.; investigation, M.C.I.M.; resources, M.C.I.M.; data curation, M.C.I.M.; writing—original draft preparation, M.C.I.M.; writing—review and editing, M.C.I.M.; visualization, M.C.I.M.; supervision, O.T.C.N.; project administration, M.C.I.M.; funding acquisition, M.C.I.M. All authors have read and agreed to the published version of the manuscript.
Funding
I would like to thank the School of Mining, Faculty of Engineering, and the Built Environment, University of the Witwatersrand, for the financial support to publish this work.
Institutional Review Board Statement
Ethical review and approval were waived for this study because the study did not involve humans or animals.
Data Availability Statement
The original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding author.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Rubio, J.; Rojas, C.; Sanchez, M.; Gómez-Alzate, D.; Córdova, M.; Montoya, V.; Castaneda, B.; Chang, J.; Pérez-Buitrago, S. COVOX: Providing oxygen during the COVID-19 health emergency. HardwareX 2023, 13, e00383. [Google Scholar] [CrossRef]
- Hickling, K.G. The Pressure–Volume Curve Is Greatly Modified by Recruitment. Am. J. Respir. Crit. Care Med. 1998, 158, 194–202. [Google Scholar] [CrossRef]
- Bates, J.H.T. Lung Mechanics: An Inverse Modeling Approach; Cambridge University Press: Cambridge, UK, 2009. [Google Scholar]
- Maury, B. The Respiratory System in Equations, 1st ed.; MS&A—Modeling, Simulation and Applications; Springer: Milan, Italy, 2013. [Google Scholar] [CrossRef]
- Burrowes, K.S.; Hunter, P.J.; Tawhai, M.H. Anatomically based finite element models of the human pulmonary arterial and venous trees including supernumerary vessels. J. Appl. Physiol. 2005, 99, 731–738. [Google Scholar] [CrossRef]
- Tawhai, M.H.; Bates, J.H.T. Multi-scale lung modeling. J. Appl. Physiol. 2011, 110, 1466–1472. [Google Scholar] [CrossRef]
- Berger, L.; Bordas, R.; Burrowes, K.; Brightling, C.; Hartley, R.; Kay, D. Understanding the Interdependence Between Parenchymal Deformation and Ventilation In Obstructive Lung Disease. In B30. Dynamics of Airway Narrowing in Asthma: Still Misunderstood? American Thoracic Society: New York, NY, USA, 2014; Volume 189, p. A2677. [Google Scholar]
- Roth, C.J.; Yoshihara, L.; Ismail, M.; Wall, W.A. Computational modelling of the respiratory system: Discussion of coupled modelling approaches and two recent extensions. Comput. Methods Appl. Mech. Eng. 2017, 314, 473–493. [Google Scholar] [CrossRef]
- Tran, A.S.; Thinh Ngo, H.Q.; Dong, V.K.; Vo, A.H. Design, Control, Modeling, and Simulation of Mechanical Ventilator for Respiratory Support. Math. Probl. Eng. 2021, 2021, 2499804. [Google Scholar] [CrossRef]
- El-Hadj, A.; Kezrane, M.; Ahmad, H.; Ameur, H.; Bin Abd Rahim, S.Z.; Younsi, A.; Abu-Zinadah, H. Design and simulation of mechanical ventilators. Chaos Solitons Fractals 2021, 150, 111169. [Google Scholar] [CrossRef]
- Tharion, J.; Kapil, S.; Muthu, N.; Tharion, J.; Subramani, K. Rapid Manufacturable Ventilator for Respiratory Emergencies of COVID-19 Disease. Trans. Indian Natl. Acad. Eng. 2020, 5, 373–378. [Google Scholar] [CrossRef]
- Pivik, W.J.; Clayton, G.M.; Jones, G.F.; Nataraj, C. Dynamic Modeling of a Low-cost Mechanical Ventilator. IFAC-PapersOnLine 2022, 55, 81–85. [Google Scholar] [CrossRef]
- Al-Naggar, N. Modelling and Simulation of Pressure Controlled Mechanical Ventilation System. J. Biomed. Sci. Eng. 2015, 8, 707–716. [Google Scholar] [CrossRef]
- Shi, Y.; Ren, S.; Cai, M.; Xu, W. Modelling and Simulation of Volume Controlled Mechanical Ventilation System. Math. Probl. Eng. 2014, 2014, 271053. [Google Scholar] [CrossRef]
- Al-Naggar, N.Q.; Al-Hetari, H.Y.; Al-Akwaa, F.M. Simulation of Mathematical Model for Lung and Mechanical Ventilation. J. Sci. Technol. 2016, 21, 1–9. [Google Scholar] [CrossRef]
- Giri, J.; Kshirsagar, N.; Wanjari, A. Design and simulation of AI-based low-cost mechanical ventilator: An approach. Mater. Today Proc. 2021, 47, 5886–5891. [Google Scholar] [CrossRef]
- Hannon, D.M.; Mistry, S.; Das, A.; Saffaran, S.; Laffey, J.G.; Brook, B.S.; Hardman, J.G.; Bates, D.G. Modeling Mechanical Ventilation In Silico—Potential and Pitfalls. Semin. Respir. Crit. Care Med. 2022, 43, 335–345. [Google Scholar] [CrossRef]
- Mehedi, I.M.; Shah, H.S.; Al-Saggaf, U.M.; Mansouri, R.; Bettayeb, M. Fuzzy PID control for respiratory systems. J. Healthc. Eng. 2021, 2021, 1926711. [Google Scholar] [CrossRef]
- Mehrmann, V.; Unger, B. Control of port-Hamiltonian differential-algebraic systems and applications. Acta Numer. 2023, 32, 395–515. [Google Scholar] [CrossRef]
- van der Schaft, A. Port-Hamiltonian Modeling for Control. Annu. Rev. Control Robot. Auton. Syst. 2020, 3, 393–416. [Google Scholar] [CrossRef]
- Villegas, J.A. A Port-Hamiltonian Approach to Distributed Parameter Systems. Ph.D. Thesis, Department of Applied Mathematics, Faculty EWI, Universiteit Twente, Enschede, The Netherlands, 2007. [Google Scholar]
- Le Gorrec, Y.; Zwart, H.; Maschke, B. Dirac structures and Boundary Control Systems associated with Skew-Symmetric Differential Operators. SIAM J. Control Optim. 2005, 44, 1864–1892. [Google Scholar] [CrossRef]
- van der Schaft, A.J.; Maschke, B.M. Hamiltonian formulation of distributed-parameter systems with boundary energy flow. J. Geom. Phys. 2002, 42, 166–194. [Google Scholar] [CrossRef]
- Anderson, J. Computational Fluid Dynamics: The Basics with Applications; McGraw-Hill International Editions: Mechanical Engineering; McGraw-Hill Inc.: New York, NY, USA, 1995. [Google Scholar]
- Kamiński, Z. A simplified lumped parameter model for pneumatic tubes. Math. Comput. Model. Dyn. Syst. 2017, 23, 523–535. [Google Scholar] [CrossRef]
- Albanese, A.; Cheng, L.; Ursino, M.; Chbat, N.W. An integrated mathematical model of the human cardiopulmonary system: Model development. Am. J. Physiol.-Heart Circ. Physiol. 2016, 310, H899–H921. [Google Scholar] [CrossRef] [PubMed]
- Bondy, J.A.; Murty, U.S.R. Graph Theory with Applications; The Macmillan Press Ltd.: London, UK, 1976. [Google Scholar]
- Taghizadeh, M.; Ghaffari, A.; Najafi, F. Modeling and identification of a solenoid valve for PWM control applications. Comptes Rendus Mécanique 2009, 337, 131–140. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).