Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into MTK
Browse files Browse the repository at this point in the history
  • Loading branch information
vyudu committed Nov 22, 2024
2 parents 9733460 + ac39aab commit d95e4a7
Show file tree
Hide file tree
Showing 43 changed files with 2,275 additions and 460 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@latest
with:
version: '1'
version: 'lts'
- run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
- name: Install dependencies
run: DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
Expand All @@ -31,8 +31,8 @@ jobs:
JULIA_DEBUG: "Documenter"
run: DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project=docs/ --code-coverage=user docs/make.jl
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
file: lcov.info
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
6 changes: 3 additions & 3 deletions .github/workflows/Downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ jobs:
exit(0) # Exit immediately, as a success
end
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
file: lcov.info
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
fail_ci_if_error: false
12 changes: 7 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ModelingToolkit"
uuid = "961ee093-0014-501f-94e3-6117800e7a78"
authors = ["Yingbo Ma <[email protected]>", "Chris Rackauckas <[email protected]> and contributors"]
version = "9.48.0"
version = "9.53.0"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand All @@ -21,6 +21,7 @@ Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
DomainSets = "5b8099bc-c8ec-5219-889f-1d9e522a28bf"
DynamicQuantities = "06fc5a27-2a28-4c7c-a15d-362465fb6821"
EnumX = "4e289a0a-7415-4d19-859d-a7e5c4648b56"
ExprTools = "e2ba6199-217a-4e67-a87a-7c52f15ade04"
Expronicon = "6b7a57c9-7cc1-4fdf-b7f5-e857abae3636"
FindFirstFunctions = "64ca27bc-2ba2-4a57-88aa-44e436879224"
Expand Down Expand Up @@ -94,6 +95,7 @@ Distributions = "0.23, 0.24, 0.25"
DocStringExtensions = "0.7, 0.8, 0.9"
DomainSets = "0.6, 0.7"
DynamicQuantities = "^0.11.2, 0.12, 0.13, 1"
EnumX = "1.0.4"
ExprTools = "0.1.10"
Expronicon = "0.8"
FindFirstFunctions = "1"
Expand All @@ -111,7 +113,7 @@ Libdl = "1"
LinearAlgebra = "1"
MLStyle = "0.4.17"
NaNMath = "0.3, 1"
NonlinearSolve = "3.14"
NonlinearSolve = "3.14, 4"
OffsetArrays = "1"
OrderedCollections = "1"
OrdinaryDiffEq = "6.82.0"
Expand All @@ -125,13 +127,13 @@ SciMLBase = "2.57.1"
SciMLStructures = "1.0"
Serialization = "1"
Setfield = "0.7, 0.8, 1"
SimpleNonlinearSolve = "0.1.0, 1"
SimpleNonlinearSolve = "0.1.0, 1, 2"
SparseArrays = "1"
SpecialFunctions = "0.7, 0.8, 0.9, 0.10, 1.0, 2"
StaticArrays = "0.10, 0.11, 0.12, 1.0"
SymbolicIndexingInterface = "0.3.31"
SymbolicIndexingInterface = "0.3.35"
SymbolicUtils = "3.7"
Symbolics = "6.15.2"
Symbolics = "6.19"
URIs = "1"
UnPack = "0.1, 1.0"
Unitful = "1.1"
Expand Down
6 changes: 3 additions & 3 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ Distributions = "0.25"
Documenter = "1"
DynamicQuantities = "^0.11.2, 0.12, 1"
ModelingToolkit = "8.33, 9"
NonlinearSolve = "3"
NonlinearSolve = "3, 4"
Optim = "1.7"
Optimization = "3.9"
OptimizationOptimJL = "0.1"
Optimization = "3.9, 4"
OptimizationOptimJL = "0.1, 0.4"
OrdinaryDiffEq = "6.31"
Plots = "1.36"
SciMLStructures = "1.1"
Expand Down
10 changes: 10 additions & 0 deletions docs/src/basics/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ parameter_index(sys, sym)
Note that while the variable index will be an integer, the parameter index is a struct of
type `ParameterIndex` whose internals should not be relied upon.

## Can I index with strings?

Strings are not considered symbolic variables, and thus cannot directly be used for symbolic
indexing. However, ModelingToolkit does provide a method to parse the string representation of
a variable, given the system in which that variable exists.

```@docs
ModelingToolkit.parse_variable
```

## Transforming value maps to arrays

ModelingToolkit.jl allows (and recommends) input maps like `[x => 2.0, y => 3.0]`
Expand Down
7 changes: 4 additions & 3 deletions docs/src/basics/MTKLanguage.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ julia> ModelingToolkit.getdefault(model_c1.v)
2.0
```

#### `@extend` begin block
#### `@extend` statement

Partial systems can be extended in a higher system in two ways:
One or more partial systems can be extended in a higher system with `@extend` statements. This can be done in two ways:

- `@extend PartialSystem(var1 = value1)`

Expand Down Expand Up @@ -313,7 +313,8 @@ end
- `:components`: The list of sub-components in the form of [[name, sub_component_name],...].
- `:constants`: Dictionary of constants mapped to its metadata.
- `:defaults`: Dictionary of variables and default values specified in the `@defaults`.
- `:extend`: The list of extended unknowns, name given to the base system, and name of the base system.
- `:extend`: The list of extended unknowns, parameters and components, name given to the base system, and name of the base system.
When multiple extend statements are present, latter two are returned as lists.
- `:structural_parameters`: Dictionary of structural parameters mapped to their metadata.
- `:parameters`: Dictionary of symbolic parameters mapped to their metadata. For
parameter arrays, length is added to the metadata as `:size`.
Expand Down
38 changes: 38 additions & 0 deletions docs/src/basics/Variable_metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,44 @@ hasbounds(u)
getbounds(u)
```

Bounds can also be specified for array variables. A scalar array bound is applied to each
element of the array. A bound may also be specified as an array, in which case the size of
the array must match the size of the symbolic variable.

```@example metadata
@variables x[1:2, 1:2] [bounds = (-1, 1)]
hasbounds(x)
```

```@example metadata
getbounds(x)
```

```@example metadata
getbounds(x[1, 1])
```

```@example metadata
getbounds(x[1:2, 1])
```

```@example metadata
@variables x[1:2] [bounds = (-Inf, [1.0, Inf])]
hasbounds(x)
```

```@example metadata
getbounds(x)
```

```@example metadata
getbounds(x[2])
```

```@example metadata
hasbounds(x[2])
```

## Guess

Specify an initial guess for custom initial conditions of an `ODESystem`.
Expand Down
Loading

0 comments on commit d95e4a7

Please sign in to comment.