Skip to content

Commit

Permalink
Hotfix #62
Browse files Browse the repository at this point in the history
```julia
using DifferentialEquations, Plots
function SIR!(du,u,pars,t)
    S, I, R = u
    β, γ = pars
    dS = -β*S*I
    dI = β*S*I - γ*I
    dR = γ*I
    du .= [dS, dI, dR]
end
u0 = [0.97, 0.03, 0.0]
params = [0.5, 0.15]
tspan = [0.0, 50.0]
prob = ODEProblem(SIR!, u0, tspan, params);
sol = solve(prob, Tsit5(), saveat = 0:0.5:50, reltol = 1e-4, abstol = 1e-6)
plot(sol)
```
  • Loading branch information
ChrisRackauckas committed May 23, 2021
1 parent 7ecbed1 commit e44240f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SciMLBase"
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
authors = ["Chris Rackauckas <[email protected]> and contributors"]
version = "1.13.3"
version = "1.13.4"

[deps]
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
Expand Down
4 changes: 2 additions & 2 deletions src/solutions/solution_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ function diffeq_to_arrays(sol,plot_analytic,denseplot,plotdensity,tspan,axis_saf
# Plot for sparse output: use the timeseries itself
if sol.tslocation == 0
plott = sol.t
plot_timeseries = DiffEqArray(sol.t, sol.u)
plot_timeseries = DiffEqArray(sol.u, sol.t)
if plot_analytic
plot_analytic_timeseries = sol.u_analytic
else
Expand All @@ -357,7 +357,7 @@ function diffeq_to_arrays(sol,plot_analytic,denseplot,plotdensity,tspan,axis_saf
plott = collect(densetspacer(tspan[1],tspan[2],plotdensity))
end

plot_timeseries = DiffEqArray(sol.t[start_idx:end_idx], sol.u[start_idx:end_idx])
plot_timeseries = sol.u[start_idx:end_idx]
if plot_analytic
plot_analytic_timeseries = sol.u_analytic[start_idx:end_idx]
else
Expand Down

0 comments on commit e44240f

Please sign in to comment.