<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.2 20190208//EN" "http://jats.nlm.nih.gov/publishing/1.2/JATS-journalpublishing1.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article" dtd-version="1.2" xml:lang="en">
    <front>
        <journal-meta>
            <journal-id journal-id-type="pmc">F1000Research</journal-id>
            <journal-title-group>
                <journal-title>F1000Research</journal-title>
            </journal-title-group>
            <issn pub-type="epub">2046-1402</issn>
            <publisher>
                <publisher-name>F1000 Research Limited</publisher-name>
                <publisher-loc>London, UK</publisher-loc>
            </publisher>
        </journal-meta>
        <article-meta>
            <article-id pub-id-type="doi">10.12688/f1000research.25873.1</article-id>
            <article-categories>
                <subj-group subj-group-type="heading">
                    <subject>Research Article</subject>
                </subj-group>
                <subj-group>
                    <subject>Articles</subject>
                </subj-group>
            </article-categories>
            <title-group>
                <article-title>A simulation of a medical ventilator with a realistic lungs model</article-title>
                <fn-group content-type="pub-status">
                    <fn>
                        <p>[version 1; peer review: 1 not approved]</p>
                    </fn>
                </fn-group>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Yeshurun</surname>
                        <given-names>Tamir</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Data Curation</role>
                    <role content-type="http://credit.niso.org/">Investigation</role>
                    <role content-type="http://credit.niso.org/">Software</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Original Draft Preparation</role>
                    <xref ref-type="aff" rid="a1">1</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Bar David</surname>
                        <given-names>Yoav</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Data Curation</role>
                    <role content-type="http://credit.niso.org/">Investigation</role>
                    <role content-type="http://credit.niso.org/">Software</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Original Draft Preparation</role>
                    <xref ref-type="aff" rid="a1">1</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Herman</surname>
                        <given-names>Alon</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Investigation</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Original Draft Preparation</role>
                    <xref ref-type="aff" rid="a1">1</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Bar-Sheshet</surname>
                        <given-names>Stav</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Investigation</role>
                    <xref ref-type="aff" rid="a1">1</xref>
                    <xref ref-type="aff" rid="a2">2</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Zilberman</surname>
                        <given-names>Ronen</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Investigation</role>
                    <xref ref-type="aff" rid="a2">2</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Bachar</surname>
                        <given-names>Gil</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Investigation</role>
                    <xref ref-type="aff" rid="a2">2</xref>
                </contrib>
                <contrib contrib-type="author" corresp="no">
                    <name>
                        <surname>Liberzon</surname>
                        <given-names>Alexander</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Methodology</role>
                    <role content-type="http://credit.niso.org/">Supervision</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Original Draft Preparation</role>
                    <uri content-type="orcid">https://orcid.org/0000-0002-6882-4191</uri>
                    <xref ref-type="aff" rid="a1">1</xref>
                </contrib>
                <contrib contrib-type="author" corresp="yes">
                    <name>
                        <surname>Segev</surname>
                        <given-names>Gideon</given-names>
                    </name>
                    <role content-type="http://credit.niso.org/">Conceptualization</role>
                    <role content-type="http://credit.niso.org/">Data Curation</role>
                    <role content-type="http://credit.niso.org/">Formal Analysis</role>
                    <role content-type="http://credit.niso.org/">Investigation</role>
                    <role content-type="http://credit.niso.org/">Methodology</role>
                    <role content-type="http://credit.niso.org/">Software</role>
                    <role content-type="http://credit.niso.org/">Supervision</role>
                    <role content-type="http://credit.niso.org/">Validation</role>
                    <role content-type="http://credit.niso.org/">Visualization</role>
                    <role content-type="http://credit.niso.org/">Writing &#x2013; Original Draft Preparation</role>
                    <uri content-type="orcid">https://orcid.org/0000-0002-6175-3458</uri>
                    <xref ref-type="corresp" rid="c1">a</xref>
                    <xref ref-type="aff" rid="a1">1</xref>
                </contrib>
                <aff id="a1">
                    <label>1</label>Faculty of Engineering, Tel Aviv University, Tel Aviv, Israel</aff>
                <aff id="a2">
                    <label>2</label>Manshema Team, Tel Aviv, Israel</aff>
            </contrib-group>
            <author-notes>
                <corresp id="c1">
                    <label>a</label>
                    <email xlink:href="mailto:gideons1@tauex.tau.ac.il">gideons1@tauex.tau.ac.il</email>
                </corresp>
                <fn fn-type="conflict">
                    <p>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>5</day>
                <month>11</month>
                <year>2020</year>
            </pub-date>
            <pub-date pub-type="collection">
                <year>2020</year>
            </pub-date>
            <volume>9</volume>
            <elocation-id>ISF-1302</elocation-id>
            <history>
                <date date-type="accepted">
                    <day>29</day>
                    <month>10</month>
                    <year>2020</year>
                </date>
            </history>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2020 Yeshurun T et al.</copyright-statement>
                <copyright-year>2020</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access article distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <self-uri content-type="pdf" xlink:href="https://f1000research.com/articles/9-1302/pdf"/>
            <abstract>
                <p>
                    <bold>Background:</bold> The outbreak of COVID-19 pandemic highlighted the necessity for accessible and affordable medical ventilators for healthcare providers. To meet this challenge, researchers and engineers world-wide have embarked on an effort to design simple medical ventilators that can be easily distributed. This study provides a simulation model of a simple one-sensor controlled, medical ventilator system including a realistic lungs model and the synchronization between a patient breathing and the ventilator. This model can assist in the design and optimization of these newly developed systems.</p>
                <p>
                    <bold>Methods:</bold> The model simulates the ventilator system suggested and built by the 
                    <ext-link ext-link-type="uri" xlink:href="https://manshema.com/">&#x201c;Manshema&#x201d; team</ext-link> which employs a positive-pressure controlled system, with air and oxygen inputs from a hospital external gas supply. The model was constructed using Simscape&#x2122; (MathWorks&#x00ae;) and guidelines for building an equivalent model in OpenModelica software are suggested. The model implements an autonomously breathing, realistic lung model, and was calibrated against the ventilator prototype, accurately simulating the ventilator operation.</p>
                <p>
                    <bold>Results:</bold> The model allows studying the expected gas flow and pressure in the patient&#x2019;s lungs, testing various control schemes and their synchronization with the patient&#x2019;s breathing. The model components, inputs, and outputs are described, an example for a simple, positive end expiratory pressure control mode is given, and the synchronization with healthy and ARDS patients is analyzed.</p>
                <p>
                    <bold>Conclusions:</bold> We provide a simulator of a medical ventilation including realistic, autonomously breathing lungs model.  The simulator allows testing different control schemes for the ventilator and its synchronization with a breathing patient. Implementation of this model may assist in efforts to develop simple and accessible medical ventilators to meet the global demand.</p>
            </abstract>
            <kwd-group kwd-group-type="author">
                <kwd>COVID-19</kwd>
                <kwd>Mechanical Ventilator</kwd>
                <kwd>Simulation</kwd>
            </kwd-group>
            <funding-group>
                <award-group id="fund-1" xlink:href="http://dx.doi.org/10.13039/501100005155">
                    <funding-source>Azrieli Foundation</funding-source>
                </award-group>
                <funding-statement>GS thanks the Azrieli Foundation for financial support within the Azrieli Fellows program.</funding-statement>
                <funding-statement>
                    <italic>The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.</italic>
                </funding-statement>
            </funding-group>
        </article-meta>
    </front>
    <body>
        <sec sec-type="intro">
            <title>Introduction</title>
            <p>One of the positive COVID-19 consequences is a great social gathering of creators, scientists and engineers to assist the worldwide pandemic effort, including the design of custom-made open source ventilators
                <sup>
                    <xref ref-type="bibr" rid="ref-1">1</xref>
                </sup>. The review of Pearce (2020) covers about 160 publications and links to websites that provide computer-assisted design (CAD) models, construction and installation instructions and bills of materials. It is probably not covering hundreds of other projects that are not published yet or could not pass the strict definitions of the open-source ventilator of the author. </p>
            <p>
                <ext-link ext-link-type="uri" xlink:href="https://manshema.com/">Manshema</ext-link> is an emergency ventilation machine and was created during the Assuta COVID-19 Hackathon Sprint by the group comprising engineers, medical doctors, and scientists. The Manshema Ventilator (MV) was designed to assist in the ventilation of patients who are capable of autonomous breathing yet require assistance to maintain a sufficient positive end expiratory pressure (PEEP) and blood oxygen saturation levels.</p>
            <p>One of the major drawbacks of the custom-made open-source ventilator designs is that these are created in a very short time and do not allow detailed analysis of their performance, quality assurance and thus regulatory approval. One of the key points is a lack of proper set of mathematical models that describe the performance of a specific ventilator due to a large variety of the parts, sensors and components used in its creation. This study is addressing this gap by creating a detailed mathematical model and a simulator of a realistic lung ventilation, carefully calibrated and tuned specifically to the MV design, parts and sensors. The simulation will provide the design team the opportunity to design the next version, to extend the ventilator capabilities and to assure its performance corresponding to the specific patient condition. Furthermore, the simulation provides a template for a large variety of open source designs, such as Ambu bag ventilators or linear actuator ventilators, and may eventually lead to a closed loop, feedback-back control at the level of commercial regulatory approved mechanical ventilators.</p>
        </sec>
        <sec sec-type="methods | materials">
            <title>Methods and materials</title>
            <sec>
                <title>General description</title>
                <p>The MV consists of an input branch which mixes air and oxygen from the hospital reservoirs and feeds it into the patient mask, and an expiratory output branch which is opened or closed by the control system.  
                    <xref ref-type="fig" rid="f1">Figure 1a</xref> shows a schematic illustration of the MV. The input compressed air and oxygen are supplied by the hospital central reservoirs. The flow from each of the reservoirs is controlled with a flow control valve. After the flow control valves, the gases flow through two similar pipes, mix and flow through the main pipe and mask pipe towards the breathing mask. A pressure relief valve marked Popoff is located between the Main pipe and the Mask pipe. This pressure relief is set to mechanically control the maximal pressure in the system and avoid over-pressuring the lungs. The expiratory air flows through a directional check valve which does not permit breathing the exhaled gasses. After the check valve, the outlet pipe leads to the expiratory flow control system which opens and closes the expiratory pipe flow path using an ON/OFF solenoid valve. The outlet of the control system is connected to a pressure relief valve that is set according to the required PEEP valve. 
                    <xref ref-type="fig" rid="f1">Figure 1b</xref> shows a CAD drawing of the complete MV system, and 
                    <xref ref-type="fig" rid="f1">Figure 1c</xref> shows a CAD drawing of the main components of the MV. 
                    <xref ref-type="fig" rid="f1">Figure 1d</xref> is a photograph of the main components of the MV prototype.</p>
                <fig fig-type="figure" id="f1" orientation="portrait" position="float">
                    <label>Figure 1. </label>
                    <caption>
                        <title>The Manshema ventilator.</title>
                        <p>(
                            <bold>a</bold>) A schematic description of the Manshema ventilator. The pressure measurements and control system are not shown. (
                            <bold>b</bold>) A CAD drawing of the full MV, (
                            <bold>c</bold>) a CAD drawing of the MV main components, (
                            <bold>d</bold>) a photograph of the main components of the MV prototype. PEEP, positive end expiratory pressure; CAD, computer-assisted design; MV, Manshema ventilator.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/28553/cafce502-20d4-4835-9f7a-b29fcfaea9f2_figure1.gif"/>
                </fig>
            </sec>
            <sec>
                <title>Control strategy</title>
                <p>In order to reduce the system costs to minimum, the MV operates with a single pressure sensor and a solenoid valve which controls the gas flow out of the system. The minimum and maximum pressure in the system are controlled with a hysteresis control scheme. This control strategy is realized with a pressure sensor located near the inlet to the solenoid valve and a relay which sets the state of the solenoid valve according to the measured pressure. In its initial state, the solenoid valve is closed directing the input air to the patient allowing the pressure to build up. When the patient exhales, the pressure at the expiratory pipe increases rapidly and after it reaches the expiratory positive airway pressure (EPAP), the relay opens the solenoid valve, the exhaled air is removed, and the pressure starts to drop. Once the patient starts to inhale, air is removed from the pipes and the pressure drops. When the pressure reaches the inspiratory positive airway pressure (IPAP) the solenoid valve closes, and the breathing cycle continues.</p>
            </sec>
            <sec>
                <title>The Manshema ventilator model</title>
                <p>The MV model was built with MathWorks&#x00ae; Simulink&#x00ae; Simscape&#x2122; Gas system toolbox. The outline for the model followed the MathWorks&#x00ae; 
                    <ext-link ext-link-type="uri" xlink:href="https://www.mathworks.com/help/physmod/simscape/ug/medical-ventilator-with-lung-model.html">&#x201c;Medical Ventilator with Lung Model&#x201d; example</ext-link> and was modified to describe the MV design, control system as well as an autonomously breathing patient. The model source files, along with an elaborated description of model parameters, variables,  Simulink&#x00ae; block parameters and their values can be found under the data availability section as well as in the model OSF webpage
                    <sup>
                        <xref ref-type="bibr" rid="ref-2">2</xref>
                    </sup>.</p>
                <p>
                    <xref ref-type="fig" rid="f2">Figure 2</xref> shows the block diagram of the model and 
                    <xref ref-type="fig" rid="f3">Figure 3</xref> shows a block diagram of the control system. The lungs are modeled as a translational mechanical converter that is coupled to a spring, a damper, and a force source. The spring and damper model the mechanical compliance and resistance of the lungs
                    <sup>
                        <xref ref-type="bibr" rid="ref-3">3</xref>
                    </sup> and force source models the muscle induced pressure
                    <sup>
                        <xref ref-type="bibr" rid="ref-4">4</xref>
                    </sup> which is a result of the patient autonomous breathing (patients that cannot breath autonomously can be modeled by replacing the variable muscle pressure term with a constant pressure). The pressure induced by the muscles contraction and relaxation, 
                    <italic toggle="yes">P
                        <sub>mus</sub>
                    </italic>, is realized with exponential functions as described by Fresnel 
                    <italic toggle="yes">et al</italic>.
                    <sup>
                        <xref ref-type="bibr" rid="ref-4">4</xref>
                    </sup>:</p>
                <disp-formula id="e1">
                    <mml:math display="block" id="math">
                        <mml:mrow>
                            <mml:msub>
                                <mml:mi>P</mml:mi>
                                <mml:mrow>
                                    <mml:mi>m</mml:mi>
                                    <mml:mi>u</mml:mi>
                                    <mml:mi>s</mml:mi>
                                </mml:mrow>
                            </mml:msub>
                            <mml:mo>=</mml:mo>
                            <mml:mrow>
                                <mml:mo>{</mml:mo>
                                <mml:mrow>
                                    <mml:mtable>
                                        <mml:mtr>
                                            <mml:mtd>
                                                <mml:mrow>
                                                    <mml:mo>&#x2212;</mml:mo>
                                                    <mml:msub>
                                                        <mml:mi>P</mml:mi>
                                                        <mml:mrow>
                                                            <mml:mi>m</mml:mi>
                                                            <mml:mi>a</mml:mi>
                                                            <mml:mi>x</mml:mi>
                                                        </mml:mrow>
                                                    </mml:msub>
                                                    <mml:mo stretchy="false">(</mml:mo>
                                                    <mml:mn>1</mml:mn>
                                                    <mml:mo>&#x2212;</mml:mo>
                                                    <mml:msup>
                                                        <mml:mi>e</mml:mi>
                                                        <mml:mrow>
                                                            <mml:mo>&#x2212;</mml:mo>
                                                            <mml:mi>t</mml:mi>
                                                            <mml:mo>/</mml:mo>
                                                            <mml:msub>
                                                                <mml:mi>&#x03c4;</mml:mi>
                                                                <mml:mi>c</mml:mi>
                                                            </mml:msub>
                                                        </mml:mrow>
                                                    </mml:msup>
                                                    <mml:mo stretchy="false">)</mml:mo>
                                                </mml:mrow>
                                            </mml:mtd>
                                            <mml:mtd>
                                                <mml:mrow>
                                                    <mml:mn>0</mml:mn>
                                                    <mml:mo>&#x2264;</mml:mo>
                                                    <mml:mi>t</mml:mi>
                                                    <mml:mo>&#x2264;</mml:mo>
                                                    <mml:msub>
                                                        <mml:mi>T</mml:mi>
                                                        <mml:mn>1</mml:mn>
                                                    </mml:msub>
                                                </mml:mrow>
                                            </mml:mtd>
                                        </mml:mtr>
                                        <mml:mtr>
                                            <mml:mtd>
                                                <mml:mrow>
                                                    <mml:mo>&#x2212;</mml:mo>
                                                    <mml:msub>
                                                        <mml:mi>P</mml:mi>
                                                        <mml:mrow>
                                                            <mml:mi>m</mml:mi>
                                                            <mml:mi>a</mml:mi>
                                                            <mml:mi>x</mml:mi>
                                                        </mml:mrow>
                                                    </mml:msub>
                                                    <mml:msup>
                                                        <mml:mi>e</mml:mi>
                                                        <mml:mrow>
                                                            <mml:mo>&#x2212;</mml:mo>
                                                            <mml:mi>t</mml:mi>
                                                            <mml:mo>/</mml:mo>
                                                            <mml:msub>
                                                                <mml:mi>&#x03c4;</mml:mi>
                                                                <mml:mi>r</mml:mi>
                                                            </mml:msub>
                                                        </mml:mrow>
                                                    </mml:msup>
                                                </mml:mrow>
                                            </mml:mtd>
                                            <mml:mtd>
                                                <mml:mrow>
                                                    <mml:msub>
                                                        <mml:mi>T</mml:mi>
                                                        <mml:mn>1</mml:mn>
                                                    </mml:msub>
                                                    <mml:mo>&#x2264;</mml:mo>
                                                    <mml:mi>t</mml:mi>
                                                    <mml:mo>&#x2264;</mml:mo>
                                                    <mml:msub>
                                                        <mml:mi>T</mml:mi>
                                                        <mml:mrow>
                                                            <mml:mi>t</mml:mi>
                                                            <mml:mi>o</mml:mi>
                                                            <mml:mi>t</mml:mi>
                                                        </mml:mrow>
                                                    </mml:msub>
                                                </mml:mrow>
                                            </mml:mtd>
                                        </mml:mtr>
                                    </mml:mtable>
                                    <mml:mspace width="8em"/>
                                    <mml:mo stretchy="false">(</mml:mo>
                                    <mml:mn>1</mml:mn>
                                    <mml:mo stretchy="false">)</mml:mo>
                                </mml:mrow>
                            </mml:mrow>
                        </mml:mrow>
                    </mml:math>
                </disp-formula>
                <p>Where 
                    <italic toggle="yes">T</italic>
                    <sub>1</sub> is the time period for muscles contraction in every breathing cycle and 
                    <italic toggle="yes">T
                        <sub>tot</sub>
                    </italic> is the breathing cycle length. 
                    <italic toggle="yes">&#x03c4;
                        <sub>c</sub>
                    </italic> and 
                    <italic toggle="yes">&#x03c4;
                        <sub>r</sub>
                    </italic> are the contraction and relaxation time constants, respectively, and 
                    <italic toggle="yes">P
                        <sub>max</sub>
                    </italic> is the maximum pressure that can be induced by the muscles. All the parameters in 
                    <xref ref-type="other" rid="e1">Equation (1)</xref> can be easily derived from the mouth occlusion pressure, 
                    <italic toggle="yes">P</italic>
                    <sub>0.1</sub> and the breathing frequency, 
                    <italic toggle="yes">f
                        <sub>v</sub>
                    </italic> as described in 
                    <xref ref-type="bibr" rid="ref-4">4</xref>. A block diagram of the lungs branch is shown in 
                    <xref ref-type="fig" rid="f4">Figure 4</xref>.</p>
                <fig fig-type="figure" id="f2" orientation="portrait" position="float">
                    <label>Figure 2. </label>
                    <caption>
                        <title>The Manshema Simulink&#x00ae; model.</title>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/28553/cafce502-20d4-4835-9f7a-b29fcfaea9f2_figure2.gif"/>
                </fig>
                <fig fig-type="figure" id="f3" orientation="portrait" position="float">
                    <label>Figure 3. </label>
                    <caption>
                        <title>The Simulink&#x00ae; block diagram of the control system.</title>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/28553/cafce502-20d4-4835-9f7a-b29fcfaea9f2_figure3.gif"/>
                </fig>
                <fig fig-type="figure" id="f4" orientation="portrait" position="float">
                    <label>Figure 4. </label>
                    <caption>
                        <title>The lungs branch block diagram.</title>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/28553/cafce502-20d4-4835-9f7a-b29fcfaea9f2_figure4.gif"/>
                </fig>
                <p>
                    <bold>
                        <italic toggle="yes">Model calibration.</italic>
                    </bold> The model was calibrated against the MV prototype in two steps. First, the parameters of the PEEP and Popoff pressure relief valves were calibrated by comparing the model output to the measured output when the lungs port was blocked. In this set of experiments, the pressure at the inlet to the solenoid control valve was measured as a function of the total input gas flow rate when the solenoid valve was open and when it was closed. The experiment was repeated for PEEP values of 2, 5 and 10 cmH
                    <sub>2</sub>O. For each of the pressure relief valves in the model the set pressure differential and the maximum valve open area were tuned to provide the best fit to the measured data. 
                    <xref ref-type="fig" rid="f5">Figure 5</xref> shows the modeled and measured pressure as a function of the input gas flow rate and PEEP values of 2, 5 and 10 cmH
                    <sub>2</sub>O.</p>
                <fig fig-type="figure" id="f5" orientation="portrait" position="float">
                    <label>Figure 5. </label>
                    <caption>
                        <title>PEEP and Popoff model calibration experiment.</title>
                        <p>The modeled and measured pressure as a function of the input gas flow rate and PEEP values of 2, 5 and 10 cmH
                            <sub>2</sub>O. PEEP, positive end expiratory pressure.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/28553/cafce502-20d4-4835-9f7a-b29fcfaea9f2_figure5.gif"/>
                </fig>
                <p>Next, the model calibration was tested by comparing model results to the output of the MV prototype when it was connected to an IMTMedical Easylung test lung. In order to minimize the effects of the popoff and PEEP valves, the total input gas flow rate was set to 10 L/min and the PEEP was set to 2 cmH
                    <sub>2</sub>O. To probe the transient response of the MV, the solenoid valve was opened and closed in intervals of 3.5 seconds. Under these conditions, pressure drops across the different parts of the system are low, the Popoff valve remains closed throughout the experiment and the pressure in the system is determined mostly by the mechanical lung parameters. This provides optimal conditions for calibrating the mechanical lungs&#x2019; compliance and resistance in the model. 
                    <xref ref-type="fig" rid="f6">Figure 6</xref> shows the measured and modeled pressure (a) and gas flow (b). The gray regions in the figure are time periods in which the solenoid valve is closed. The fitted spring and damper constants for the lungs model are 148.5 N/m and 40 N/(m/s), respectively. When the solenoid valve is closed, air is directed into the test lung, increasing the pressure in it. Then, when the solenoid valve is reopened, the air in the test lung along with air from the reservoirs flow out of the system through the PEEP pressure relief valve. The MV model was able to capture the measured transient response of the system well. Particularly, the modeled gas flow follows the measured values closely.</p>
                <fig fig-type="figure" id="f6" orientation="portrait" position="float">
                    <label>Figure 6. </label>
                    <caption>
                        <p>The measured and modeled pressure (
                            <bold>a</bold>) and gas flow (
                            <bold>b</bold>) in a mechanical lung experiment. The PEEP was set to 2cmH
                            <sub>2</sub>O and the total input gas flow was set to 10 L/min. The regions with the gray background are time periods in which the solenoid valve was closed. The fitted spring and damper constants for the lungs model are 148.5 N/m and 40 N/(m/s), respectively. PEEP, positive end expiratory pressure.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/28553/cafce502-20d4-4835-9f7a-b29fcfaea9f2_figure6.gif"/>
                </fig>
                <p>Once the lungs parameters were found, the model predictions were compared to experimental measurements at input flow rates of 20L/min and 30 L/min and a PEEP of 5 cmH
                    <sub>2</sub>O, which better represent the operating conditions of the MV. 
                    <xref ref-type="fig" rid="f7">Figure 7</xref> shows the modeled and measured pressure and flow rates with input gas flow rates of 20 L/min (
                    <xref ref-type="fig" rid="f7">Figure 7 a and b</xref>) and 30 L/min (
                    <xref ref-type="fig" rid="f7">Figure 7 c and d</xref>). The regions with the gray background in 
                    <xref ref-type="fig" rid="f7">Figure 7</xref> are the time periods in which the solenoid valve was closed. Unlike the lung calibration experiments in which the Popoff valve remains constantly closed, at a flow rate of 20 L/min the Popoff valve opens when the pressure rises above 13 cmH
                    <sub>2</sub>O and closes back when it drops below 8 cmH
                    <sub>2</sub>O. This transition, which is not instantaneous, is not captured well in the simulation, resulting in a deviation between the measured and modeled responses. Nevertheless, the simulation was able to predict fairly well the minimum and maximum pressure in the system, which are most important for its safe operation. In a similar manner, there is a deviation between the measured and modeled flow in the system when the input gas flow rate.  The overestimation of the calculated air flow under higher input flow rates may be a result of leakages in the system that are not considered in the model.</p>
                <fig fig-type="figure" id="f7" orientation="portrait" position="float">
                    <label>Figure 7. </label>
                    <caption>
                        <p>The measured and modeled pressure (
                            <bold>a,c</bold>) and gas flow (
                            <bold>b,d</bold>) in a mechanical lung experiment. The PEEP was set to 5cmH
                            <sub>2</sub>O and the total input gas flow was set to 20 L/min (
                            <bold>a,b</bold>) and 30 L/min (
                            <bold>c,d</bold>). PEEP, positive end expiratory pressure.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/28553/cafce502-20d4-4835-9f7a-b29fcfaea9f2_figure7.gif"/>
                </fig>
                <p>
                    <bold>
                        <italic toggle="yes">Open source implementation.</italic>
                    </bold> The model can be implemented using similar or equivalent components in the open source OpenModelica software utilizing Modelica.Fluid and Modelica.OpenHydraulics libraries. In 
                    <xref ref-type="table" rid="T1">Table 1</xref>, we detail equivalent or most similar components, together with component names that could be used in construction of an equivalent model.</p>
                <table-wrap id="T1" orientation="portrait" position="anchor">
                    <label>Table 1. </label>
                    <caption>
                        <title>Manshema Simulink
                            <sup>&#x00ae;</sup> Equivalent OpenModelica Components.</title>
                    </caption>
                    <table content-type="article-table" frame="hsides">
                        <thead>
                            <tr>
                                <th align="left" colspan="1" rowspan="1" valign="top">Simulink&#x00ae; Component</th>
                                <th align="left" colspan="1" rowspan="1" valign="top">Model Component Name</th>
                                <th align="left" colspan="1" rowspan="1" valign="top">Modelica Component equivalent</th>
                                <th align="left" colspan="1" rowspan="1" valign="top">Notes</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Solver Configuration</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Solver Configuration3 </td>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Reservoir (G)</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Hospital Air / O2 / Exit Reservoir (G)</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Modelica.Fluid.Sources.FixedBoundary</td>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Gas Properties (G)</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Gas properties (G)</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Modelica.Fluid.System and Modelica.Fluid.Media</td>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Local Restriction (G)</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Local Restriction Air / O2 (G)</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Modelica.Fluid.Valves.ValveCompressible</td>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Pipe (G)</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Air / O2 / Main / Mask / Trachea /
                                    <break/>Expiratory pipes (G) </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Modelica.Fluid.Pipes.StaticPipe</td>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                                <td align="left" colspan="1" rowspan="1" valign="top">Two pipes to one connection</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Modelica.Fluid.Fittings.TeeJunctionIdeal</td>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Pressure Relief Valve (G)</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Pressure Relief Valve POPOFF /
                                    <break/>PEEP (G)  </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">OpenHydraulics.Components.Valves.ReliefValve</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">OpenHydraulics Library</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Convective Heat Transfer</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Room Heat Transfer1 to 7</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Modelica.Thermal.HeatTransfer.Components.Convection</td>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Temperature Source</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Room / Body Temperature   </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Modelica.Thermal.HeatTransfer.Sources.FixedTemperature</td>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Constant Volume Chamber (G)</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Mask (G)  </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Modelica.Fluid.Vessels.ClosedVolume</td>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Translational Mechanical</bold>
                                    <break/>
                                    <bold>Converter (G)</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Lungs (G)  </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Modelica.Fluid.Machines.SweptVolume</td>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Translational Spring</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Translational Spring  </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Modelica.Mechanics.Translational.Components.SpringDamper</td>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Translational Damper</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Resistance  </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">SpringDamper Component Combined</td>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Ideal Force Source</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Muscle Pressure</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Modelica.Mechanics.Translational.Sources.Force</td>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Mechanical Translational</bold>
                                    <break/>
                                    <bold>Reference</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Mechanical Translational Reference</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Modelica.Mechanics.Translational.Components.Fixed</td>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Check Valve (G)</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Check Valve (G)  </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">OpenHydraulics.Components.Valves.CheckValve</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">OpenHydraulics Library </td>
                            </tr>
                            <tr>
                                <td align="center" colspan="4" rowspan="1" valign="top">
                                    <bold>
                                        <italic toggle="yes">&#x201c;Breathing Patient &#x2013; Muscle Pressure&#x201d; Subsystem</italic>
                                    </bold>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Pulse Generator</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Pulse Generator</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Modelica.Blocks.Sources.Pulse</td>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Varying Transfer Function</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Varying Transfer Function</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Modelica.Blocks.Continuous.TransferFunction</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Not an instantaneous
                                    <break/>transfer function</td>
                            </tr>
                            <tr>
                                <td align="center" colspan="4" rowspan="1" valign="top">
                                    <bold>
                                        <italic toggle="yes">&#x201c;Expiratory Flow Control System&#x201d; Subsystem</italic>
                                    </bold>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Variable Time/Transport Delay</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Controller time delay</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Modelica.Blocks.Nonlinear.VariableDelay</td>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Relay</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Relay</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Modelica.Blocks.Logical.Hysteresis and Modelica.Blocks.Logical.Switch</td>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" valign="top">
                                    <bold>Local Restriction (G)</bold>
                                </td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Expiratory Valve (G)</td>
                                <td align="left" colspan="1" rowspan="1" valign="top">Modelica.Fluid.Valves.ValveCompressible</td>
                                <td align="left" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                        </tbody>
                    </table>
                </table-wrap>
            </sec>
        </sec>
        <sec sec-type="results">
            <title>Results</title>
            <sec>
                <title>Simulated ventilation of autonomously breathing patients</title>
                <p>After the model is calibrated and tested, we turn to simulate the ventilation of autonomously breathing patients. We start by simulating the ventilation of a healthy person which is embodied by a breathing rate of 15 breaths per minute
                    <sup>
                        <xref ref-type="bibr" rid="ref-5">5</xref>
                    </sup>, and an occlusion pressure of 4 cmH
                    <sub>2</sub>O
                    <sup>
                        <xref ref-type="bibr" rid="ref-4">4</xref>
                    </sup>. The simulated lungs spring and damper constants are as in 
                    <xref ref-type="fig" rid="f6">Figure 6</xref>. 
                    <xref ref-type="fig" rid="f8">Figure 8 a, b and c</xref> show the simulated pressure, flow and tidal volume, respectively. Positive flow denotes gas flow out of the system, for example when air is inhaled into the lungs. The gas flow is negative when gas flows into the MV, for example when the patient is exhaling. The pink regions in the figure are the periods in which the patient is trying to inhale and the solenoid valve is closed, the light blue regions are the periods in which the solenoid valve is open and the patient is trying to exhale, the purple regions are periods where the patient is attempting to inhale while the solenoid valve is open and white areas are periods in which the patient is attempting to exhale while the solenoid valve is closed. The color coding for the patient breathing state and the state of the solenoid valve is summarized in 
                    <xref ref-type="table" rid="T2">Table 2</xref>. As the patient begins to inhale (purple region), the lungs expand, air flows into the lungs, and the pressure in the expiratory pipe drops. Once the pressure reaches the IPAP, the solenoid valve closes (pink region) and the input gas is inhaled by the patient, resulting in a nearly constant gas flow at a rate that is determined by the flow regulating valves at the inputs to the system. The pressure in the lungs decreases at the beginning of this stage as the lungs are still expanding and then it increases slowly as the lungs fill with air. When the patient attempts to exhale the pressure increases rapidly in the system. At first the solenoid valve is still closed and gas flows into the patient&#x2019;s lungs (white region), but once the EPAP is reached, the solenoid valve opens and the air flows out of the MV through the expiratory pipe (light blue region).</p>
                <fig fig-type="figure" id="f8" orientation="portrait" position="float">
                    <label>Figure 8. </label>
                    <caption>
                        <title>Healthy patient example.</title>
                        <p>The calculated pressure (
                            <bold>a</bold>) flow (
                            <bold>b</bold>) and tidal volume (
                            <bold>c</bold>) time evolution in the lungs and at the control system solenoid valve. The patient breathing rate was taken to be 15 breaths per minute, the occlusion pressure is 4 cmH
                            <sub>2</sub>O, IPAP was set to 5 cmH
                            <sub>2</sub>O and the EPAP was set to 13 cmH
                            <sub>2</sub>O. The color coding is as described in 
                            <xref ref-type="table" rid="T2">Table 2</xref>.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/28553/cafce502-20d4-4835-9f7a-b29fcfaea9f2_figure8.gif"/>
                </fig>
                <table-wrap id="T2" orientation="portrait" position="anchor">
                    <label>Table 2. </label>
                    <caption>
                        <title>The output figures color coding for the patient breathing state and the state of the solenoid valve.</title>
                    </caption>
                    <table content-type="article-table" frame="hsides">
                        <thead>
                            <tr>
                                <th align="center" colspan="1" rowspan="2" valign="middle">Region Color</th>
                                <th align="center" colspan="2" rowspan="1" valign="top">Patient breathing
                                    <break/>state</th>
                                <th align="center" colspan="2" rowspan="1" valign="top">Solenoid
                                    <break/>valve state</th>
                            </tr>
                            <tr>
                                <th align="center" colspan="1" rowspan="1" valign="top">Inhaling</th>
                                <th align="center" colspan="1" rowspan="1" valign="top">Exhaling</th>
                                <th align="center" colspan="1" rowspan="1" valign="top">Open</th>
                                <th align="center" colspan="1" rowspan="1" valign="top">Close</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" style="background-color:#FBE4D5" valign="top">
                                    <bold>Pink</bold>
                                </td>
                                <td align="center" colspan="1" rowspan="1" valign="top">x</td>
                                <td align="center" colspan="1" rowspan="1" valign="top"/>
                                <td align="center" colspan="1" rowspan="1" valign="top"/>
                                <td align="center" colspan="1" rowspan="1" valign="top">x</td>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" style="background-color:#D9D4E2" valign="top">
                                    <bold>Purple</bold>
                                </td>
                                <td align="center" colspan="1" rowspan="1" valign="top">x</td>
                                <td align="center" colspan="1" rowspan="1" valign="top"/>
                                <td align="center" colspan="1" rowspan="1" valign="top">x</td>
                                <td align="center" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" style="background-color:#DEEAF6" valign="top">
                                    <bold>Blue</bold>
                                </td>
                                <td align="center" colspan="1" rowspan="1" valign="top"/>
                                <td align="center" colspan="1" rowspan="1" valign="top">x</td>
                                <td align="center" colspan="1" rowspan="1" valign="top">x</td>
                                <td align="center" colspan="1" rowspan="1" valign="top"/>
                            </tr>
                            <tr>
                                <td align="left" colspan="1" rowspan="1" style="background-color:#FFFFFF" valign="top">
                                    <bold>White</bold>
                                </td>
                                <td align="center" colspan="1" rowspan="1" valign="top"/>
                                <td align="center" colspan="1" rowspan="1" valign="top">x</td>
                                <td align="center" colspan="1" rowspan="1" valign="top"/>
                                <td align="center" colspan="1" rowspan="1" valign="top">x</td>
                            </tr>
                        </tbody>
                    </table>
                </table-wrap>
                <p>
                    <xref ref-type="fig" rid="f9">Figure 9</xref> shows the time evolution of the pressure, air flow and tidal volume simulating the ventilation of an acute respiratory distress syndrome (ARDS) patient. The patient breathing rate was taken to be 20 breaths per minute
                    <sup>
                        <xref ref-type="bibr" rid="ref-5">5</xref>
                    </sup>, the occlusion pressure is 6.65 cmH
                    <sub>2</sub>O
                    <sup>
                        <xref ref-type="bibr" rid="ref-6">6</xref>
                    </sup>, IPAP was set to 5 cmH
                    <sub>2</sub>O and the EPAP was set to 13 cmH
                    <sub>2</sub>O
                    <sup>
                        <xref ref-type="bibr" rid="ref-5">5</xref>
                    </sup>. The color coding is as described in 
                    <xref ref-type="table" rid="T2">Table 2</xref>. It can be easily seen that MV output ventilation of the ARDS patient is very similar to that shown in 
                    <xref ref-type="fig" rid="f8">Figure 8</xref>. The slight decrease in tidal volume is a result of the higher breathing rate which is recommended for patients with ARDS
                    <sup>
                        <xref ref-type="bibr" rid="ref-5">5</xref>
                    </sup>. The low variance in the MV output with respect to the patient condition is a result of the fairly constant gas flow upon inhalation. This may be an advantage since it allows simple tuning of the ventilation parameters according the guidelines for specific respiratory syndromes. </p>
                <fig fig-type="figure" id="f9" orientation="portrait" position="float">
                    <label>Figure 9. </label>
                    <caption>
                        <title>Acute respiratory distress syndrome (ARDS) patient example.</title>
                        <p>The calculated pressure (
                            <bold>a</bold>) flow (
                            <bold>b</bold>) and tidal volume (
                            <bold>c</bold>) time evolution in the lungs and at the control system solenoid valve. The patient breathing rate was taken to be 20 breaths per minute, the occlusion pressure is 6.65 cmH
                            <sub>2</sub>O, IPAP was set to 5 cmH
                            <sub>2</sub>O and the EPAP was set to 13 cmH
                            <sub>2</sub>O. The color coding is as described in 
                            <xref ref-type="table" rid="T2">Table 2</xref>.</p>
                    </caption>
                    <graphic orientation="portrait" position="float" xlink:href="https://f1000research-files.f1000.com/manuscripts/28553/cafce502-20d4-4835-9f7a-b29fcfaea9f2_figure9.gif"/>
                </fig>
                <p>Perfect synchronization between the MV and the patient is obtained if the solenoid valve opens and closes exactly when the patient attempts to inhale and exhale. Thus, the synchronization level of the MV can be optimized by attempting to minimize the white and purple regions in the output plot.</p>
            </sec>
        </sec>
        <sec sec-type="conclusions">
            <title>Conclusions</title>
            <p>In this study we provide a solution for the majority of the custom-designed ventilators created around the world in a response to the COVID-19 crisis. The simulator can lead to the opportunity to assure quality of the designed machines versus the digital twin model, analyze human response as compared to the realistic lung model and enable future, regulatory approved designs.</p>
        </sec>
        <sec>
            <title>Data availability</title>
            <sec>
                <title>Underlying data</title>
                <p>Open Science Framework: A simulation of a controlled medical ventilator with a realistic lungs model. 
                    <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.17605/OSF.IO/XJKC8">https://doi.org/10.17605/OSF.IO/XJKC8</ext-link>
                    <sup>
                        <xref ref-type="bibr" rid="ref-2">2</xref>
                    </sup>.</p>
                <p>This project contains the following underlying data:</p>
                <p>Peep and Popoff calibration (data underlying Figure 5):</p>
                <list list-type="bullet">
                    <list-item>
                        <p>BaseWorkspace.mat (Base parameters data, Simulink&#x00ae; model initial function callback)</p>
                    </list-item>
                    <list-item>
                        <p>load_ventilator_variables_PEEP_2.m (Calibration of set PEEP 2 cmH2O experiment, variables calculation script, Simulink&#x00ae; model initial function callback. Input of simulated respiration, input gas flow, pressure regulation (PEEP and Popoff) and control valve settings)</p>
                    </list-item>
                    <list-item>
                        <p>load_ventilator_variables_PEEP_5.m (Calibration of set PEEP 5 cmH2O experiment, variables calculation script, Simulink&#x00ae; model initial function callback. Input of simulated respiration, input gas flow, pressure regulation (PEEP and Popoff) and control valve settings.)</p>
                    </list-item>
                    <list-item>
                        <p>load_ventilator_variables_PEEP_10.m (Calibration of set PEEP 10 cmH2O experiment, variables calculation script, Simulink&#x00ae; model initial function callback. Input of simulated respiration, input gas flow, pressure regulation (PEEP and Popoff) and control valve settings)</p>
                    </list-item>
                    <list-item>
                        <p>Plot_ventilator_output_PEEP_2.m (Output results plotting script, Simulink&#x00ae; model stop function callback)</p>
                    </list-item>
                    <list-item>
                        <p>Plot_ventilator_output_PEEP_5.m (Output results plotting script, Simulink&#x00ae; model stop function callback)</p>
                    </list-item>
                    <list-item>
                        <p>Plot_ventilator_output_PEEP_10.m (Output results plotting script, Simulink&#x00ae; model stop function callback)</p>
                    </list-item>
                    <list-item>
                        <p>Manshema_mechanical_lung_Plugged_lungs_exp_PEEP_2.slx (Calibration of set PEEP 2 cmH2O experiment, Simulink&#x00ae; simulation model file. Output pressure and flow prediction, underlying Figure 5)</p>
                    </list-item>
                    <list-item>
                        <p>Manshema_mechanical_lung_Plugged_lungs_exp_PEEP_5.slx (Calibration of set PEEP 5 cmH2O experiment, Simulink&#x00ae; simulation model file. Output pressure and flow prediction, underlying Figure 5)</p>
                    </list-item>
                    <list-item>
                        <p>Manshema_mechanical_lung_Plugged_lungs_exp_PEEP_10.slx (Calibration of set PEEP 10 cmH2O experiment, Simulink&#x00ae; simulation model file. Output pressure and flow prediction, underlying Figure 5)</p>
                    </list-item>
                </list>
                <p>RC and C values calibration (underlying Figure 6)</p>
                <list list-type="bullet">
                    <list-item>
                        <p>BaseWorkspace.mat (Base parameters data, Simulink&#x00ae; model initial function callback)</p>
                    </list-item>
                    <list-item>
                        <p>flow-10-peep-2-lung.csv (Flow measurement data with set peep 2 cmH2O and flow set 10 lpm at Easylung lung)</p>
                    </list-item>
                    <list-item>
                        <p>flow-10-peep-2-out.csv (Flow measurement data with set peep 2 cmH2O and flow set 10 lpm at expiratory output)</p>
                    </list-item>
                    <list-item>
                        <p>load_ventilator_variables_full_exp_10Lpmin_PEEP_2.m (Calibration of RC and C values with set PEEP 2 cmH2O experiment, variables calculation script, Simulink&#x00ae; model initial function callback. Input of simulated respiration, input gas flow, pressure regulation and control valve settings)</p>
                    </list-item>
                    <list-item>
                        <p>plot_ventilator_output_full_exp_10Lpmin_PEEP_2.m (Output results plotting script, Simulink&#x00ae; model stop function callback)</p>
                    </list-item>
                    <list-item>
                        <p>Manshema_mechanical_lung_timed_10Lpmin_PEEP_2.slx (Calibration of RC and C values for lungs model, at set PEEP 2 cmH2O experiment with 10 lpm, Simulink&#x00ae; simulation model file, raw pressure and flow prediction underlying Figure 6)</p>
                    </list-item>
                </list>
                <p>Model - MV prototype Comparison (underlying Figure 7)</p>
                <list list-type="bullet">
                    <list-item>
                        <label>&#x2218;</label>
                        <p>Lungs comparison 20Lpm, underlying Figure 7a and 7b</p>
                        <list list-type="bullet">
                            <list-item>
                                <label>&#x25aa;</label>
                                <p>BaseWorkspace.mat</p>
                                <p>Base parameters data, Simulink&#x00ae; model initial function callback.</p>
                            </list-item>
                            <list-item>
                                <label>&#x25aa;</label>
                                <p>flow-20-peep-5-lung.csv</p>
                                <p>Flow measurement data with set peep 5 cmH2O and flow set 20 lpm at Easylung lung.</p>
                            </list-item>
                            <list-item>
                                <label>&#x25aa;</label>
                                <p>flow-20-peep-5-out.csv</p>
                                <p>Flow measurement data with set peep 5 cmH2O and flow set 20 lpm at expiratory output.</p>
                            </list-item>
                            <list-item>
                                <label>&#x25aa;</label>
                                <p>load_ventilator_variables_full_exp_20Lpmin_PEEP_5.m</p>
                                <p>Model and experiment comparison with set PEEP 5 cmH2O experiment, variables calculation script, Simulink&#x00ae; model initial function callback. Input of simulated respiration, input gas flow, pressure regulation and control valve settings.</p>
                            </list-item>
                            <list-item>
                                <label>&#x25aa;</label>
                                <p>plot_ventilator_output_full_exp_20Lpmin_PEEP_5.m</p>
                                <p>Output results plotting script, Simulink&#x00ae; model stop function callback.</p>
                            </list-item>
                            <list-item>
                                <label>&#x25aa;</label>
                                <p>Manshema_mechanical_lung_timed_20Lpmin_PEEP_5.slx</p>
                                <p>Model and experiment comparison at set PEEP 5 cmH2O experiment with 20 lpm, Simulink&#x00ae; simulation model file, raw pressure and flow prediction underlying Figures 7a and 7b.</p>
                            </list-item>
                        </list>
                    </list-item>
                    <list-item>
                        <label>&#x2218;</label>
                        <p>Lungs comparison 30Lpm (underlying Figure 7c and 7d)</p>
                        <list list-type="bullet">
                            <list-item>
                                <label>&#x25aa;</label>
                                <p>BaseWorkspace.mat</p>
                                <p>Base parameters data, Simulink&#x00ae; model initial function callback.</p>
                            </list-item>
                            <list-item>
                                <label>&#x25aa;</label>
                                <p>flow-30-peep-5-lung.csv</p>
                                <p>Flow measurement data with set peep 5 cmH2O and flow set 30 lpm at Easylung lung.</p>
                            </list-item>
                            <list-item>
                                <label>&#x25aa;</label>
                                <p>flow-30-peep-5-out.csv</p>
                                <p>Flow measurement data with set peep 5 cmH2O and flow set 30 lpm at expiratory output.</p>
                            </list-item>
                            <list-item>
                                <label>&#x25aa;</label>
                                <p>load_ventilator_variables_full_exp_30Lpmin_PEEP_5.m</p>
                                <p>Model and experiment comparison with set PEEP 5 cmH2O experiment, variables calculation script, Simulink&#x00ae; model initial function callback. Input of simulated respiration, input gas flow, pressure regulation and control valve settings.</p>
                            </list-item>
                            <list-item>
                                <label>&#x25aa;</label>
                                <p>plot_ventilator_output_full_exp_30Lpmin_PEEP_5.m</p>
                                <p>Output results plotting script, Simulink&#x00ae; model stop function callback.</p>
                            </list-item>
                            <list-item>
                                <label>&#x25aa;</label>
                                <p>Manshema_mechanical_lung_timed_30Lpmin_PEEP_5.slx</p>
                                <p>Model and experiment comparison at set PEEP 5 cmH2O experiment with 30 lpm, Simulink&#x00ae; simulation model file, raw pressure and flow prediction underlying Figures 7c and 7d.</p>
                            </list-item>
                        </list>
                    </list-item>
                </list>
                <p>Healthy Patient model testing (underlying Figure 2, 3, 4 and 8)</p>
                <list list-type="bullet">
                    <list-item>
                        <label>&#x2218;</label>
                        <p>BaseWorkspace.mat</p>
                        <p>Base parameters data, Simulink&#x00ae; model initial function callback.</p>
                    </list-item>
                    <list-item>
                        <label>&#x2218;</label>
                        <p>load_variables_Healthy.m</p>
                        <p>Healthy patient lungs and breathing model simulation, variables calculation script, Simulink&#x00ae; model initial function callback. Input of simulated respiration, input gas flow, pressure regulation (PEEP and Popoff) and control valve settings.</p>
                    </list-item>
                    <list-item>
                        <label>&#x2218;</label>
                        <p>plot_output_Healthy.m</p>
                        <p>Healthy patient lungs and breathing model simulation output results plotting script, Simulink&#x00ae; model stop function callback, underlying Figure 8.</p>
                    </list-item>
                    <list-item>
                        <label>&#x2218;</label>
                        <p>Manshema_20Lpmin_PEEP_5_simulated_lung.slx</p>
                        <p>Healthy patient lungs and breathing Simulink&#x00ae; simulation model file, blocks model, underlying Figures 2, 3, 4 and raw pressure, flow and volume prediction underlying Figure 8.</p>
                    </list-item>
                </list>
                <p>ARDS patient model testing (underlying Figure 9)</p>
                <list list-type="bullet">
                    <list-item>
                        <label>&#x2218;</label>
                        <p>BaseWorkspace.mat</p>
                        <p>Base parameters data, Simulink&#x00ae; model initial function callback.</p>
                    </list-item>
                    <list-item>
                        <label>&#x2218;</label>
                        <p>load_variables_ARDS.m</p>
                        <p>ARDS patient lungs and breathing model simulation, variables calculation script, Simulink&#x00ae; model initial function callback. Input of simulated respiration, input gas flow, pressure regulation (PEEP and Popoff) and control valve settings.</p>
                    </list-item>
                    <list-item>
                        <label>&#x2218;</label>
                        <p>plot_output_ARDS.m</p>
                        <p>ARDS patient lungs and breathing model simulation output results plotting script, Simulink&#x00ae; model stop function callback, underlying Figure 9.</p>
                    </list-item>
                    <list-item>
                        <label>&#x2218;</label>
                        <p>Manshema_20Lpmin_PEEP_5_ARDS.slx</p>
                        <p>ARDS patient lungs and breathing Simulink&#x00ae; simulation model file, raw pressure, flow and volume prediction underlying Figure 9.</p>
                    </list-item>
                </list>
            </sec>
            <sec>
                <title>Extended data</title>
                <p>Open Science Framework: A simulation of a controlled medical ventilator with a realistic lungs model. 
                    <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.17605/OSF.IO/XJKC8">https://doi.org/10.17605/OSF.IO/XJKC8</ext-link>
                    <sup>
                        <xref ref-type="bibr" rid="ref-2">2</xref>
                    </sup>.</p>
                <p>This project contains the following extended data:</p>
                <list list-type="bullet">
                    <list-item>
                        <label>-</label>
                        <p>Manshema_Sim_Parameters.csv (Table of input parameters and variables calculations for healthy and ARDS patients&#x2019; simulations)</p>
                    </list-item>
                    <list-item>
                        <label>-</label>
                        <p>Manshema_Blocks_Properties.csv (Extended table of Simulink&#x00ae; blocks properties input parameters for all simulations)</p>
                    </list-item>
                </list>
                <p>Data are available under the terms of the 
                    <ext-link ext-link-type="uri" xlink:href="https://creativecommons.org/publicdomain/zero/1.0/">Creative Commons Zero "No rights reserved" data waiver</ext-link> (CC0 1.0 Public domain dedication).</p>
            </sec>
        </sec>
    </body>
    <back>
        <ack>
            <title>Acknowledgments</title>
            <p>The authors wish to thank to all the people involved in the discussions and contributors to the brainstorming group originated at the Faculty of Engineering, Tel Aviv University: Nati Ben Hamo, Prof. Yoram Reich, Baruch Meierovich, Demitry Aronovsky, Yigal Edrey, and Danny Berko and all the members of the Manshema team: Mordechai Halfon, Dr. Elad Grozovsky, Roi Darnell, Ivry Shapira and Omri Mizrahi.</p>
        </ack>
        <ref-list>
            <ref id="ref-1">
                <label>1</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Pearce</surname>
                            <given-names>JM</given-names>
                        </name>
</person-group>:
                    <article-title>A review of open source ventilators for COVID-19 and future pandemics [version 2; peer review: 3 approved].</article-title>
                    <source>

                        <italic toggle="yes">F1000Res.</italic>
</source>
                    <year>2020</year>;<volume>9</volume>:<fpage>218</fpage>.
                    <pub-id pub-id-type="pmid">32411358</pub-id>
                    <pub-id pub-id-type="doi">10.12688/f1000research.22942.2</pub-id>
                    <pub-id pub-id-type="pmcid">7195895</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-2">
                <label>2</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Segev</surname>
                            <given-names>G</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Liberzon</surname>
                            <given-names>A</given-names>
                        </name>
</person-group>:
                    <article-title>A simulation of a controlled medical ventilator with a realistic lungs model.</article-title>
                    <year> 2020</year>.
                    <ext-link ext-link-type="uri" xlink:href="http://www.doi.org/10.17605/OSF.IO/XJKC8">http://www.doi.org/10.17605/OSF.IO/XJKC8</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-3">
                <label>3</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Otis</surname>
                            <given-names>AB</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Fenn</surname>
                            <given-names>WO</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Rahn</surname>
                            <given-names>H</given-names>
                        </name>
</person-group>:
                    <article-title>Mechanics of breathing in man.</article-title>
                    <source>

                        <italic toggle="yes">J Appl Physiol.</italic>
</source>
                    <year>1950</year>;<volume>2</volume>(<issue>11</issue>):<fpage>592</fpage>&#x2013;<lpage>607</lpage>.
                    <pub-id pub-id-type="pmid">15436363</pub-id>
                    <pub-id pub-id-type="doi">10.1152/jappl.1950.2.11.592</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-4">
                <label>4</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Fresnel</surname>
                            <given-names>E</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Muir</surname>
                            <given-names>JF</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Letellier</surname>
                            <given-names>C</given-names>
                        </name>
</person-group>:
                    <article-title>Realistic human muscle pressure for driving a mechanical lung.</article-title>
                    <source>

                        <italic toggle="yes">EPJ Nonlinear Biomed Phys.</italic>
</source>
                    <year>2014</year>;<volume>2</volume>(<issue>1</issue>):<fpage>1</fpage>&#x2013;<lpage>18</lpage>.
                    <pub-id pub-id-type="doi">10.1140/epjnbp/s40366-014-0007-8</pub-id>
                </mixed-citation>
            </ref>
            <ref id="ref-5">
                <label>5</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Siegel</surname>
                            <given-names>MD</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Hyzy</surname>
                            <given-names>RC</given-names>
                        </name>
</person-group>:
                    <article-title>Ventilator management strategies for adults with acute respiratory distress syndrome.</article-title>
                    <source>

                        <italic toggle="yes">UpToDate.</italic>
</source>
                    <year>2019</year>;<volume>3</volume>:<fpage>1</fpage>&#x2013;<lpage>42</lpage>.
                    <ext-link ext-link-type="uri" xlink:href="https://www.uptodate.com/contents/ventilator-management-strategies-for-adults-with-acute-respiratory-distress-syndrome/print#!">Reference Source</ext-link>
                </mixed-citation>
            </ref>
            <ref id="ref-6">
                <label>6</label>
                <mixed-citation publication-type="journal">
                    <person-group person-group-type="author">

                        <name name-style="western">
                            <surname>Herrera</surname>
                            <given-names>M</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Blasco</surname>
                            <given-names>J</given-names>
                        </name>

                        <name name-style="western">
                            <surname>Venegas</surname>
                            <given-names>J</given-names>
                        </name>

                        <etal/>
</person-group>:
                    <article-title>Mouth occlusion pressure (P0.1) in acute respiratory failure.</article-title>
                    <source>

                        <italic toggle="yes">Intensive Care Med.</italic>
</source>
                    <year>1985</year>;<volume>11</volume>(<issue>3</issue>):<fpage>134</fpage>&#x2013;<lpage>139</lpage>.
                    <pub-id pub-id-type="pmid">3998273</pub-id>
                    <pub-id pub-id-type="doi">10.1007/BF00258538</pub-id>
                </mixed-citation>
            </ref>
        </ref-list>
    </back>
    <sub-article article-type="reviewer-report" id="report79574">
        <front-stub>
            <article-id pub-id-type="doi">10.5256/f1000research.28553.r79574</article-id>
            <title-group>
                <article-title>Reviewer response for version 1</article-title>
            </title-group>
            <contrib-group>
                <contrib contrib-type="author">
                    <name>
                        <surname>Karbing</surname>
                        <given-names>Dan Stieper</given-names>
                    </name>
                    <xref ref-type="aff" rid="r79574a1">1</xref>
                    <role>Referee</role>
                    <uri content-type="orcid">https://orcid.org/0000-0001-8632-6180</uri>
                </contrib>
                <aff id="r79574a1">
                    <label>1</label>Department of Health Science and Technology, Aalborg University, Aalborg, Denmark</aff>
            </contrib-group>
            <author-notes>
                <fn fn-type="conflict">
                    <p>
                        <bold>Competing interests: </bold>No competing interests were disclosed.</p>
                </fn>
            </author-notes>
            <pub-date pub-type="epub">
                <day>9</day>
                <month>3</month>
                <year>2021</year>
            </pub-date>
            <permissions>
                <copyright-statement>Copyright: &#x00a9; 2021 Karbing DS</copyright-statement>
                <copyright-year>2021</copyright-year>
                <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
                    <license-p>This is an open access peer review report distributed under the terms of the Creative Commons Attribution Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
                </license>
            </permissions>
            <related-article ext-link-type="doi" id="relatedArticleReport79574" related-article-type="peer-reviewed-article" xlink:href="10.12688/f1000research.25873.1"/>
            <custom-meta-group>
                <custom-meta>
                    <meta-name>recommendation</meta-name>
                    <meta-value>reject</meta-value>
                </custom-meta>
            </custom-meta-group>
        </front-stub>
        <body>
            <p>The paper presents an emergency ventilator as well as a software model for simulating mechanical ventilation and testing the design of mechanical ventilators. It is a worthy endeavor indeed. However, the manuscript in its current form suffers from having to both document ventilator and simulator design and provide evaluation results.&#x00a0;</p>
            <p> </p>
            <p> 
                <bold>General comments:</bold> 
                <list list-type="order">
                    <list-item>
                        <p>Model calibration: Were the experiments repeated with different valves to check reproducibility between valves for this calibration?</p>
                    </list-item>
                    <list-item>
                        <p>What were the parameters of the easylung test lung, e.g. resistance and compliance? There is some discrepancy between simulated and measured values of pressure and flow, in particular for model predictions (fig 7), which would expectedly be aggravated and more serious in severely ill patients potentially leading to falsely accepting a dangerous design.&#x00a0;</p>
                    </list-item>
                    <list-item>
                        <p>Please consider sharing table 1 instead as an electronic supplement and provide tables with the model parameters used for simulating patient cases.</p>
                    </list-item>
                    <list-item>
                        <p>Definition of good agreement between model simulations and measurements is currently done 'by eye'. The evaluation would be strengthened by a quantitative evaluation and criterion of good agreement, e.g. by Bland-Altman plots.&#x00a0;</p>
                    </list-item>
                    <list-item>
                        <p>Please provide model parameters for simulation of healthy and ARDS patient examples. Flows, pressures and volumes appear very similar for identical ventilator settings. This would not be the case for a real ARDS patient. The simulation therefore does not appear realistic in its current form.</p>
                    </list-item>
                    <list-item>
                        <p>Patient-ventilator synchrony covers a variety of situations. Figures 8 and 9 do not provide an evaluation comprehensive enough to document that the simulator can be used to test ventilator functioning in relation to this phenomenon.&#x00a0;</p>
                    </list-item>
                    <list-item>
                        <p>The presented results do not, to a convincing degree, support the current unambiguous conclusion. A more comprehensive evaluation is required to support that the simulator can indeed secure sufficient quality of ventilator designs.&#x00a0;</p>
                    </list-item>
                </list> 
                <bold>Specific comments:</bold> 
                <list list-type="order">
                    <list-item>
                        <p>Figure 5:&#x00a0;Only 1 red curve but varying points - due to simulated values at closed solenoid value being the same but measured values varying?</p>
                    </list-item>
                    <list-item>
                        <p>Please use different symbols for the measured values at the three different PEEP levels. It is difficult to see in some instances if a point belong to the PEEP 2, 5 or 10 experiment.</p>
                    </list-item>
                    <list-item>
                        <p>Pg 7, 2nd col, ln 12-14: I did not understand this sentence, please consider revising it.</p>
                    </list-item>
                </list>
            </p>
            <p>Is the work clearly and accurately presented and does it cite the current literature?</p>
            <p>Partly</p>
            <p>If applicable, is the statistical analysis and its interpretation appropriate?</p>
            <p>Not applicable</p>
            <p>Are all the source data underlying the results available to ensure full reproducibility?</p>
            <p>Yes</p>
            <p>Is the study design appropriate and is the work technically sound?</p>
            <p>Partly</p>
            <p>Are the conclusions drawn adequately supported by the results?</p>
            <p>No</p>
            <p>Are sufficient details of methods and analysis provided to allow replication by others?</p>
            <p>No</p>
            <p>Reviewer Expertise:</p>
            <p>Modeling of pulmonary physiology. Decision support for mechanical ventilation management.</p>
            <p>I confirm that I have read this submission and believe that I have an appropriate level of expertise to state that I do not consider it to be of an acceptable scientific standard, for reasons outlined above.</p>
        </body>
    </sub-article>
</article>
