<Lems2>

    <!-- Example with Simple cell specifying segment details-->

    <!-- This is a file which can be read and executed by the LEMS Interpreter.
         It imports the LEMS definitions of the core NeuroML 2 Components, 
         imports in "pure" NeuroML 2 and contains some LEMS elements for running 
         a simulation -->


    <Target component="sim1" reportFile="report.txt"/>

    <Include file="Cells.xml"/>
    <Include file="Networks.xml"/>
    <Include file="Simulation.xml"/>


    <!-- Including files with a <neuroml> root, "real" NeuroML 2 files -->
    <Include file="NaConductance.channel.nml"/>
    <Include file="KConductance.channel.nml"/>
    <Include file="LeakConductance.channel.nml"/>
    <Include file="NML2_SingleCompHHCell.nml"/>


    <Simulation id="sim1" length="300ms" step="0.01ms" target="net1">
    
        <Display id="d1" title="Ex5: HH cell with simple morphology: voltage" timeScale="1ms" xmin="0" xmax="300" ymin="-90" ymax="50">
                <Line id="v" quantity="hhpop[0]/v" scale="1mV" color="#ffffff" timeScale="1ms"/>
                <Line id="spiking" quantity="hhpop[0]/spiking" scale="0.1V"  color="#004040" timeScale="1ms"/>
                <!--<Line id="l3" quantity="hhpop[0]/debugVal" scale="1V"  color="#999999" timeScale="1ms"/>-->
        </Display>
        <Display id="d2" title="Ex5: HH cell with simple morphology: rate variables" timeScale="1ms" xmin="0" xmax="300" ymin="-0.1" ymax="1.1">
                <Line id="m" quantity="hhpop[0]/bioPhys1/membraneProperties/NaConductances/NaConductance/m/q" scale="1"  color="#000000" timeScale="1ms"/>
                <Line id="h" quantity="hhpop[0]/bioPhys1/membraneProperties/NaConductances/NaConductance/h/q" scale="1"  color="#ff0000" timeScale="1ms"/>
                <Line id="n" quantity="hhpop[0]/bioPhys1/membraneProperties/KConductances/KConductance/n/q" scale="1"  color="#0000ff" timeScale="1ms"/>
        </Display>
        <Display id="d3" title="Ex5: HH cell with simple morphology: current densities" timeScale="1ms" xmin="0" xmax="300" ymin="-0.1" ymax="1.1">
                <Line id="ina" quantity="hhpop[0]/bioPhys1/membraneProperties/NaConductances/iDensity" scale="1"  color="#000000" timeScale="1ms"/>
                <Line id="ik" quantity="hhpop[0]/bioPhys1/membraneProperties/KConductances/iDensity" scale="1"  color="#ff0000" timeScale="1ms"/>
        </Display>
        <Display id="d4" title="Ex5: HH cell with simple morphology: conductance densities" timeScale="1ms" xmin="0" xmax="300" ymin="-50" ymax="350">
                <Line id="gna" quantity="hhpop[0]/bioPhys1/membraneProperties/NaConductances/gDensity" scale="1"  color="#000000" timeScale="1ms"/>
                <Line id="gk" quantity="hhpop[0]/bioPhys1/membraneProperties/KConductances/gDensity" scale="1"  color="#ff0000" timeScale="1ms"/>
        </Display>
    
    
        <OutputFile id="of0" fileName="results/ex5_v.dat">
            <OutputColumn id="v" quantity="hhpop[0]/v"/> 
        </OutputFile>  
        
        <OutputFile id="of1" fileName="results/ex5_vars.dat">
            <OutputColumn id="m" quantity="hhpop[0]/bioPhys1/membraneProperties/NaConductances/NaConductance/m/q"/> 
            <OutputColumn id="h" quantity="hhpop[0]/bioPhys1/membraneProperties/NaConductances/NaConductance/h/q"/> 
            <OutputColumn id="n" quantity="hhpop[0]/bioPhys1/membraneProperties/KConductances/KConductance/n/q"/> 
        </OutputFile>  
    
        
    </Simulation>


</Lems2>