Skip to content
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

refactor: use default t and D from MTKv9 #256

Closed
wants to merge 80 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
c8d697c
units of analog
ven-k Aug 23, 2023
2a1741e
metadata(components): adds units to Magnetic/FluxTubes components
ven-k Aug 25, 2023
38a4db7
metadata(components): adds units and descriptions to Rotational compo…
ven-k Aug 25, 2023
3122a2e
metadata(components): adds units and descriptions to TranslationalPos…
ven-k Aug 28, 2023
b4d2c9e
f: magnetic
ven-k Sep 4, 2023
6af0dc6
refactor: add units and descriptions to Blocks
ven-k Feb 9, 2024
12160bf
refactor: update Electrical components with units and description
ven-k Feb 9, 2024
ea1ca36
refactor: update Rotational components with units and description
ven-k Feb 9, 2024
a5f4ea4
refactor: update Translational components with units and description
ven-k Feb 9, 2024
d6f48ec
refactor: update TranslationalModelica components with units and desc…
ven-k Feb 9, 2024
d27f3f9
refactor: update Thermal components with units and description
ven-k Feb 9, 2024
1ad657a
refactor: update TranslationalPosition components with units and desc…
ven-k Feb 9, 2024
c345e6e
refactor: update MultiBody components with units and description
ven-k Feb 9, 2024
17dc7cb
feat: register new units
ven-k Feb 9, 2024
e8e6a58
fixup! electrical
ven-k Feb 9, 2024
46ee19f
refactor: update Magnetic components with units and description
ven-k Feb 9, 2024
2847d45
test: update multi-domain circuit
ven-k Feb 9, 2024
c37216b
refactor: kwargs of base system are now kwargs of main component
ven-k Aug 14, 2023
e5c3ab7
refactor: set `use_support` to false
ven-k Aug 14, 2023
540c246
Use lowest order differentiated variables to improve state selection
YingboMa Aug 21, 2023
c9a8a7d
Add initial condition for Fixed
YingboMa Aug 21, 2023
9f598eb
Fix MatrixGain
YingboMa Aug 21, 2023
c46369d
Update tests
YingboMa Aug 22, 2023
5a93249
Update tests and fix use_support support
YingboMa Aug 22, 2023
0af312d
Update Project.toml
YingboMa Aug 22, 2023
b94a8cc
refactor: use `@structural_parameters` to pass functions to `StaticNo…
ven-k Aug 31, 2023
484476f
docs: Translational.Mass: `s_0` -> `s`
ven-k Sep 4, 2023
9f3da71
chore: bump MTK bound to 8.67
ven-k Sep 5, 2023
53c02a6
chore: bump version to v2.3.0
ven-k Sep 5, 2023
e95af50
Update Project.toml
baggepinnen Sep 5, 2023
f5adb7d
chore(deps): bump actions/checkout from 3 to 4
dependabot[bot] Sep 11, 2023
2c2c200
changes for ModelingToolkit tuple parameters
Sep 13, 2023
57d365c
format
Sep 13, 2023
9556b0a
bug fix
Sep 14, 2023
0ad16df
Format
YingboMa Sep 14, 2023
6d797b6
Update to the latest MTK
YingboMa Sep 16, 2023
a961765
Update Project.toml
YingboMa Sep 16, 2023
614f046
Documenter 1.0 upgrade
ArnoStrouwen Sep 25, 2023
3e2a548
avoid using array variable
baggepinnen Sep 25, 2023
5335e35
Update Project.toml
baggepinnen Sep 26, 2023
ed33f5d
Fix heterogeneous parameters handling for `linearize_function`
YingboMa Sep 26, 2023
e0f851f
Relax tests
YingboMa Sep 26, 2023
4867183
Update Project.toml
YingboMa Sep 26, 2023
ace8565
add info annotation with common mistake
baggepinnen Sep 29, 2023
437487d
improve docstring and interface to PI controller
baggepinnen Oct 3, 2023
f612f7a
format
baggepinnen Oct 3, 2023
c420a51
Update continuous.jl
baggepinnen Oct 3, 2023
9027bba
Fix frule
oxinabox Oct 3, 2023
da7e3f2
Update Project.toml
YingboMa Oct 4, 2023
c246fb8
initialize all relevant variables for SISO
baggepinnen Oct 3, 2023
6424517
nicify some docstrings and descriptions
baggepinnen Oct 17, 2023
1d668cc
fixes free test
Oct 25, 2023
647b811
add generic transfer function (#233)
baggepinnen Oct 26, 2023
6548133
add TransferFunction to API page (#238)
baggepinnen Oct 28, 2023
9f8dcc7
typos ci
ArnoStrouwen Dec 13, 2023
baa5458
Aqua CI
ArnoStrouwen Dec 13, 2023
a651e19
chore(deps): bump actions/checkout from 3 to 4
dependabot[bot] Dec 14, 2023
4b885b9
Downgrade CI
ArnoStrouwen Jan 3, 2024
2fc90bc
chore(deps): bump crate-ci/typos from 1.16.23 to 1.17.0
dependabot[bot] Jan 8, 2024
9fc09c0
chore(deps): bump actions/cache from 3 to 4
dependabot[bot] Jan 22, 2024
a55b6bf
typo: misnamed C2.v
Jan 24, 2024
111dce7
chore(deps): bump codecov/codecov-action from 3 to 4
dependabot[bot] Feb 5, 2024
937e139
chore(deps): bump crate-ci/typos from 1.17.0 to 1.18.0
dependabot[bot] Feb 5, 2024
d094af5
[skip ci] Update dependabot.yml
ArnoStrouwen Feb 6, 2024
439a691
ci: explicitly specify token for codecov
thazhemadam Feb 9, 2024
c16e05d
ci: explicitly specify token for codecov
thazhemadam Feb 9, 2024
49dbdd8
[skip ci] update downgrade CI repo
ArnoStrouwen Feb 18, 2024
aa98f86
Define `isconnection` on AnalysisPoint
YingboMa Feb 5, 2024
875d870
Format
YingboMa Feb 5, 2024
f07aa73
Format and fix AnalysisPoint
YingboMa Feb 21, 2024
506f1ad
Implement `hash` for AnalysisPoint
YingboMa Feb 21, 2024
d4ae037
Add broadcast support
YingboMa Feb 21, 2024
7502efe
Fix CI
YingboMa Feb 22, 2024
d4c27ff
Fix broken tests
YingboMa Feb 22, 2024
b65c467
Update Project.toml
YingboMa Feb 22, 2024
9381c29
metadata(components): adds units to Magnetic/FluxTubes components
ven-k Aug 25, 2023
8fdad94
metadata(components): adds units and descriptions to Rotational compo…
ven-k Aug 25, 2023
0ced536
refactor: use default t and D from MTKv9
AayushSabharwal Feb 2, 2024
07c65c8
refactor: use `unknowns`, fix some tests
AayushSabharwal Feb 14, 2024
51b9bf5
refactor: add DynamicQuantities
AayushSabharwal Feb 22, 2024
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
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
ignore:
- dependency-name: "crate-ci/typos"
update-types: ["version-update:semver-patch", "version-update:semver-minor"]
13 changes: 9 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ on:
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'
push:
branches:
- main
paths-ignore:
- 'docs/**'
jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -15,13 +19,12 @@ jobs:
- All
version:
- '1'
- '1.6'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
- uses: actions/cache@v3
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
Expand All @@ -34,6 +37,8 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
file: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
4 changes: 2 additions & 2 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@latest
with:
version: '1'
Expand All @@ -23,6 +23,6 @@ jobs:
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
run: julia --project=docs/ --code-coverage=user docs/make.jl
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
file: lcov.info
29 changes: 29 additions & 0 deletions .github/workflows/Downgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Downgrade
on:
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'
push:
branches:
- main
paths-ignore:
- 'docs/**'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['1']
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
- uses: julia-actions/julia-downgrade-compat@v1
# if: ${{ matrix.version == '1.6' }}
with:
skip: Pkg,TOML
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
10 changes: 6 additions & 4 deletions .github/workflows/Downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ jobs:
strategy:
fail-fast: false
matrix:
julia-version: [1,1.6]
julia-version: [1]
os: [ubuntu-latest]
package:
- {user: SciML, repo: ModelingToolkit.jl}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}
arch: x64
- uses: julia-actions/julia-buildpkg@latest
- name: Clone Downstream
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ matrix.package.user }}/${{ matrix.package.repo }}
path: downstream
Expand All @@ -48,6 +48,8 @@ jobs:
exit(0) # Exit immediately, as a success
end
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
file: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
4 changes: 2 additions & 2 deletions .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: format-check
on:
push:
branches:
- 'master'
- 'main'
- 'release-'
tags: '*'
pull_request:
Expand All @@ -21,7 +21,7 @@ jobs:
with:
version: ${{ matrix.julia-version }}

- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install JuliaFormatter and format
# This will use the latest version by default but you can set the version like so:
#
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/Invalidations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-invalidations@v1
id: invs_pr

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }}
- uses: julia-actions/julia-buildpkg@v1
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/SpellCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Spell Check

on: [pull_request]

jobs:
typos-check:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/[email protected]
4 changes: 4 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[default.extend-words]
Nd = "Nd"
nin = "nin"
coul = "coul"
21 changes: 15 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
name = "ModelingToolkitStandardLibrary"
uuid = "16a59e39-deab-5bd0-87e4-056b12336739"
authors = ["Chris Rackauckas and Julia Computing"]
version = "2.1.1"
version = "2.3.5"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
DynamicQuantities = "06fc5a27-2a28-4c7c-a15d-362465fb6821"
IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"

[compat]
Aqua = "0.8"
ChainRulesCore = "1"
DiffEqBase = "6"
ControlSystemsBase = "1"
DataInterpolations = "4"
DiffEqBase = "6.103"
IfElse = "0.1"
ModelingToolkit = "8.50"
Symbolics = "4.9, 5"
julia = "1.6"
LinearAlgebra = "1.10"
ModelingToolkit = "8.69"
OrdinaryDiffEq = "6.33"
SafeTestsets = "0.1"
Symbolics = "5.2"
Test = "1"
julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
ControlSystemsBase = "aaaaaaaa-a6ca-5380-bf3e-84a91bcd477e"
DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -28,4 +37,4 @@ SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["LinearAlgebra", "OrdinaryDiffEq", "SafeTestsets", "Test", "ControlSystemsBase", "DataInterpolations"]
test = ["Aqua", "LinearAlgebra", "OrdinaryDiffEq", "SafeTestsets", "Test", "ControlSystemsBase", "DataInterpolations"]
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ the documentation, which contains the unreleased features.

## Libraries

The following are the constituant libraries of the ModelingToolkit Standard Library.
The following are the constituent libraries of the ModelingToolkit Standard Library.

- [Basic Blocks](https://docs.sciml.ai/ModelingToolkitStandardLibrary/stable/API/blocks/)
- [Mechanical Components](https://docs.sciml.ai/ModelingToolkitStandardLibrary/stable/API/mechanical/)
Expand Down Expand Up @@ -60,9 +60,9 @@ V = 1.0
@named ground = Ground()

rc_eqs = [connect(constant.output, source.V)
connect(source.p, resistor.p)
connect(resistor.n, capacitor.p)
connect(capacitor.n, source.n, ground.g)]
connect(source.p, resistor.p)
connect(resistor.n, capacitor.p)
connect(capacitor.n, source.n, ground.g)]

@named rc_model = ODESystem(rc_eqs, t,
systems = [resistor, capacitor, constant, source, ground])
Expand Down
5 changes: 2 additions & 3 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
[compat]
ControlSystemsBase = "1.1"
DifferentialEquations = "7.6"
Documenter = "0.27"
Documenter = "1"
IfElse = "0.1"
ModelingToolkit = "8"
ModelingToolkitStandardLibrary = "2"
ModelingToolkit = "8.67"
OrdinaryDiffEq = "6.31"
Plots = "1.36"
10 changes: 2 additions & 8 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ include("pages.jl")

makedocs(sitename = "ModelingToolkitStandardLibrary.jl",
authors = "Julia Computing",
clean = true,
doctest = false,
linkcheck = true,
strict = [
:linkcheck,
:doctest,
:example_block,
],
modules = [ModelingToolkit,
ModelingToolkitStandardLibrary,
ModelingToolkitStandardLibrary.Blocks,
Expand All @@ -38,6 +30,8 @@ makedocs(sitename = "ModelingToolkitStandardLibrary.jl",
ModelingToolkitStandardLibrary.Thermal,
ModelingToolkitStandardLibrary.Hydraulic,
ModelingToolkitStandardLibrary.Hydraulic.IsothermalCompressible],
clean = true, doctest = false, linkcheck = true,
warnonly = [:docs_block, :missing_docs, :cross_references],
format = Documenter.HTML(assets = ["assets/favicon.ico"],
canonical = "https://docs.sciml.ai/ModelingToolkitStandardLibrary/stable/"),
pages = pages)
Expand Down
6 changes: 3 additions & 3 deletions docs/pages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pages = [
"Custom Components" => "tutorials/custom_component.md",
"Thermal Conduction Model" => "tutorials/thermal_model.md",
"DC Motor with Speed Controller" => "tutorials/dc_motor_pi.md",
"SampledData Component" => "tutorials/input_component.md",
"SampledData Component" => "tutorials/input_component.md"
],
"About Acausal Connections" => "connectors/connections.md",
"API" => [
Expand All @@ -15,6 +15,6 @@ pages = [
"Mechanical Components" => "API/mechanical.md",
"Thermal Components" => "API/thermal.md",
"Hydraulic Components" => "API/hydraulic.md",
"Linear Analysis" => "API/linear_analysis.md",
],
"Linear Analysis" => "API/linear_analysis.md"
]
]
1 change: 1 addition & 0 deletions docs/src/API/blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Derivative
FirstOrder
SecondOrder
StateSpace
TransferFunction
PI
LimPI
PID
Expand Down
2 changes: 1 addition & 1 deletion docs/src/API/linear_analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ using ModelingToolkitStandardLibrary.Blocks, ModelingToolkit
@named C = Gain(-1) # A P controller
t = ModelingToolkit.get_iv(P)
eqs = [connect(P.output, :plant_output, C.input) # Connect with an automatically created analysis point called :plant_output
connect(C.output, :plant_input, P.input)]
connect(C.output, :plant_input, P.input)]
sys = ODESystem(eqs, t, systems = [P, C], name = :feedback_system)

matrices_S = get_sensitivity(sys, :plant_input)[1] # Compute the matrices of a state-space representation of the (input)sensitivity function.
Expand Down
11 changes: 5 additions & 6 deletions docs/src/connectors/connections.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,15 @@ As can be seen, this will give a 1 equation model matching our energy dissipatio

```@example connections
using ModelingToolkitStandardLibrary.Electrical, ModelingToolkit, DifferentialEquations
using ModelingToolkit: t, D
using Plots

