Next Article in Journal
A Dynamic Analysis of a Poly-Articulated Robot
Previous Article in Journal
Bayesian Approach to Stochastic Estimation of Population Survival Curves in Chile Using ABC Techniques and Its Impact over Social Structures
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Novel Mixed Finite/Infinite Dimensional Port–Hamiltonian Model of a Mechanical Ventilator

by
Milka C. I. Madahana
1,*,
John E. D. Ekoru
2 and
Otis T. C. Nyandoro
2
1
School of Mining Engineering, University of the Witwatersrand, 2nd Floor, ARM Building, 1 Jan Smuts Avenue, Braamfontein, Johannesburg 2017, South Africa
2
School of Electrical and Information Engineering, University of the Witwatersrand, 2nd Floor, ARM Building, 1 Jan Smuts Avenue, Braamfontein, Johannesburg 2017, South Africa
*
Author to whom correspondence should be addressed.
Computation 2024, 12(8), 155; https://doi.org/10.3390/computation12080155
Submission received: 3 May 2024 / Revised: 23 July 2024 / Accepted: 25 July 2024 / Published: 31 July 2024
(This article belongs to the Section Computational Engineering)

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, f R n and e R n , that satisfies the set:
D   : = ( f , e ) D , ( f ^ , e ^ ) D e T f ^ = e ^ T f .
The DS is a subset D F × E , where F and E represent the flows and efforts, respectively.
The DS in electric circuits can be represented as:
Proposition 1.
The subspace
D R n × R n ,
is called a DS if and only if there exist A , B R n × n such that
A B T + A B T = 0 and rank ( [ A B ] ) = n ,
satisfying the condition
D = ( f , e ) R n × R n | A f = B e .
Definition 2.
(Resistive Relation).
Any relation R R n × R n is said to be resistive if ( f R , e R ) R ,
e R T f R 0 ,
is satisfied.
Definition 3.
(Port–Hamiltonian (pH) system):
The set ( D , L , R ) defines a pH system where:
  • D ( F L × F R × F P ) × ( E L × E R × E P ) is a DS;
  • L F L × E L is an LS;
  • R F R × E R a resistive relation.
The elements of the sets:
  • F L R n L and E L R n L are known as flows and efforts;
  • F R R n R and E R R n R are known as resistive flows and efforts;
  • F P R n P and E P R n P are known as external flows and efforts, respectively.
where n L , n R and n P N 0 .
The dynamics of the pH system are given by the differential inclusion:
d d t x ( t ) , f R ( t ) , f P ( t ) , e L ( t ) , e R ( t ) , e P ( t ) D ,
where ( x ( t ) , e L ( t ) ) L , ( f R ( t ) , e R ( t ) ) R , and ( f P ( t ) , e P ( t ) ) P .
Definition 4.
(Interconnection of n pH systems):
Let ( D i , L i , R i ) denote the space of the i th 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
F i = F L i × F R i × F P i × F P link .
Similarly, the space of efforts is divided into an external part and a part to be linked and is expressed as:
E i = F L i × E R i × E P i × E P link .
The interconnection of two pH systems ( D 1 , L 1 , R 1 ) and ( D 2 , L 2 , R 2 ) with respect to the link ( F P link , E P link ) results in a new interconnected pH system: ( D , L , R ) . This interconnected system is given by the expression:
( D 1 , L 1 , R 1 ) ( D 2 , L 2 , R 2 ) : = ( D , L , R ) .
Definition 5.
(Directed graph):
A directed graph is a quadruple G   : = ( V , E , l , r ) , where
1. 
V is a set of vertices;
2. 
E is a set of edges;
3. 
l : E V maps each edge, e, to an initial vertex;
4. 
r : E V 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 e E ,
l ( e ) r ( e ) .
Definition 7.
(Subgraphs).
Given the graphs G : = ( V , E , l , r ) and G : = ( V , E , l , r ) , then G is said to be a subgraph of G if E E and V V . Furthermore,
1. 
A subgraph is said to be an induced subgraph on V if E = E | V ;
2. 
A subgraph is said to be spanning if V = V ;
3. 
A subgraph is said to be a proper subgraph if E E ;
4. 
If both V and E are finite, then G is said to be finite.
Definition 8.
(Paths, connectivity and cycles):
Let G = ( V , E , l , r ) be a directed finite graph.
1. 
An n-tuple e = ( e 1 , , e n ) ( E E ) n is called a path from υ to ϖ if
(a) 
l ( e 1 ) , , l ( e n ) are distinct;
(b) 
r ( e i ) = l ( e i + 1 ) for all i 1 , , n 1 ;
(c) 
l ( e 1 ) = υ r ( e n ) = ϖ .
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 G = ( V , E , l , r ) be a directed graph that is finite and loop-free such that E = e 1 , , e m and V = υ 1 , , υ n . Then the j t h row and k t h column of the incidence matrix A 0 R n × m of G is given by
a j k = 1 l ( e k ) = υ j , 1 r ( e k ) = υ j , 0 otherwise .
If rank ( A 0 ) = n k , then graph G has k N components, such that k rows can be removed from A 0 , resulting in a matrix with the same rank.
Definition 10.
(Kirchhoff–Dirac structure, Kirchhoff–Lagrange submanifold):
The Kirchhoff–Dirac structure of G can thus be defined by the set
D K S ( G ) : = ( j , i , ϕ , u ) R n | S | × R m × R n | S | × R m I A 0 0 j i + I A 0 0 ϕ u = 0 ,
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 S = v 1 , , v | S | , the Kirchhoff–Lagrange submanifold of G with respect to S is defined as
L K S ( G ) : = 0 × R n | S | R n | S | × R n | S | ,
where G = ( V , E , l , r ) is a directed graph that
  • Is finite;
  • Is loop-free;
  • Has an incidence matrix A 0 R n × m .
