aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2016-09-16 20:45:22 -0700
committerbnewbold <bnewbold@robocracy.org>2016-09-16 20:45:22 -0700
commitfdebceb92fe819cdcfeb9c1288102f3b97ab3ff6 (patch)
treefde73c0ddf13becc2dc686c6703e34ad69785cef
parent7b29df28d3fd18cf6118862ef0cc2a88c1e3c803 (diff)
downloadmodelthing-fdebceb92fe819cdcfeb9c1288102f3b97ab3ff6.tar.gz
modelthing-fdebceb92fe819cdcfeb9c1288102f3b97ab3ff6.zip
update format of initial examples
-rw-r--r--examples/classic_gravitation/metadata.toml15
-rw-r--r--examples/classic_gravitation/model.modelica9
-rw-r--r--examples/classic_gravitation/page.md9
-rw-r--r--examples/lotka_volterra/metadata.toml17
-rw-r--r--examples/lotka_volterra/model.modelica11
-rw-r--r--examples/lotka_volterra/page.md8
6 files changed, 38 insertions, 31 deletions
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)
+