From 1af4d197b74e3e7f663987a2799fbfaf2bde9fdc Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Thu, 1 May 2025 16:17:07 +0530 Subject: [PATCH 1/3] docs: do not use `@mtkmodel System` in docs --- docs/src/connectors/sign_convention.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/src/connectors/sign_convention.md b/docs/src/connectors/sign_convention.md index 5ff277d5..4daf73f8 100644 --- a/docs/src/connectors/sign_convention.md +++ b/docs/src/connectors/sign_convention.md @@ -79,7 +79,7 @@ end Here we can see that a positive input force results in an increasing velocity. ```@example sign_convention -@mtkmodel System begin +@mtkmodel Model begin @components begin mass = Mass(; m = 10) force = ConstantForce(; f = 1) @@ -88,7 +88,7 @@ Here we can see that a positive input force results in an increasing velocity. connect(mass.flange, force.flange) end end -@mtkbuild sys = System() +@mtkbuild sys = Model() full_equations(sys) ``` @@ -117,7 +117,7 @@ end Here we can see that a positive input current results in an increasing voltage. Note that the electrical domain uses pins `p` and `n` at each side of the source and energy storage components. The direction of connection is not important here, only that a positive connector `p` connects with a negative connector `n`. ```@example sign_convention -@mtkmodel System begin +@mtkmodel Model begin @components begin capacitor = Capacitor(; C = 10) current = ConstantCurrent(; i = 1) @@ -128,14 +128,14 @@ Here we can see that a positive input current results in an increasing voltage. connect(capacitor.n, current.p, ground.g) end end -@mtkbuild sys = System() +@mtkbuild sys = Model() full_equations(sys) ``` Reversing the pins gives the same result ```@example sign_convention -@mtkmodel System begin +@mtkmodel Model begin @components begin capacitor = Capacitor(; C = 10) current = ConstantCurrent(; i = 1) @@ -146,7 +146,7 @@ Reversing the pins gives the same result connect(capacitor.p, current.n, ground.g) end end -@mtkbuild sys = System() +@mtkbuild sys = Model() full_equations(sys) ``` @@ -173,7 +173,7 @@ end A positive input mass flow leads to an increasing pressure (in this case we get increasing density (`rho`), which is directly related to an increasing pressure). ```@example sign_convention -@mtkmodel System begin +@mtkmodel Model begin @components begin volume = FixedVolume(; vol = 10.0, p_int = 1e5) flow = ConstantMassFlow(; dm = 1) @@ -184,6 +184,6 @@ A positive input mass flow leads to an increasing pressure (in this case we get connect(fluid, flow.port) end end -@mtkbuild sys = System() +@mtkbuild sys = Model() full_equations(sys) |> first ``` From 75977d27ab70eb94fc3802cd527aaa702e714b68 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Thu, 1 May 2025 16:21:28 +0530 Subject: [PATCH 2/3] refactor: format --- test/Thermal/thermal.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/Thermal/thermal.jl b/test/Thermal/thermal.jl index 8e53e34a..b9a8101d 100644 --- a/test/Thermal/thermal.jl +++ b/test/Thermal/thermal.jl @@ -29,7 +29,8 @@ using OrdinaryDiffEq: ReturnCode.Success # Check if Relative temperature sensor reads the temperature of heat capacitor # when connected to a thermal conductor and a fixed temperature source @test SciMLBase.successful_retcode(sol) - @test sol[reltem_sensor.T.u] + sol[tem_src.port.T] == sol[mass1.T] + sol[th_conductor.dT] + @test sol[reltem_sensor.T.u] + sol[tem_src.port.T] == + sol[mass1.T] + sol[th_conductor.dT] @info "Building a two-body system..." eqs = [connect(T_sensor1.port, mass1.port, th_conductor.port_a) From 462847d47a2e143611a03e54b75b55703f7e3a59 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Thu, 1 May 2025 17:32:33 +0530 Subject: [PATCH 3/3] docs: do not import `DifferentialEquations` in docs --- docs/Project.toml | 2 -- docs/src/connectors/connections.md | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/Project.toml b/docs/Project.toml index 75f8af50..028c9d22 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -2,7 +2,6 @@ ControlSystemsBase = "aaaaaaaa-a6ca-5380-bf3e-84a91bcd477e" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0" -DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78" @@ -14,7 +13,6 @@ Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" ControlSystemsBase = "1.1" DataFrames = "1.7" DataInterpolations = "6.4, 7, 8" -DifferentialEquations = "7.6" Documenter = "1" IfElse = "0.1" ModelingToolkit = "9" diff --git a/docs/src/connectors/connections.md b/docs/src/connectors/connections.md index 1e5a3270..52ac941b 100644 --- a/docs/src/connectors/connections.md +++ b/docs/src/connectors/connections.md @@ -89,7 +89,7 @@ We can generate the above relationship with ModelingToolkit and the ModelingTool As can be seen, this will give a 1 equation model matching our energy dissipation relationship ```@example connections -using ModelingToolkitStandardLibrary.Electrical, ModelingToolkit, DifferentialEquations +using ModelingToolkitStandardLibrary.Electrical, ModelingToolkit, OrdinaryDiffEq using ModelingToolkit: t_nounits as t using Plots