From 4fd86a3325762b40962fe10301f8ce93ac99071a Mon Sep 17 00:00:00 2001 From: bnewbold Date: Tue, 29 Nov 2016 23:23:24 -0800 Subject: more examples (fixed syntax) --- examples/hodgkin_huxley/model.modelica | 23 +++++++++++++++++++++++ examples/van_der_pol/metadata.toml | 0 examples/van_der_pol/model.modelica | 8 ++++++++ examples/van_der_pol/page.md | 0 examples/von_bertalanffy/model.modelica | 7 +++++++ examples/von_bertalanffy/page.md | 5 +++++ 6 files changed, 43 insertions(+) create mode 100644 examples/hodgkin_huxley/model.modelica create mode 100644 examples/van_der_pol/metadata.toml create mode 100644 examples/van_der_pol/model.modelica create mode 100644 examples/van_der_pol/page.md create mode 100644 examples/von_bertalanffy/model.modelica create mode 100644 examples/von_bertalanffy/page.md (limited to 'examples') diff --git a/examples/hodgkin_huxley/model.modelica b/examples/hodgkin_huxley/model.modelica new file mode 100644 index 0000000..9153799 --- /dev/null +++ b/examples/hodgkin_huxley/model.modelica @@ -0,0 +1,23 @@ +model HodgkinHuxley + parameter Real G_Na =120 "conductance"; + parameter Real G_K =36 "conductance"; + parameter Real G_lk =0.3 "conductance"; + parameter Real C =1.0 "membrane capacitance"; + parameter Real V_Na =115 "potential"; + parameter Real V_K =-12 "potential"; + parameter Real V_lk =-49.387 "leakage"; + Real n; + Real alpha_n; + Real Beta_n; + Real m; + Real alpha_m; + Real Beta_m; + Real h; + Real alpha_h; + Real Beta_h; +equation + C * der(V_m) = - G_Na * (Vm - E_Na) - G_K * (V_m - E_K) - G_lk * (V_m - V_lk); + der(n) = - (alpha_n + Beta_n) * n + alpha_n; + der(m) = - (alpha_m + Beta_m) * m + alpha_m; + der(h) = - (alpha_h + Beta_h) * h + alpha_h; +end HodgkinHuxley; diff --git a/examples/van_der_pol/metadata.toml b/examples/van_der_pol/metadata.toml new file mode 100644 index 0000000..e69de29 diff --git a/examples/van_der_pol/model.modelica b/examples/van_der_pol/model.modelica new file mode 100644 index 0000000..c1aa99b --- /dev/null +++ b/examples/van_der_pol/model.modelica @@ -0,0 +1,8 @@ +model VanDerPolOscillator + parameter Real mu "dampening strength"; + Real x; + Real y; +equation + der(x) = y; + der(y) = mu * y * (1 - x^2) - x; +end VanDerPolOscillator; diff --git a/examples/van_der_pol/page.md b/examples/van_der_pol/page.md new file mode 100644 index 0000000..e69de29 diff --git a/examples/von_bertalanffy/model.modelica b/examples/von_bertalanffy/model.modelica new file mode 100644 index 0000000..4eb45f6 --- /dev/null +++ b/examples/von_bertalanffy/model.modelica @@ -0,0 +1,7 @@ +model VonBertalanffyGrowth + parameter Real K "growth rate"; + parameter Real L "asymptotic final size"; + Real l "length"; +equation + der(l) = K * (L - l); +end VonBertalanffyGrowth; diff --git a/examples/von_bertalanffy/page.md b/examples/von_bertalanffy/page.md new file mode 100644 index 0000000..ea6e9f1 --- /dev/null +++ b/examples/von_bertalanffy/page.md @@ -0,0 +1,5 @@ + + +An alternative/solve variant is: + + l = L * (1 - e^(-K * t)) -- cgit v1.2.3