Skip to content

Commit 32f9aef

Browse files
authored
Merge pull request #1569 from SciML/myb/error_check
Use Connection from Symbolics
2 parents a2f3d70 + fad223b commit 32f9aef

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Setfield = "0.7, 0.8"
7373
SpecialFunctions = "0.7, 0.8, 0.9, 0.10, 1.0, 2"
7474
StaticArrays = "0.10, 0.11, 0.12, 1.0"
7575
SymbolicUtils = "0.19"
76-
Symbolics = "4.3"
76+
Symbolics = "4.5"
7777
UnPack = "0.1, 1.0"
7878
Unitful = "1.1"
7979
julia = "1.6"

src/ModelingToolkit.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ using Reexport
4545
export @derivatives
4646
using Symbolics: _parse_vars, value, @derivatives, get_variables,
4747
exprs_occur_in, solve_for, build_expr, unwrap, wrap,
48-
VariableSource, getname, variable
48+
VariableSource, getname, variable, Connection, connect,
49+
NAMESPACE_SEPARATOR
4950
import Symbolics: rename, get_variables!, _solve, hessian_sparsity,
5051
jacobian_sparsity, isaffine, islinear, _iszero, _isone,
5152
tosymbol, lower_varname, diff2term, var_from_nested_derivative,

src/systems/connectors.jl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,8 @@ function connector_type(sys::AbstractSystem)
5656
n_stream > 0 ? StreamConnector() : RegularConnector()
5757
end
5858

59-
struct Connection
60-
systems
61-
end
62-
Connection() = Connection(nothing)
6359
get_systems(c::Connection) = c.systems
6460

65-
# symbolic `connect`
66-
function connect(sys1::AbstractSystem, sys2::AbstractSystem, syss::AbstractSystem...)
67-
syss = (sys1, sys2, syss...)
68-
length(unique(nameof, syss)) == length(syss) || error("connect takes distinct systems!")
69-
Equation(Connection(), Connection(syss)) # the RHS are connected systems
70-
end
71-
7261
instream(a) = term(instream, unwrap(a), type=symtype(a))
7362
SymbolicUtils.promote_symtype(::typeof(instream), _) = Real
7463

0 commit comments

Comments
 (0)