@parameters t

@named resistor = Resistor(R = 1)
@named capacitor = Capacitor(C = 1)
@named ground = Ground()

eqs = [connect(capacitor.p, resistor.p)
connect(resistor.n, ground.g, capacitor.n)]
connect(resistor.n, ground.g, capacitor.n)]

@named model = ODESystem(eqs, t; systems = [resistor, capacitor, ground])

Expand Down Expand Up @@ -139,7 +138,7 @@ const TV = ModelingToolkitStandardLibrary.Mechanical.Translational
@named ground = TV.Fixed()

eqs = [connect(damping.flange_a, body.flange)
connect(ground.flange, damping.flange_b)]
connect(ground.flange, damping.flange_b)]

@named model = ODESystem(eqs, t; systems = [damping, body, ground])

Expand Down Expand Up @@ -172,7 +171,7 @@ const TP = ModelingToolkitStandardLibrary.Mechanical.TranslationalPosition
@named ground = TP.Fixed(s_0 = 0)

eqs = [connect(damping.flange_a, body.flange)
connect(ground.flange, damping.flange_b)]
connect(ground.flange, damping.flange_b)]

@named model = ODESystem(eqs, t; systems = [damping, body, ground])

Expand Down Expand Up @@ -267,7 +266,7 @@ Let's define a quick function to simplify and solve the 2 different systems. Not
```@example connections
function simplify_and_solve(damping, spring, body, ground)
eqs = [connect(spring.flange_a, body.flange, damping.flange_a)
connect(spring.flange_b, damping.flange_b, ground.flange)]
connect(spring.flange_b, damping.flange_b, ground.flange)]

@named model = ODESystem(eqs, t; systems = [ground, body, spring, damping])

Expand Down
Loading