If G 1 , , G k are the components of G with corresponding vertices V 1 , , V k V so that there exists a subset S V such that S contains at most one vertex from each component, i.e., s , s , S , i k : v , v V i v = v , then A R ( n k ) × m can be constructed by deleting the rows corresponding to the vertices S from A 0 R n × m .
Remark 1.
According to Proposition 1, Equations (1) and (2) indicate that D K S ( G ) is a DS and L K S ( G ) is an LS in the space R n | S | × R n | S | .
Definition 10 caters to an introduction of a pH system ( D K S ( G ) , L K S ( G ) , 0 ) with dynamics:
( d d t q ( t ) , i ( t ) , ϕ ( t ) , u ( t ) ) D K S ( G ) ,
where ( q ( t ) , ϕ ( t ) ) L K S ( G ) .
Using the equivalence of ( q ( t ) , ϕ ( t ) ) L K S ( G ) to q ( t ) = 0 and ϕ ( t ) R n | S | , we see that Equation (3) holds if and only if this condition holds:
q ( t ) = 0 A i ( t ) = 0 A T ϕ 2 ( t ) = u ( t ) .
a j l = 1 e l C j with orientations that coincide , 1 e l C j with orientations that do not coincide , 0 otherwise .
On this basis, one can define a DS
D K ( G ) : = ( j , i , ϕ , u ) R n | S | × R m × R n | S | × R m I A 0 0 j i + I A 0 0 ϕ u = 0 ,
with dynamics
d d t ψ ( t ) , i ( t ) , ι ( t ) , u ( t ) D K ( G ) ,
and an LS
L K ( G ) : = 0 × R n m + k ,
with dynamics
ψ ( t ) , ι ( t ) L K ( G ) .
Together, they form a pH system defined by the set ( D K ( G ) , L K ( G ) , 0 ) .

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].

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.

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 X b R 4 is given by:
X b : = p m , ϕ m , P b , Q b ,
where p m R 1 and ϕ m R 1 are the angular momentum and magnetic flux of the DC motor, respectively, while P b R 1 and Q b R 1 are the pressure and flow rate of the blower, respectively.
The total energy of the blower is given by the Hamiltonian:
H b X b = 1 2 p m 2 I m + ϕ m 2 L m + C b P b 2 + I b Q b 2 ,
where I m R + 1 is the inertia and L m R + 1 is the inductance of the DC motor, while C b R + 1 and I b R + 1 are the hydraulic capacitance and inertance of the air in the blower, respectively.
Thus, the Port–Hamiltonian model of a blower is given by
X ˙ b = J b R b H b X b + G b u b ,
Y b = G b * H b X b ,
where
J b : = 0 K m 0 ( K o p m ) / I m K m 0 0 0 0 0 0 1 / ( C b I b ) ( K o p m ) / I m 0 1 / ( C b I b ) 0 R 4 × 4 , R b : = diag b m R m 0 ( R b p m ) / ( I b I m ) R 4 × 4 , H b X b : = p m / I m ϕ m / L m C b P b I b Q b R 4 × 1 , G b : = 1 0 0 0 0 0 0 ( 1 / C b ) 0 0 0 ( 1 / I b ) R 4 × 3 , u b : = V m Q i n P i n R 3 × 1 ,
where K m R + 1 is the motor torque constant, b m R + 1 is the viscous damping, R m R + 1 is the armature resistance, and K o R + 1 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 V R 1 , Q i n R 1 and P i n R 1 , respectively. One can easily show that J m = J m and R m = R m 0 .
Taking the time derivative of the Hamiltonian gives
H ˙ b [ χ b ] = u b · Y b H b [ X b ] · ( R b H b [ X b ] ) .
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 μ c R + 1 and l c R + 1 , respectively. The equivalent length of the solenoid’s magnetic circuit l e q · : R R is dependent on the displacement of the spool q s R and can be written as:
l e q q s = l c + μ c μ 0 ( q s tot q s ) ,
where μ 0 R + 1 is the permeability of air, and q s tot R + 1 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 L s · : R R given by:
L s q s = N 2 A e μ c l e q q s ,
where N R + 1 is the number of turns in the coil of the solenoid, and A e R + 1 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.
The total energy of the solenoid is given by the Hamiltonian H s · : R 3 R , which is a function of the state vector X s = ϕ s , p s , q s R 3 and is expressed as the sum of the magnetic, kinetic and potential energies, which are denoted by H magnetic ϕ s , q s : R 2 R , H kinetic p s : R R and H potential q s : R R , respectively. Thus,
H s X s = H magnetic ϕ s , q s + H kinetic p s + H potential q s ,
given a magnetic flux ϕ s R .
Assuming that the pretension of the spring is set to q 0 R , the Hamiltonian is
H s X s = 1 2 ϕ s 2 L [ q s ] + p s 2 m s + k s ( q s + q s 0 ) 2 + m s q s g ,
where p s R is the momentum of the spool, m s R + 1 is the mass of the spool, k s R + 1 is the spring stiffness, and g R + 1 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:
X ˙ s = J s R s H s X s + G s u s ,
Y s = G s * u s ,
where
J s = 0 0 0 0 0 1 0 1 0 , R s = R s 0 0 0 b s 0 0 0 0 , G s = 1 0 0 0 0 0 ( A s 1 A s 2 ) ( A s 3 A s 4 ) , G s * = G s , u s = V s p s and H s X s = ϕ s A e N 2 μ c l c μ c ( q s q s tot ) μ 0 p s m s A e N 2 μ c 2 μ 0 μ 0 l c μ c ( q s q s tot ) 2 + k s ( q s + q s 0 ) + m s g ,
where R s R + 1 is the resistance of the coil, b s R + 1 is the viscous damping acting on the spool, and ∇ is the gradient operator. A s 1 , A s 2 R + 1 are the various cross-sectional areas of the surfaces of the spool, and the input vector u s R 2 consists of the input voltage V s R 1 and the supply pressure p s R 1 . It can be seen that J s = J s R 3 × 3 possesses skew symmetry, while R s = R s R 3 × 3 is positive semi-definite.
Taking the time derivative of the Hamiltonian gives:
H ˙ s [ χ s ] = u s · Y s H s [ X s ] · ( R s H s [ X s ] ) .
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 t s t < t f with start time t s and finish time t f , the length-normalized one-dimensional Euler equations for gas with a density ρ ( t , z ) : ( t s , t f ] × ( 0 , ) R 1 flowing at a velocity ν ( t , z ) : ( t s , t f ] × ( 0 , ) R 1 through a pipe of length R + 1 and cross-sectional area A p R + 1 are given by:
t ( ρ A p ) + z ( ρ A p ν ) = 0 ,
t ( ρ A p ν ) + z ( ρ A p ν 2 + p A p ) = 0 ,
where p ( t , z ) : ( t s , t f ] × ( 0 , ) R 1 is the pressure, and i : = / i is the partial derivative with respect to the temporal and spatial variables given by the subscripts i t , z .

