You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Blocks/analysis_points.jl
+15-5Lines changed: 15 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -84,9 +84,13 @@ function Base.show(io::IO, ::MIME"text/plain", ap::AnalysisPoint)
84
84
end
85
85
end
86
86
87
+
_isinput(x) = x isa ODESystem &&endswith(string(nameof(x)), "input")
88
+
_isoutput(x) = x isa ODESystem &&endswith(string(nameof(x)), "output")
89
+
ap_warning(n) =@warn"The $(n ==1?"first":"third") argument to a connection with an analysis point was a $(n ==1?"RealInput":"RealOutput"). This is supported in order to handle inverse models, but may not be what you intended. If you are building a forward model (causal), you may want to swap the first and the third arguments to connect. Learn more about the causality of analysis points in the docstring for AnalysisPoint. Silence this message by connect(out, :name, in; verbose = false)"
Connect `output_connector` and `input_connector` with an [`AnalysisPoint`](@ref) inbetween.
92
96
The incoming connection `output_connector` is expected to be of type [`RealOutput`](@ref), and vice versa.
@@ -105,19 +109,25 @@ typically is not (unless the model is an inverse model).
105
109
- `input_connector`: A connector of type [`RealInput`](@ref)
106
110
- `ap`: An explicitly created [`AnalysisPoint`](@ref)
107
111
- `ap_name`: If a name is given, an [`AnalysisPoint`](@ref) with the given name will be created automatically.
112
+
- `verbose`: Causes a warning to be displayed if an input is connected to an output (reverse causality). Silence this warning if you are analysing an inverse model.
108
113
"""
109
-
function ModelingToolkit.connect(in, ap::AnalysisPoint, out)
114
+
function ModelingToolkit.connect(in, ap::AnalysisPoint, out; verbose =true)
0 commit comments