From fdebceb92fe819cdcfeb9c1288102f3b97ab3ff6 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Fri, 16 Sep 2016 20:45:22 -0700 Subject: update format of initial examples --- examples/classic_gravitation/metadata.toml | 15 +-------------- examples/classic_gravitation/model.modelica | 9 +++++++++ examples/classic_gravitation/page.md | 9 +++++++++ examples/lotka_volterra/metadata.toml | 17 ----------------- examples/lotka_volterra/model.modelica | 11 +++++++++++ examples/lotka_volterra/page.md | 8 ++++++++ 6 files changed, 38 insertions(+), 31 deletions(-) create mode 100644 examples/classic_gravitation/model.modelica create mode 100644 examples/classic_gravitation/page.md create mode 100644 examples/lotka_volterra/model.modelica create mode 100644 examples/lotka_volterra/page.md (limited to 'examples') diff --git a/examples/classic_gravitation/metadata.toml b/examples/classic_gravitation/metadata.toml index 953dad8..ffd6e59 100644 --- a/examples/classic_gravitation/metadata.toml +++ b/examples/classic_gravitation/metadata.toml @@ -1,13 +1,7 @@ [model] -name-en = "Classic Gravitation" +name = "Classic Gravitation" descrption-en = "Newtonian" -sexprs = [''' - (= - F - (/ (* G m1 m2) - (square r 2))) - '''] [variables] @@ -50,10 +44,3 @@ sexprs = [''' m1 = 5.972e24 # mass of earth m2 = 7.348e22 # mass of moon - -[references] - - [references.url] - "Mathworld" = "http://mathworld.wolfram.com/Lotka-VolterraEquations.html" - "Wikipedia" = "https://en.wikipedia.org/wiki/Lotka%E2%80%93Volterra_equations" - diff --git a/examples/classic_gravitation/model.modelica b/examples/classic_gravitation/model.modelica new file mode 100644 index 0000000..6504ecf --- /dev/null +++ b/examples/classic_gravitation/model.modelica @@ -0,0 +1,9 @@ +model ClassicGravitation + parameter Real G=6.674e-11 "Gravitational Constant"; + Real m1 "mass #1"; + Real m2 "mass #2"; + Real r "radius"; + Real F "force"; +equation + F = (G * m1 * m2) / (r^2) +end ClassicGravitation; diff --git a/examples/classic_gravitation/page.md b/examples/classic_gravitation/page.md new file mode 100644 index 0000000..15b6946 --- /dev/null +++ b/examples/classic_gravitation/page.md @@ -0,0 +1,9 @@ + +This is a wikipage! + +All about gravity! + +## References + +* [Wikipedia](https://en.wikipedia.org/wiki/Gravity) + diff --git a/examples/lotka_volterra/metadata.toml b/examples/lotka_volterra/metadata.toml index 7d2cf0d..2e98841 100644 --- a/examples/lotka_volterra/metadata.toml +++ b/examples/lotka_volterra/metadata.toml @@ -2,17 +2,6 @@ [model] name-en = "Lotka–Volterra equations" descrption-en = "Predator-Prey Model" -sexprs = [''' - (= - (partial-derivative x t) - (- (* alpha x) - (* beta x y))) - ''',''' - (= - (partial-derivative y t) - (- (* delta x y) - (* gamma y))) - '''] [variables] @@ -55,9 +44,3 @@ sexprs = [''' gamma = 1 t = [0, 20] -[references] - - [references.url] - "Mathworld" = "http://mathworld.wolfram.com/Lotka-VolterraEquations.html" - "Wikipedia" = "https://en.wikipedia.org/wiki/Lotka%E2%80%93Volterra_equations" - diff --git a/examples/lotka_volterra/model.modelica b/examples/lotka_volterra/model.modelica new file mode 100644 index 0000000..6f011a2 --- /dev/null +++ b/examples/lotka_volterra/model.modelica @@ -0,0 +1,11 @@ +model LotkaVolterra + parameter Real alpha; + parameter Real beta; + parameter Real delta; + parameter Real gamma; + Real x; + Real y; +equation + der(x) = (alpha * x) - (beta * x * y) + der(y) = (delta * x * y) - (gamma * y) +end LotkaVolterra; diff --git a/examples/lotka_volterra/page.md b/examples/lotka_volterra/page.md new file mode 100644 index 0000000..8b85919 --- /dev/null +++ b/examples/lotka_volterra/page.md @@ -0,0 +1,8 @@ + +This is a wikipage! + +## References + +* [Mathworld](http://mathworld.wolfram.com/Lotka-VolterraEquations.html) +* [Wikipedia](https://en.wikipedia.org/wiki/Lotka%E2%80%93Volterra_equations) + -- cgit v1.2.3