Port–Hamiltonian Formulation of Pipe-Flow Model

The fluid dynamics can be written in terms of mass per unit length, i.e., ϱ : = ρ A p , as well as the fluid momentum, m : = ϱ ν . Thus, Equations (16) and (17) can be expressed as
t ϱ = z m ,
t m = z m 2 ϱ + p A p ,
Defining the state vector of the gas flow through a pipe segment as χ p : = ϱ m , the energy of the gas can be expressed in the form of a Hamiltonian H p χ p : R 2 R 1 given by
H p χ p = 0 H p χ p d x = 0 m 2 2 ϱ + ϱ U ϱ / A p d x ,
where H p · : R 2 R 1 is the Hamiltonian density, and U · : R 1 R 1 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:
t χ p = J χ p δ χ p H p χ p ,
where J χ p , which is the formally skew-symmetric operator, and δ χ p H χ p , which is the variational derivative of the Hamiltonian density, are expressed as
J χ p = 0 z z 0 and δ χ p H p χ p = h m 2 2 ϱ 2 m ϱ ,
where h is the enthalpy, and J χ p is a formally skew-symmetric operator.
The rate of change of the Hamiltonian can be found as
H ˙ p = u p y p ,
where
u p = W B R ext δ χ p H p 0 δ χ p H p and y p = W C R ext δ χ p H p 0 δ χ p H p ,
with components given by
W B = 1 2 1 0 0 1 0 1 1 0 , W C = 1 2 0 1 1 0 1 0 0 1 , R ext = 1 2 0 1 0 1 1 0 1 0 1 0 1 0 0 1 0 1 ,
and
δ χ p H p 0 δ χ p H p = h m 2 2 ϱ 2 0 m ϱ 0 h m 2 2 ϱ 2 m ϱ .
Expanding u p and y p gives
u p = m ϱ h m 2 2 ϱ 2 0 and y p = h m 2 2 ϱ 2 m ϱ 0 .
Thus, the rate of change of the Hamiltonian is
H ˙ p = h m 2 2 ϱ 2 m ϱ m ϱ 0 h m 2 2 ϱ 2 0 .

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 n = | V | = 7 vertices.
The complete graph of the circuit, A 0 , is
A 0 = R M L R I T R T B R B A C T C B C A C L C C W u V   [ 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0     | 0 0 1 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 0 0 0 0 1 1 |   1 0 0 0 0 0 1 ] 1 2 3 4 5 6 7 .
The ventilator input voltage is represented as a source S = ( D S , L S , R S ) . The set of sources is S = v 7 , and the dimension of the source is | S | = 1 . The circuit also consists of m C = 5 capacitors (storage elements) that are represented as C i = ( D C i , L C i , R C i ) , where the i th index used to distinguish between the components is i = C L , C T , C B , C A , C CW . Furthermore there are m R = 4 resistors (dissipative elements) that are represented as R i = ( D R i , L R i , R R i ) , where the i th index is given by i = R ML , R IT , R TB , R BA .
Selecting node 7 as the ground, the reduced incidence matrix, A , is given by
A = [ A R A C A S ] = ( 1 1 0 0 0 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 0 1 1 0 | 0 0 1 0 0 1 0 0 0 1 0 1 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 1 | 1 0 0 0 0 0 ) A R A C A S ,
where the dimensions of the components of A are dim ( A R ) = ( n | S | ) × m R = 6 × 4 , dim ( A C ) = ( n | S | ) × m C = 6 × 5 and dim ( A S ) = ( n | S | ) × m S = 6 × 1 .
The total energy of the circuit is given by the Hamiltonian
H C = i H C i ( q C i ) = 1 2 i q C i C i ,
where q C i R 1 is the charge of the i th capacitor for i = C L , C T , C B , C A , C CW . Thus,
I A C A R A S O O O O O O O O O O O O d d t q d d t q C i R i S + O O O O A R O I O A C I O O A S O O I ϕ u C u R u S = O ,
where I and O are appropriately sized identity and zero matrices, respectively, q = 0 , and ϕ is the node potential. Expanding Equation (30) gives
A C d d t q C + A R ( A R ϕ ) + A S i S = 0 ,
A C ϕ + u C = 0 ,
A S ϕ + u S = 0 .
The Dirac structure is given by the set with the following attributes for D , L , R :
d d t q , d d t q C , i R , i S , ϕ , u C , u R , u S D ,
q , q C , ϕ , u C L ,
i R , e R R .

