DifferentialEquations -- transform time for all variables?

I have solved a matrix ODE with state u, and want to plot the solution sol. But I want to scale the time axis from second to year. Can I do this for all variables, something like:

y2s = 365*24*60*60
plot(sol,vars=((t,u)->(t/y2s,u),0,:), xlim=(0,sol.t[end]/y2s))

or do I need to loop through all variables and do it individually as in :

plot()
for i in 1:length(u0)
    plot!(sol,vars=((t,u)->(t/y2s,u),0,i), xlim=(0,sol.t[end]/y2s))
end

?

I think you have to do the latter.

1 Like