I have the solution of a system stored in a variable sol
, which behaves just like a continuous function.
What I need in not just a basic plot(sol, vars=[1 2 3...])
but a plot with the x-axis transformed, i.e. I want to plot \vec y(f(t)) and not \vec y(t). Simply writing function sol1(t); return sol(f(t)); end
leads to errors when using plot because sol2
is not the same type as sol
, I suppose. (It does work when y is 1-dimensional)
What’s the trick to make it work ?
Thanks !
plot(sol1, vars=[1,2])
leads to
MethodError: no method matching Float64(::Array{Float64,1}) Closest candidates are: Float64(!Matched::Int8) at float.jl:60 Float64(!Matched::Int16) at float.jl:60 Float64(!Matched::Int32) at float.jl:60 ...