5. Model Network Topology

Definition 11.
(Directed graph) [27]: A directed graph G denotes the pair ( V , A ) , where V ( D ) and A ( D ) 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 v O , V I and V E , respectively. Similarly, the patient, inspiratory and expiratory arcs are given by a O , A I and A E , 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
V ( D ) = v O V I V E = v O ( V I b V I v V I p V I e ) ( V E b V E v V E p V E e )
and
A ( D ) = a O A I A E = a O ( A I b A I v A I p A I e ) ( A E b A E v A E p A E e ) ,
respectively, where the subscripts i O , p , b , v , p , e 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 A O 21 A O , while the vertices are denoted by V O 1 , V O 2 V O . The elements of the inspiratory and expiratory arcs and vertices, given by V I , V E and A I O , A O E , respectively. A more detailed representation of the graph of the mechanical ventilator in Figure 8 is given in Figure 9.
Figure 9 shows a detailed graph of the mechanical ventilator given in Figure 2 that indicates the patient vertex V O and the arcs and vertices along the inspiratory path, given by
A I : = A I V 12 , A I V 23 , A I V 3 B , A I V 23 , A I B V 4 , A I V 4 S 1 , A I B V 5 , A I V 5 S 2
and
V I : = V I V 1 , V I V 2 , V I V 3 , V I B , V I V 4 , V I S 1 , V I V 5 , V I S 2 ,
respectively, as well as the arcs and vertices along the expiratory path, given by
A E : = A O E V 1 , A E V 12 , A E V 23 and V E : = V E V 1 , V E V 2 , V E V 3 ,
respectively.

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, P b and Q b , respectively, are equal to the pressure and flow rate at the inlet of the pipe, given by p ( 0 ) and m ( 0 ) , respectively. Thus,
    P b = p 0 and Q b = m ( 0 ) .
  • Pipe-to-valve interconnection: The pressure and flow rate of the fluid entering/exiting a valve, P v and Q v , respectively, are equal to the pressure and flow rate at the inlet/outlet of the pipe, given by p ( 0 ) and m ( 0 ) for the inlet and p ( ) and m ( ) for the outlet. Thus,
    P v = p ( 0 ) and Q v = m ( 0 ) at the inlet ,
    and
    P v = p ( ) and Q v = m ( ) at the outlet .
  • 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,
    p ( ) = v c in and m ( ) = i c in .
    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:
    v c o u t = p ( 0 ) and i c o u t = m ( 0 ) at the inlet .
    The Hamiltonian of the complete system is given by the sum of the Hamiltonian’s of the individual systems:
    H = H b + H s + H p + H C .
    The rate of change of the energy of the complete system is
    H ˙ = P ˙ b ( z p ( 0 ) + F p ) + Q ˙ b ( z m ( 0 ) + M p ) + P ˙ v i n ( z p ( 0 ) + F v i n ) + Q ˙ v i n ( z m ( 0 ) + M v i n ) + P ˙ v o u t ( z p ( ) + F v o u t ) + Q ˙ v o u t ( z m ( ) + M v o u t ) + P ˙ v o u t ( z p ( ) + F v o u t ) + Q ˙ v o u t ( z m ( ) + M v o u t ) + H ˙ b + H ˙ s + H ˙ c .
    The terms F p , M p , F v i n , M v i n , F v o u t and M v o u t 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, ϱ ϱ d = ϱ 1 , ϱ 2 , , ϱ n R n × 1 , and m m d = m 1 , m 2 , , m n R n × 1 . As such, state vector χ p can be replaced by a discrete approximation χ d = ϱ 1 , , ϱ n , m 1 , , m n R 2 n × 1 . The i th element of ϱ i , m i R 1 × 1 is located at z = Δ ( i 1 ) , Δ ( i 1 / 2 ) , where Δ is the fixed discrete step size between points, and i = 1 , 2 , , n . In addition, the efforts at the boundaries are given by δ χ 0 H 0 and δ χ n H n . Thus, the Hamiltonian given in Equation (20) can be approximated by a discrete approximation such that H p [ χ p ] Δ H d [ χ d ] so that the discrete system effort is now δ χ d ( H d ) . A finite difference approximation of the spatial derivatives at the i th point is
