You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Partial systems can be extended in a higher system as `@extend PartialSystem(; kwargs)`.
153
-
- Keyword arguments pf partial system in the `@extend` definition are added as the keyword arguments of the base system.
154
-
- Note that in above example, `p1` is promoted as an argument of `ModelC`. Users can set the value of `p1`. However, as `p2` isn't listed in the model definition, its initial guess can't be specified while creating an instance of `ModelC`.
152
+
Partial systems can be extended in a higher system in two ways:
155
153
156
-
```julia
157
-
julia>@mtkbuild model_c2 =ModelC(; p1 =2.0)
154
+
-`@extend PartialSystem(var1 = value1)`
155
+
156
+
+ This is the recommended way of extending a base system.
157
+
+ The default values for the arguments of the base system can be declared in the `@extend` statement.
158
+
+ Note that all keyword arguments of the base system are added as the keyword arguments of the main system.
+ In this method: explicitly list the variables that should be unpacked, provide a name for the partial system and declare the base system.
163
+
+ Note that only the arguments listed out in the declaration of the base system (here: `var1`) are added as the keyword arguments of the higher system.
160
164
161
165
#### `@components` begin block
162
166
@@ -325,11 +329,11 @@ For example, the structure of `ModelC` is:
0 commit comments