Skip to content

Commit 39d2828

Browse files
Merge pull request #2890 from ven-k/vkb/mtk-lang
Rename `@mtkmodel`... docs and add a section describing `@mtkbuild`
2 parents 2ae7183 + de31b29 commit 39d2828

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed

docs/pages.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pages = [
2828
"basics/Composition.md",
2929
"basics/Events.md",
3030
"basics/Linearization.md",
31-
"basics/MTKModel_Connector.md",
31+
"basics/MTKLanguage.md",
3232
"basics/Validation.md",
3333
"basics/DependencyGraphs.md",
3434
"basics/Precompilation.md",

docs/src/basics/MTKModel_Connector.md renamed to docs/src/basics/MTKLanguage.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [Components and Connectors](@id mtkmodel_connector)
1+
# [ModelingToolkit Language: Modeling with `@mtkmodel`, `@connectors` and `@mtkbuild`](@id mtk_language)
22

33
## MTK Model
44

@@ -441,3 +441,31 @@ Using ternary operator or if-elseif-else statement, conditional initial guesses
441441
end
442442
end
443443
```
444+
445+
## Build structurally simplified models:
446+
447+
`@mtkbuild` builds an instance of a component and returns a structurally simplied `ODESystem`.
448+
449+
```julia
450+
@mtkbuild sys = CustomModel()
451+
```
452+
453+
This is equivalent to:
454+
455+
```julia
456+
@named model = CustomModel()
457+
sys = structural_simplify(model)
458+
```
459+
460+
Pass keyword arguments to `structural_simplify` using the following syntax:
461+
462+
```julia
463+
@mtkbuild sys=CustomModel() fully_determined=false
464+
```
465+
466+
This is equivalent to:
467+
468+
```julia
469+
@named model = CustomModel()
470+
sys = structural_simplify(model; fully_determined = false)
471+
```

docs/src/tutorials/ode_modeling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ Where to go next?
417417
- Not sure how MTK relates to similar tools and packages? Read
418418
[Comparison of ModelingToolkit vs Equation-Based and Block Modeling Languages](@ref).
419419
- For a more detailed explanation of `@mtkmodel` checkout
420-
[Defining components with `@mtkmodel` and connectors with `@connectors`](@ref mtkmodel_connector)
420+
[Defining components with `@mtkmodel` and connectors with `@connectors`](@ref mtk_language)
421421
- Depending on what you want to do with MTK, have a look at some of the other
422422
**Symbolic Modeling Tutorials**.
423423
- If you want to automatically convert an existing function to a symbolic

0 commit comments

Comments
 (0)