From 5847c841cf89666790c39a639f25e4c50979475c Mon Sep 17 00:00:00 2001 From: tbeu Date: Fri, 31 May 2024 22:53:27 +0200 Subject: [PATCH] Add basic example demonstrating fixed and start attribute of state variable --- .../BasicEquations/SimpleExample/FirstOrderStart.mo | 7 +++++++ .../BasicEquations/SimpleExample/package.order | 1 + 2 files changed, 8 insertions(+) create mode 100644 ModelicaByExample/BasicEquations/SimpleExample/FirstOrderStart.mo diff --git a/ModelicaByExample/BasicEquations/SimpleExample/FirstOrderStart.mo b/ModelicaByExample/BasicEquations/SimpleExample/FirstOrderStart.mo new file mode 100644 index 00000000..017d3183 --- /dev/null +++ b/ModelicaByExample/BasicEquations/SimpleExample/FirstOrderStart.mo @@ -0,0 +1,7 @@ +within ModelicaByExample.BasicEquations.SimpleExample; +model FirstOrderStart "First order equation with fixed start value" + Real x(start=x_start, fixed=true) "State variable"; + parameter Real x_start=2 "Start value"; +equation + der(x) = 1-x "Drives value of x toward 1.0"; +end FirstOrderStart; diff --git a/ModelicaByExample/BasicEquations/SimpleExample/package.order b/ModelicaByExample/BasicEquations/SimpleExample/package.order index 895d9bbf..f99ff23e 100644 --- a/ModelicaByExample/BasicEquations/SimpleExample/package.order +++ b/ModelicaByExample/BasicEquations/SimpleExample/package.order @@ -1,5 +1,6 @@ FirstOrder FirstOrderDocumented FirstOrderInitial +FirstOrderStart FirstOrderExperiment FirstOrderSteady