Skip to content

docs: fix docs #389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/connectors/connections.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 8 additions & 8 deletions docs/src/connectors/sign_convention.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
```

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
```

Expand All @@ -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)
Expand All @@ -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
```
3 changes: 2 additions & 1 deletion test/Thermal/thermal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading