@@ -151,13 +151,33 @@ completely ignore it. Next, whether it will be ignored is also hard
151
151
to predict since different tools may make different choices about
152
152
which variables to treat as states.
153
153
154
- Finally, the ``start `` attribute is also "overloaded". This means
155
- that it is actually used for two different things. If the variable in
156
- question is not a state, but is instead an "iteration variable"
157
- (*i.e. *, a variable whose solution depends on a non-linear system of
158
- equations), then the ``start `` attribute may be used by a Modelica
159
- compiler as an initial guess (*i.e. *, the value used for the variable
160
- during the initial iteration of the non-linear solver).
154
+ One way to avoid both of these disadvantages is to use the ``fixed ``
155
+ attribute (also discussed in the section on :ref: `builtin-types `).
156
+ The ``fixed `` attribute can be used to tell the compiler that the
157
+ start attribute **must ** be used as an initial condition. In other
158
+ words, an ``initial equation `` like this:
159
+
160
+ .. code-block :: modelica
161
+
162
+ Real x;
163
+ initial equation
164
+ x = 5;
165
+
166
+ is equivalent to the following declaration utilizing the ``start `` and
167
+ ``fixed `` attributes:
168
+
169
+ .. code-block :: modelica
170
+
171
+ Real x(start=5, fixed=true);
172
+
173
+ Finally, one additional complication is that the ``start `` attribute
174
+ is also "overloaded". This means that it is actually used for two
175
+ different things. If the variable in question is not a state, but is
176
+ instead an "iteration variable" (*i.e. *, a variable whose solution
177
+ depends on a non-linear system of equations), then the ``start ``
178
+ attribute may be used by a Modelica compiler as an initial guess
179
+ (*i.e. *, the value used for the variable during the initial iteration
180
+ of the non-linear solver).
161
181
162
182
Whether to specify a ``start `` attribute or not depends on how
163
183
strictly you want a given initial condition to be enforced. Knowing
0 commit comments