Skip to content

Commit 9237e47

Browse files
authored
Merge branch 'SciML:master' into iss3707
2 parents 4f0753c + 4d65458 commit 9237e47

File tree

95 files changed

+1236
-699
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+1236
-699
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ModelingToolkit"
22
uuid = "961ee093-0014-501f-94e3-6117800e7a78"
33
authors = ["Yingbo Ma <[email protected]>", "Chris Rackauckas <[email protected]> and contributors"]
4-
version = "10.8.0"
4+
version = "10.10.0"
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
@@ -130,7 +130,7 @@ LabelledArrays = "1.3"
130130
Latexify = "0.11, 0.12, 0.13, 0.14, 0.15, 0.16"
131131
Libdl = "1"
132132
LinearAlgebra = "1"
133-
LinearSolve = "3"
133+
LinearSolve = "3.19.2"
134134
Logging = "1"
135135
MLStyle = "0.4.17"
136136
ModelingToolkitStandardLibrary = "2.20"

docs/src/API/variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ For systems that contain parameters with metadata like described above, have som
293293
In the example below, we define a system with tunable parameters and extract bounds vectors
294294

295295
```@example metadata
296-
@variables x(t)=0 u(t)=0 [input = true] y(t)=0 [output = true]
296+
@variables x(t)=0 u(t)=0 [input=true] y(t)=0 [output=true]
297297
@parameters T [tunable = true, bounds = (0, Inf)]
298298
@parameters k [tunable = true, bounds = (0, Inf)]
299299
eqs = [D(x) ~ (-x + k * u) / T # A first-order system with time constant T and gain k

docs/src/basics/Events.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ The basic purely symbolic continuous event interface to encode *one* continuous
9292
event is
9393

9494
```julia
95-
AbstractSystem(eqs, ...; continuous_events::Vector{Equation})
96-
AbstractSystem(eqs, ...; continuous_events::Pair{Vector{Equation}, Vector{Equation}})
95+
AbstractSystem(eqs, _...; continuous_events::Vector{Equation})
96+
AbstractSystem(eqs, _...; continuous_events::Pair{Vector{Equation}, Vector{Equation}})
9797
```
9898

9999
In the former, equations that evaluate to 0 will represent conditions that should
@@ -272,7 +272,7 @@ In addition to continuous events, discrete events are also supported. The
272272
general interface to represent a collection of discrete events is
273273

274274
```julia
275-
AbstractSystem(eqs, ...; discrete_events = [condition1 => affect1, condition2 => affect2])
275+
AbstractSystem(eqs, _...; discrete_events = [condition1 => affect1, condition2 => affect2])
276276
```
277277

278278
where conditions are symbolic expressions that should evaluate to `true` when an
@@ -497,7 +497,8 @@ so far we aren't using anything that's not possible with the implicit interface.
497497
You can also write
498498

499499
```julia
500-
[temp ~ furnace_off_threshold] => ModelingToolkit.ImperativeAffect(modified = (;
500+
[temp ~
501+
furnace_off_threshold] => ModelingToolkit.ImperativeAffect(modified = (;
501502
furnace_on)) do x, o, i, c
502503
@set! x.furnace_on = false
503504
end

docs/src/basics/FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ The same principle applies to any parameter type that is not `Float64`.
6363
@parameters p1::Int # integer-valued
6464
@parameters p2::Bool # boolean-valued
6565
@parameters p3::MyCustomStructType # non-numeric
66-
@parameters p4::ComponentArray{...} # non-standard array
66+
@parameters p4::ComponentArray{_...} # non-standard array
6767
```
6868

6969
## Getting the index for a symbol

docs/src/basics/MTKLanguage.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,8 @@ Refer the following example for different ways to define symbolic arrays.
381381
@parameters begin
382382
p1[1:4]
383383
p2[1:N]
384-
p3[1:N, 1:M] = 10,
384+
p3[1:N,
385+
1:M] = 10,
385386
[description = "A multi-dimensional array of arbitrary length with description"]
386387
(p4[1:N, 1:M] = 10),
387388
[description = "An alternate syntax for p3 to match the syntax of vanilla parameters macro"]

docs/src/basics/Validation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function ModelingToolkit.get_unit(op::typeof(dummycomplex), args)
108108
end
109109
110110
sts = @variables a(t)=0 [unit = u"cm"]
111-
ps = @parameters s=-1 [unit = u"cm"] c=c [unit = u"cm"]
111+
ps = @parameters s=-1 [unit=u"cm"] c=c [unit=u"cm"]
112112
eqs = [D(a) ~ dummycomplex(c, s);]
113113
sys = System(
114114
eqs, t, [sts...;], [ps...;], name = :sys, checks = ~ModelingToolkit.CheckUnits)

docs/src/examples/perturbation.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ sol = solve(prob)
9999
plot(sol, idxs = substitute(x_series, ϵ => 0.1); label = "Perturbative (ϵ=0.1)")
100100
101101
x_exact(t, ϵ) = exp(-ϵ * t) * sin(√(1 - ϵ^2) * t) / √(1 - ϵ^2)
102-
@assert isapprox(sol(π/2; idxs = substitute(x_series, ϵ => 0.1)), x_exact(π/2, 0.1); atol = 1e-2) # compare around 1st peak # hide
102+
@assert isapprox(
103+
sol(π/2; idxs = substitute(x_series, ϵ => 0.1)), x_exact(π/2, 0.1); atol = 1e-2) # compare around 1st peak # hide
103104
plot!(sol.t, x_exact.(sol.t, 0.1); label = "Exact (ϵ=0.1)")
104105
```
105106

docs/src/examples/sparse_jacobians.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,20 @@ function brusselator_2d_loop(du, u, p, t)
2323
@inbounds for I in CartesianIndices((N, N))
2424
i, j = Tuple(I)
2525
x, y = xyd_brusselator[I[1]], xyd_brusselator[I[2]]
26-
ip1, im1, jp1, jm1 = limit(i + 1, N), limit(i - 1, N), limit(j + 1, N),
26+
ip1, im1, jp1,
27+
jm1 = limit(i + 1, N), limit(i - 1, N), limit(j + 1, N),
2728
limit(j - 1, N)
28-
du[i, j, 1] = alpha * (u[im1, j, 1] + u[ip1, j, 1] + u[i, jp1, 1] + u[i, jm1, 1] -
29-
4u[i, j, 1]) +
30-
B + u[i, j, 1]^2 * u[i, j, 2] - (A + 1) * u[i, j, 1] +
31-
brusselator_f(x, y, t)
32-
du[i, j, 2] = alpha * (u[im1, j, 2] + u[ip1, j, 2] + u[i, jp1, 2] + u[i, jm1, 2] -
33-
4u[i, j, 2]) +
34-
A * u[i, j, 1] - u[i, j, 1]^2 * u[i, j, 2]
29+
du[i,
30+
j,
31+
1] = alpha * (u[im1, j, 1] + u[ip1, j, 1] + u[i, jp1, 1] + u[i, jm1, 1] -
32+
4u[i, j, 1]) +
33+
B + u[i, j, 1]^2 * u[i, j, 2] - (A + 1) * u[i, j, 1] +
34+
brusselator_f(x, y, t)
35+
du[i,
36+
j,
37+
2] = alpha * (u[im1, j, 2] + u[ip1, j, 2] + u[i, jp1, 2] + u[i, jm1, 2] -
38+
4u[i, j, 2]) +
39+
A * u[i, j, 1] - u[i, j, 1]^2 * u[i, j, 2]
3540
end
3641
end
3742
p = (3.4, 1.0, 10.0, step(xyd_brusselator))

docs/src/examples/tearing_parallelism.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ using ModelingToolkit: t_nounits as t, D_nounits as D
1515
1616
# Basic electric components
1717
@connector function Pin(; name)
18-
@variables v(t)=1.0 i(t)=1.0 [connect = Flow]
18+
@variables v(t)=1.0 i(t)=1.0 [connect=Flow]
1919
System(Equation[], t, [v, i], [], name = name)
2020
end
2121
@@ -36,7 +36,7 @@ function ConstantVoltage(; name, V = 1.0)
3636
end
3737
3838
@connector function HeatPort(; name)
39-
@variables T(t)=293.15 Q_flow(t)=0.0 [connect = Flow]
39+
@variables T(t)=293.15 Q_flow(t)=0.0 [connect=Flow]
4040
System(Equation[], t, [T, Q_flow], [], name = name)
4141
end
4242

docs/src/tutorials/disturbance_modeling.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ disturbance_inputs = [ssys.d1, ssys.d2]
188188
P = ssys.system_model
189189
outputs = [P.inertia1.phi, P.inertia2.phi, P.inertia1.w, P.inertia2.w]
190190
191-
(f_oop, f_ip), x_sym, p_sym, io_sys = ModelingToolkit.generate_control_function(
191+
(f_oop, f_ip), x_sym,
192+
p_sym,
193+
io_sys = ModelingToolkit.generate_control_function(
192194
model_with_disturbance, inputs, disturbance_inputs; disturbance_argument = true)
193195
194196
g = ModelingToolkit.build_explicit_observed_function(

0 commit comments

Comments
 (0)