diff --git a/docs/pages.jl b/docs/pages.jl index ff499177bf..a58d1dcf1a 100644 --- a/docs/pages.jl +++ b/docs/pages.jl @@ -28,7 +28,7 @@ pages = [ "basics/Composition.md", "basics/Events.md", "basics/Linearization.md", - "basics/MTKModel_Connector.md", + "basics/MTKLanguage.md", "basics/Validation.md", "basics/DependencyGraphs.md", "basics/Precompilation.md", diff --git a/docs/src/basics/MTKModel_Connector.md b/docs/src/basics/MTKLanguage.md similarity index 96% rename from docs/src/basics/MTKModel_Connector.md rename to docs/src/basics/MTKLanguage.md index 7b92e19ceb..a2fb7d0870 100644 --- a/docs/src/basics/MTKModel_Connector.md +++ b/docs/src/basics/MTKLanguage.md @@ -1,4 +1,4 @@ -# [Components and Connectors](@id mtkmodel_connector) +# [ModelingToolkit Language: Modeling with `@mtkmodel`, `@connectors` and `@mtkbuild`](@id mtk_language) ## MTK Model @@ -441,3 +441,31 @@ Using ternary operator or if-elseif-else statement, conditional initial guesses end end ``` + +## Build structurally simplified models: + +`@mtkbuild` builds an instance of a component and returns a structurally simplied `ODESystem`. + +```julia +@mtkbuild sys = CustomModel() +``` + +This is equivalent to: + +```julia +@named model = CustomModel() +sys = structural_simplify(model) +``` + +Pass keyword arguments to `structural_simplify` using the following syntax: + +```julia +@mtkbuild sys=CustomModel() fully_determined=false +``` + +This is equivalent to: + +```julia +@named model = CustomModel() +sys = structural_simplify(model; fully_determined = false) +``` diff --git a/docs/src/tutorials/ode_modeling.md b/docs/src/tutorials/ode_modeling.md index 2448f88ac6..86ac9b0850 100644 --- a/docs/src/tutorials/ode_modeling.md +++ b/docs/src/tutorials/ode_modeling.md @@ -417,7 +417,7 @@ Where to go next? - Not sure how MTK relates to similar tools and packages? Read [Comparison of ModelingToolkit vs Equation-Based and Block Modeling Languages](@ref). - For a more detailed explanation of `@mtkmodel` checkout - [Defining components with `@mtkmodel` and connectors with `@connectors`](@ref mtkmodel_connector) + [Defining components with `@mtkmodel` and connectors with `@connectors`](@ref mtk_language) - Depending on what you want to do with MTK, have a look at some of the other **Symbolic Modeling Tutorials**. - If you want to automatically convert an existing function to a symbolic