z ϱ ( t , z ) i 1 Δ ( ϱ ( t , z i + 0.5 ) ϱ ( t , z i 0.5 ) ) and z m ( t , z ) i 1 Δ ( m ( t , z i + 1 ) m ( t , z i ) ) .
The central difference approximation at the i th point is
t ϱ i m i = 1 Δ δ m H [ χ i ] δ ϱ H [ χ i + 1 ] δ m H [ χ i 1 ] δ ϱ H [ χ i ] .
In matrix form, this is
t ϱ d = 1 Δ 1 1 1 1 1 δ m H [ χ d ] + 1 Δ 1 0 0 δ m H [ χ d ]
and
t m d = 1 Δ 1 1 1 1 1 δ ϱ H [ χ d ] + 1 Δ 0 0 1 δ ϱ H [ χ 0 ] ,
which can be re-written as
t ϱ d = D δ m H [ χ d ] + G ϱ δ m H [ χ 0 ] and t m d = D δ ϱ H [ χ d ] + G m δ ϱ H [ χ n ] ,
where
D = 1 Δ 1 1 1 1 1 , G ϱ = 1 Δ 1 0 0 and G m = 1 Δ 0 0 1 .
The skew-symmetric operator is clear from Equation (43).
t ϱ d t m d = D D δ ϱ H [ χ d ] δ m H [ χ d ] + G m G ϱ δ ϱ H [ χ 0 ] δ m H [ χ n ] .

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.

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.

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

  1. 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]
  2. 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]
  3. Bates, J.H.T. Lung Mechanics: An Inverse Modeling Approach; Cambridge University Press: Cambridge, UK, 2009. [Google Scholar]
  4. Maury, B. The Respiratory System in Equations, 1st ed.; MS&A—Modeling, Simulation and Applications; Springer: Milan, Italy, 2013. [Google Scholar] [CrossRef]
  5. 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]
  6. Tawhai, M.H.; Bates, J.H.T. Multi-scale lung modeling. J. Appl. Physiol. 2011, 110, 1466–1472. [Google Scholar] [CrossRef]
  7. 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]
  8. 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]
  9. 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]
  10. 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]
  11. 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]
  12. 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]
  13. Al-Naggar, N. Modelling and Simulation of Pressure Controlled Mechanical Ventilation System. J. Biomed. Sci. Eng. 2015, 8, 707–716. [Google Scholar] [CrossRef]
  14. 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]
  15. 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]
  16. 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]
  17. 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]
  18. 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]
  19. Mehrmann, V.; Unger, B. Control of port-Hamiltonian differential-algebraic systems and applications. Acta Numer. 2023, 32, 395–515. [Google Scholar] [CrossRef]
  20. van der Schaft, A. Port-Hamiltonian Modeling for Control. Annu. Rev. Control Robot. Auton. Syst. 2020, 3, 393–416. [Google Scholar] [CrossRef]
  21. 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]
  22. 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]
  23. 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]
  24. 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]
  25. Kamiński, Z. A simplified lumped parameter model for pneumatic tubes. Math. Comput. Model. Dyn. Syst. 2017, 23, 523–535. [Google Scholar] [CrossRef]
  26. 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]
  27. Bondy, J.A.; Murty, U.S.R. Graph Theory with Applications; The Macmillan Press Ltd.: London, UK, 1976. [Google Scholar]
  28. 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]
