// Created by libAntimony v2.13.0
model *Wang1996_Single_Neuron()

  // Compartments and Species:
  compartment pre_synaptic_cell, post_synaptic_cell;

  // Assignment Rules:
  tau_0 := Cm/gL;
  I_Na_post := gNa*m_inf_post^3*h_post*(V_post - E_Na);
  m_inf_post := alpha_m_post/(alpha_m_post + beta_m_post);
  alpha_m_post := -0.1*(V_post + 35)/(exp(-0.1*(V_post + 35)) - 1);
  beta_m_post := 4*exp(-(V_post + 60)/18);
  alpha_h_post := 0.07*exp(-(V_post + 58)/20);
  beta_h_post := 1/(exp(-0.1*(V_post + 28)) + 1);
  I_K_post := gK*n_post^4*(V_post - E_K);
  I_L_post := gL*(V_post - E_L);
  I_syn := g_syn*s*(V_post - E_syn);
  alpha_n_post := -0.01*(V_post + 34)/(exp(-0.1*(V_post + 34)) - 1);
  beta_n_post := 0.125*exp(-(V_post + 44)/80);
  F := 1/(1 + exp(-(V_pre - theta_syn)/2));
  I_app_pre := piecewise(2, (time >= 10) && (time <= 20), 0);
  I_Na_pre := gNa*m_inf_pre^3*h_pre*(V_pre - E_Na);
  I_K_pre := gK*n_pre^4*(V_pre - E_K);
  I_L_pre := gL*(V_pre - E_L);
  m_inf_pre := alpha_m_pre/(alpha_m_pre + beta_m_pre);
  alpha_m_pre := -0.1*(V_pre + 35)/(exp(-0.1*(V_pre + 35)) - 1);
  beta_m_pre := 4*exp(-(V_pre + 60)/18);
  alpha_h_pre := 0.07*exp(-(V_pre + 58)/20);
  beta_h_pre := 1/(exp(-0.1*(V_pre + 28)) + 1);
  alpha_n_pre := -0.01*(V_pre + 34)/(exp(-0.1*(V_pre + 34)) - 1);
  beta_n_pre := 0.125*exp(-(V_pre + 44)/80);

  // Rate Rules:
  h_post' = phi*(alpha_h_post*(1 - h_post) - beta_h_post*h_post);
  V_post' = (I_app_post - (I_Na_post + I_K_post + I_L_post + I_syn))/Cm;
  n_post' = phi*(alpha_n_post*(1 - n_post) - beta_n_post*n_post);
  s' = alpha*F*(1 - s) - beta*s;
  V_pre' = (I_app_pre - (I_Na_pre + I_K_pre + I_L_pre))/Cm;
  h_pre' = phi*(alpha_h_pre*(1 - h_pre) - beta_h_pre*h_pre);
  n_pre' = phi*(alpha_n_pre*(1 - n_pre) - beta_n_pre*n_pre);

  // Compartment initializations:
  pre_synaptic_cell = 1;
  post_synaptic_cell = 1;

  // Variable initializations:
  Cm = 1;
  Cm has uF_per_cm2;
  gL = 0.1;
  gL has mS_per_cm2;
  gK = 9;
  gK has mS_per_cm2;
  gNa = 35;
  gNa has mS_per_cm2;
  E_K = -90;
  E_K has mV;
  E_L = -65;
  E_L has mV;
  E_Na = 55;
  E_Na has mV;
  phi = 5;
  phi has dimensionless;
  tau_0 has time_unit;
  I_app_post = 0;
  I_app_post has uA_per_cm2;
  I_Na_post has uA_per_cm2;
  m_inf_post has dimensionless;
  h_post = alpha_h_post/(beta_h_post + alpha_h_post);
  h_post has dimensionless;
  V_post = -64;
  V_post has mV;
  alpha_m_post has per_m;
  beta_m_post has per_m;
  alpha_h_post has per_m;
  beta_h_post has per_m;
  I_K_post has uA_per_cm2;
  I_L_post has uA_per_cm2;
  I_syn has uA_per_cm2;
  n_post = alpha_n_post/(beta_n_post + alpha_n_post);
  n_post has dimensionless;
  alpha_n_post has per_m;
  beta_n_post has per_m;
  g_syn = 0.1;
  g_syn has mS_per_cm2;
  s = alpha*F/(beta + alpha*F);
  s has dimensionless;
  E_syn = -75;
  E_syn has mV;
  alpha = 12;
  alpha has per_m;
  F has dimensionless;
  beta = 0.1;
  beta has per_m;
  V_pre = -64;
  V_pre has mV;
  theta_syn = 0;
  theta_syn has mV;
  I_app_pre has uA_per_cm2;
  I_Na_pre has uA_per_cm2;
  I_K_pre has uA_per_cm2;
  I_L_pre has uA_per_cm2;
  m_inf_pre has dimensionless;
  h_pre = alpha_h_pre/(beta_h_pre + alpha_h_pre);
  h_pre has dimensionless;
  alpha_m_pre has per_m;
  beta_m_pre has per_m;
  alpha_h_pre has per_m;
  beta_h_pre has per_m;
  n_pre = alpha_n_pre/(beta_n_pre + alpha_n_pre);
  n_pre has dimensionless;
  alpha_n_pre has per_m;
  beta_n_pre has per_m;

  // Other declarations:
  var tau_0, I_Na_post, m_inf_post, h_post, V_post, alpha_m_post, beta_m_post;
  var alpha_h_post, beta_h_post, I_K_post, I_L_post, I_syn, n_post, alpha_n_post;
  var beta_n_post, s, F, V_pre, I_app_pre, I_Na_pre, I_K_pre, I_L_pre, m_inf_pre;
  var h_pre, alpha_m_pre, beta_m_pre, alpha_h_pre, beta_h_pre, n_pre, alpha_n_pre;
  var beta_n_pre;
  const pre_synaptic_cell, post_synaptic_cell, Cm, gL, gK, gNa, E_K, E_L;
  const E_Na, phi, I_app_post, g_syn, E_syn, alpha, beta, theta_syn;

  // Unit definitions:
  unit time_unit = 1e-3 second;
  unit per_m = 1 / 1e-3 second;
  unit mV = 1e-3 volt;
  unit uA_per_cm2 = 1e-6 ampere / (1e-2 metre)^2;
  unit uF_per_cm2 = 1e-6 farad / (1e-2 metre)^2;
  unit mS_per_cm2 = 1e-3 siemens / (1e-2 metre)^2;

  // Display Names:
  time_unit is "ms";
  per_m is "per_ms";
  uA_per_cm2 is "microA_per_cm2";

  // SBO terms:
  pre_synaptic_cell.sboTerm = 290
  post_synaptic_cell.sboTerm = 290
  Cm.sboTerm = 258
  gL.sboTerm = 257
  gK.sboTerm = 257
  gNa.sboTerm = 257
  E_K.sboTerm = 259
  E_L.sboTerm = 259
  E_Na.sboTerm = 259
  V_post.sboTerm = 259
  g_syn.sboTerm = 257
  V_pre.sboTerm = 259

  // CV terms:
  pre_synaptic_cell container "http://identifiers.org/fma/FMA:62493"
  pre_synaptic_cell identity "http://identifiers.org/fma/FMA:54527"
  post_synaptic_cell container "http://identifiers.org/fma/FMA:62493"
  post_synaptic_cell identity "http://identifiers.org/fma/FMA:54527"
end

Wang1996_Single_Neuron is "Wang1996_Synaptic_Inhibition_Two_Neuron"

Wang1996_Single_Neuron model_entity_is "http://identifiers.org/biomodels.db/MODEL1101240000"
Wang1996_Single_Neuron model_entity_is "http://identifiers.org/biomodels.db/BIOMD0000000302"
Wang1996_Single_Neuron description "http://identifiers.org/pubmed/8815919"
Wang1996_Single_Neuron taxon "http://identifiers.org/taxonomy/10116"
Wang1996_Single_Neuron container "http://identifiers.org/bto/BTO:0000920",
                                 "http://identifiers.org/bto/BTO:0000601"
Wang1996_Single_Neuron version "http://identifiers.org/go/GO:0051932"
