diff --git a/docs/src/tutorials/custom_component.md b/docs/src/tutorials/custom_component.md index f53f3f3fc..4472e839f 100644 --- a/docs/src/tutorials/custom_component.md +++ b/docs/src/tutorials/custom_component.md @@ -43,10 +43,10 @@ function NonlinearResistor(; name, Ga, Gb, Ve) pars = @parameters Ga=Ga Gb=Gb Ve=Ve eqs = [ i ~ ifelse(v < -Ve, - Gb * (v + Ve) - Ga * Ve, - ifelse(v > Ve, - Gb * (v - Ve) + Ga * Ve, - Ga * v)) + Gb * (v + Ve) - Ga * Ve, + ifelse(v > Ve, + Gb * (v - Ve) + Ga * Ve, + Ga * v)) ] extend(ODESystem(eqs, t, [], pars; name = name), oneport) end diff --git a/src/Blocks/analysis_points.jl b/src/Blocks/analysis_points.jl index 594031db2..cc0d08dbb 100644 --- a/src/Blocks/analysis_points.jl +++ b/src/Blocks/analysis_points.jl @@ -10,6 +10,12 @@ if Base.isdefined(ModelingToolkit, :isconnection) end Base.nameof(ap::AnalysisPoint) = ap.name +function Base.hash(ap::AnalysisPoint, seed::UInt) + h1 = hash(ap.in, seed) + h2 = hash(ap.out, h1) + h3 = hash(ap.name, h2) + h3 ⊻ (0xd29cdc51aa6562d4 % UInt) +end function ap_var(sys) if hasproperty(sys, :u)