Figure 1. Energy storage, routing and dissipation.
Figure 1. Energy storage, routing and dissipation.
Computation 12 00155 g001
Figure 2. Schematic diagram of a mechanical ventilator.
Figure 2. Schematic diagram of a mechanical ventilator.
Computation 12 00155 g002
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 3. Diagram of a solenoid valve in (i) the open position, which allows fluid flow, and (ii) the closed position, which stops fluid flow.
Computation 12 00155 g003
Figure 4. Solenoid coordinate system.
Figure 4. Solenoid coordinate system.
Computation 12 00155 g004
Figure 5. Pipe segment coordinate system.
Figure 5. Pipe segment coordinate system.
Computation 12 00155 g005
Figure 6. Circuit diagram of an electric model of a lung of a fully sedated patient [26].
Figure 6. Circuit diagram of an electric model of a lung of a fully sedated patient [26].
Computation 12 00155 g006
Figure 7. The graph associated with the circuit diagram given in Figure 6.
Figure 7. The graph associated with the circuit diagram given in Figure 6.
Computation 12 00155 g007
Figure 8. Simplified graph of the mechanical ventilator given in Figure 2 indicating the elements belonging to the patient, given by the arcs A O 21 A O and vertices V O 1 , V O 2 V O , as well as elements of the inspiratory and expiratory arcs and vertices, given by V I , V E and A I O , A O E , respectively.
Figure 8. Simplified graph of the mechanical ventilator given in Figure 2 indicating the elements belonging to the patient, given by the arcs A O 21 A O and vertices V O 1 , V O 2 V O , as well as elements of the inspiratory and expiratory arcs and vertices, given by V I , V E and A I O , A O E , respectively.
Computation 12 00155 g008
Figure 9. Detailed graph of the mechanical ventilator given in Figure 8 indicating the patient vertex V O as well as the arcs and vertices along the inspiratory and expiratory paths.
Figure 9. Detailed graph of the mechanical ventilator given in Figure 8 indicating the patient vertex V O as well as the arcs and vertices along the inspiratory and expiratory paths.
Computation 12 00155 g009
Figure 10. Staggered grid discretization of the one-dimensional Port–Hamiltonian pipe dynamic model.
Figure 10. Staggered grid discretization of the one-dimensional Port–Hamiltonian pipe dynamic model.
Computation 12 00155 g010
Figure 11. Graph of air pressure versus time.
Figure 11. Graph of air pressure versus time.
Computation 12 00155 g011
Figure 12. Graph of volume flow versus time.
Figure 12. Graph of volume flow versus time.
Computation 12 00155 g012
Table 1. Pipe model parameter values.
Table 1. Pipe model parameter values.
ParameterDescriptionValueUnits
A p Pipe cross-sectional area 3.8013 × 10 4 m2
D p Pipe diameter 2.2 × 10 3 m
Pipe length 1.5 × 10 1 m
Table 2. Solenoid model parameter values [28].
Table 2. Solenoid model parameter values [28].
ParameterDescriptionValueUnits
A e Effective cross-sectional area 8 × 10 5 m2
A s 1 Spool surface area 2.657 × 10 3 m2
A s 2 Spool surface area 3.525 × 10 3 m2
A s 3 Spool surface area 5.586 × 10 3 m2
A s 4 Spool surface area 5.586 × 10 3 m2
b s Viscous damping factor 2 × 10 1 Ns·m−1
gAcceleration due to gravity 9.81 m·s−2
k s Spring stiffness 1 × 10 4 N·m−1
l c Length of the part of the magnetic circuit inside the core 1.15 × 10 2 m
m s Mass of the spool 2.7 × 10 1 kg
NNumber of turns in the coil1250turns
q s tot Total air gap 3.3 × 10 4 m
q s 0 Pre-tension in the spring 1.1 × 10 3 m
R s Resistance of the coil13 Ω
μ 0 Permeability of air 4 π × 10 7 N·A−2
μ c Permeability of the magnetic core 4.8 π × 10 5 N·A−2
Table 3. Lung circuit model parameter values [26].
Table 3. Lung circuit model parameter values [26].
ParameterDescriptionValueUnits
R ML Resistance from the mouth to larynx 1.021 cmH2O·s·L−1
R LT Resistance from the larynx to trachea 3.369 × 10 1 cmH2O·s·L−1
R TB Resistance from the trachea to bronchi 3.063 × 10 1 cmH2O·s·L−1
R BA Resistance from the bronchi to alveoli 8.17 × 10 2 cmH2O·s·L−1
C l Compliance of the larynx 1.27 × 10 3 L/cmH2O
C T Compliance of the trachea 2.38 × 10 3 L/cmH2O
C B Compliance of the bronchi 1.31 × 10 2 L/cmH2O
C A Compliance of the alveoli 2 × 10 1 L/cmH2O
C CW Compliance of the chest wall 2.445 × 10 1 L/cmH2O
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.

Share and Cite

MDPI and ACS Style

Madahana, M.C.I.; Ekoru, J.E.D.; Nyandoro, O.T.C. A Novel Mixed Finite/Infinite Dimensional Port–Hamiltonian Model of a Mechanical Ventilator. Computation 2024, 12, 155. https://doi.org/10.3390/computation12080155

AMA Style

Madahana MCI, Ekoru JED, Nyandoro OTC. A Novel Mixed Finite/Infinite Dimensional Port–Hamiltonian Model of a Mechanical Ventilator. Computation. 2024; 12(8):155. https://doi.org/10.3390/computation12080155

Chicago/Turabian Style

Madahana, Milka C. I., John E. D. Ekoru, and Otis T. C. Nyandoro. 2024. "A Novel Mixed Finite/Infinite Dimensional Port–Hamiltonian Model of a Mechanical Ventilator" Computation 12, no. 8: 155. https://doi.org/10.3390/computation12080155

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop