Skip to content

Commit cb798fc

Browse files
committed
DiffEq plot variables by name
1 parent 735bd58 commit cb798fc

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ComponentArrays"
22
uuid = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
33
authors = ["Jonnie Diegelman <47193959+jonniedie@users.noreply.github.com>"]
4-
version = "0.11.6"
4+
version = "0.11.7"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

examples/adaptive_control_example.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,13 @@ function simulate(plant_fun, plant_ic;
175175
# Reference model tracking
176176
top = plot(
177177
sol,
178-
vars=["reference_model[1]", "feedback_loop.sensor"],
178+
vars=Symbol.(["reference_model[1]", "feedback_loop.sensor[1]"]),
179179
# legend=:right,
180180
title="Reference Model Tracking",
181181
)
182182

183183
# Parameter estimate tracking
184-
bottom = plot(sol, vars="feedback_loop.parameter_estimates")
184+
bottom = plot(sol, vars=Symbol.(["feedback_loop.parameter_estimates.θr", "feedback_loop.parameter_estimates.θy"]))
185185
plot!(
186186
bottom,
187187
[tspan...], [θ_truth.r θ_truth.y; θ_truth.r θ_truth.y],

src/compat/scimlbase.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ function SciMLBase.getsyms(sol::SciMLBase.AbstractODESolution{T,N,C}) where {T,N
55
if SciMLBase.has_syms(sol.prob.f)
66
return sol.prob.f.syms
77
else
8-
return labels(sol.u[1])
8+
return Symbol.(labels(sol.u[1]))
99
end
1010
end
11-
12-
# A little bit of type piracy. Should probably make this a PR to DiffEqBase
13-
SciMLBase.cleansyms(syms::AbstractArray{<:String}) = SciMLBase.cleansyms.(syms)
14-
SciMLBase.cleansyms(syms::String) = syms

0 commit comments

Comments
 (0)