@@ -4,10 +4,18 @@ module Intrinsics
44 Scope, GenScope, ddt, epsilon
55
66 """
7- variable([name ])
7+ variable([scope ])
88
99 This intrinsic introduces a variable into the system of equations.
10- It is an intrinsic so it gets replaced by DAECompiler in the optimization pass.
10+ Optionally takes a `scope` that may be used to symbolically refer to this variable
11+ in solution objects. The passed `scope` never affects the semantics of the system.
12+ If two variables are given the same `scope`, they remain semantically separate
13+ (but a warning is generated and they cannot be accessed symbolically in solution objects).
14+
15+ Variables are not guaranteed to become part "states", i.e. of the integrator state
16+ given to the numerical integrator. DAECompiler will automatically generate appropriate
17+ accessors to re-constitute eliminated variables from the integrator state using the
18+ equations of the system.
1119 """
1220 function variable end
1321
@@ -28,10 +36,15 @@ module Intrinsics
2836 function observed! end
2937
3038 """
31- equation!(val, [name ])
39+ equation!(val, [scope ])
3240
33- This intrinsic marks an equation. Specifically, once the system is lowered to an SSA form,
34- equation! constrains the value of a given SSA variable to zero.
41+ This intrinsic marks an equation. The system of equations is considered satisfied when all
42+ `val`s passed to all `equation`s are equal to zero (up to tolerance).
43+
44+ Like all intrinsics, the `scope` argument is non-semantic and two `equation!` calls with
45+ the same `scope` will introduce separate equations. To build up one equation from multiple
46+ pieces, see the lower-level `equation` (no `!`) intrinsic. Note that `equation!(val, scope)`
47+ is equivalent to and implemented as `equation(scope)(val)`. It is provided for convenience.
3548 """
3649 function equation! end
3750
@@ -115,10 +128,12 @@ module Intrinsics
115128 end
116129
117130 """
118- ddt
131+ ddt(x)
119132
120- Exposes DAECompiler's demand-driven AD capabilities to user code. The return
121- value of the function is `d/dt` of its argument.
133+ This intrinsic takes the total derivative of its argument with respect to the systems
134+ independent variable (i.e. `sim_time()`). There are no special semantic restrictions
135+ on `x`, although any expression that contributes to it must be AD-able (e.g. have registered
136+ ChainRules).
122137 """
123138 function ddt end
124139
0 commit comments