Skip to content

Commit

Permalink
fix dt in vectorial case
Browse files Browse the repository at this point in the history
  • Loading branch information
rmsrosa committed Jul 2, 2023
1 parent 798afe2 commit 7a5b903
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/solver_euler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ function solve!(xt::AbstractMatrix{T}, t0::T, tf::T, x0::AbstractVector{T}, f::F
"Column of `xt` and `x0` must match indices."
)
)
N = length(xt) - 1 # mesh intervals
dt = (tf - t0) / N
n = size(xt, 1) - 1 # mesh intervals
dt = (tf - t0) / n
i1 = firstindex(axes(xt, 1))
xt[i1, :] .= x0
ti1 = t0
Expand All @@ -92,8 +92,8 @@ function solve!(xt::AbstractMatrix{T}, t0::T, tf::T, x0::AbstractVector{T}, f::F
( axes(xt, 2) isa Base.OneTo{Int64} && axes(method.cachex, 1) isa Base.OneTo{Int64} && size(method.cachex, 1) size(xt, 2)) || error(
"row-length of the cache vector `method.cachex` should be greater than or equal to the column-size of `xt`"
)
N = length(xt) - 1 # mesh intervals
dt = (tf - t0) / N
n = size(xt, 1) - 1 # mesh intervals
dt = (tf - t0) / n
i1 = firstindex(axes(xt, 1))
xt[i1, :] .= x0
ti1 = t0
Expand Down

0 comments on commit 7a5b903

Please sign in to comment.