diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index af80f592b0..e031f84ba3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,5 @@ - This repository follows the [SciMLStyle](https://github.com/SciML/SciMLStyle) and the SciML [ColPrac](https://github.com/SciML/ColPrac). - - Please run `using JuliaFormatter, OrdinaryDiffEq; format(joinpath(dirname(pathof(OrdinaryDiffEq)), ".."))` before commiting. + - Please run `using JuliaFormatter, OrdinaryDiffEq; format(joinpath(dirname(pathof(OrdinaryDiffEq)), ".."))` before committing. - Add tests for any new features. - Additional help on contributing to the numerical solvers can be found at https://docs.sciml.ai/DiffEqDevDocs/stable/ diff --git a/src/caches/linear_nonlinear_caches.jl b/src/caches/linear_nonlinear_caches.jl index d942c70647..ccafa6ac45 100644 --- a/src/caches/linear_nonlinear_caches.jl +++ b/src/caches/linear_nonlinear_caches.jl @@ -746,7 +746,7 @@ function alg_cache_exprb(alg::OrdinaryDiffEqAdaptiveExponentialAlgorithm, u, ::Type{uEltypeNoUnits}, uprev, f, t, p, du1, tmp, dz, plist) where {uEltypeNoUnits} if f isa SplitFunction - error("Algorithm $alg cannnot be used for split problems. Consider reformat to a regular `ODEProblem`") + error("Algorithm $alg cannot be used for split problems. Consider reformat to a regular `ODEProblem`") end n = length(u) T = eltype(u) diff --git a/src/derivative_utils.jl b/src/derivative_utils.jl index daedbf0d11..fd76905816 100644 --- a/src/derivative_utils.jl +++ b/src/derivative_utils.jl @@ -850,7 +850,7 @@ function build_J_W(alg, u, uprev, p, t, dt, f::F, ::Type{uEltypeNoUnits}, !LinearSolve.needs_concrete_A(alg.linsolve)) # If the user has chosen GMRES but no sparse Jacobian, assume that the dense # Jacobian is a bad idea and create a fully matrix-free solver. This can - # be overriden with concrete_jac. + # be overridden with concrete_jac. _f = islin ? (isode ? f.f : f.f1.f) : f jacvec = SparseDiffTools.JacVec(UJacobianWrapper(_f, t, p), copy(u), diff --git a/src/derivative_wrappers.jl b/src/derivative_wrappers.jl index 8e4cb0bd2a..42b6b4495d 100644 --- a/src/derivative_wrappers.jl +++ b/src/derivative_wrappers.jl @@ -12,7 +12,7 @@ const FIRST_AUTODIFF_TGRAD_MESSAGE = """ 3. Defining analytical Jacobians and time gradients. More details can be found at https://docs.sciml.ai/DiffEqDocs/stable/types/ode_types/#SciMLBase.ODEFunction - Note 1: this failure occured inside of the time gradient function. These + Note 1: this failure occurred inside of the time gradient function. These time gradients are only required by Rosenbrock methods (`Rosenbrock23`, `Rodas4`, etc.) are are done by automatic differentiation w.r.t. the argument `t`. If your function is compatible with automatic differentiation @@ -79,7 +79,7 @@ function derivative!(df::AbstractArray{<:Number}, f, x::Union{Number, AbstractArray{<:Number}}, fx::AbstractArray{<:Number}, integrator, grad_config) alg = unwrap_alg(integrator, true) - tmp = length(x) # We calculate derivtive for all elements in gradient + tmp = length(x) # We calculate derivative for all elements in gradient if alg_autodiff(alg) T = if standardtag(alg) typeof(ForwardDiff.Tag(OrdinaryDiffEqTag(), eltype(df))) @@ -120,7 +120,7 @@ end function derivative(f, x::Union{Number, AbstractArray{<:Number}}, integrator) local d - tmp = length(x) # We calculate derivtive for all elements in gradient + tmp = length(x) # We calculate derivative for all elements in gradient alg = unwrap_alg(integrator, true) if alg_autodiff(alg) integrator.stats.nf += 1 diff --git a/src/generic_rosenbrock.jl b/src/generic_rosenbrock.jl index 27672daf4f..070389003a 100644 --- a/src/generic_rosenbrock.jl +++ b/src/generic_rosenbrock.jl @@ -563,7 +563,7 @@ end Ros4dummyTableau() Generate a dummy tableau for ROS4 methods. It can be considered as performing elementwise OR to the masks -of those sepecific tableaus: `Ros4dummyTableau()==_masktab(RosShamp4Tableau()) OR _masktab(Veldd4Tableau()) OR ...` +of those specific tableaus: `Ros4dummyTableau()==_masktab(RosShamp4Tableau()) OR _masktab(Veldd4Tableau()) OR ...` ROS4 methods have the property of a4j==a3j so a is a 3*3 matrix instead of a 4*4 matrix and c is a 1*3 vector instead of a 1*4 vector. """ function Ros4dummyTableau()#create a tabmask for all ROS4 methods where false->0,true->non-0 diff --git a/src/integrators/integrator_utils.jl b/src/integrators/integrator_utils.jl index e229bf4f0e..797cbf04a1 100644 --- a/src/integrators/integrator_utils.jl +++ b/src/integrators/integrator_utils.jl @@ -440,7 +440,7 @@ function handle_tstop!(integrator) end function reset_fsal!(integrator) - # Under these condtions, these algorithms are not FSAL anymore + # Under these conditions, these algorithms are not FSAL anymore integrator.stats.nf += 1 if integrator.sol.prob isa DAEProblem diff --git a/src/perform_step/extrapolation_perform_step.jl b/src/perform_step/extrapolation_perform_step.jl index e8bff084d3..1ba4d8f653 100644 --- a/src/perform_step/extrapolation_perform_step.jl +++ b/src/perform_step/extrapolation_perform_step.jl @@ -431,7 +431,7 @@ function perform_step!(integrator, cache::ImplicitEulerExtrapolationCache, integrator.opts.abstol, integrator.opts.reltol, integrator.opts.internalnorm, t) integrator.EEst = integrator.opts.internalnorm(cache.res, t) - cache.n_curr = i # Update chache's n_curr for stepsize_controller_internal! + cache.n_curr = i # Update cache's n_curr for stepsize_controller_internal! stepsize_controller_internal!(integrator, alg) # Update cache.Q end @@ -648,7 +648,7 @@ function perform_step!(integrator, cache::ImplicitEulerExtrapolationConstantCach integrator.opts.reltol, integrator.opts.internalnorm, t) integrator.EEst = integrator.opts.internalnorm(res, t) - cache.n_curr = i # Update chache's n_curr for stepsize_controller_internal! + cache.n_curr = i # Update cache's n_curr for stepsize_controller_internal! stepsize_controller_internal!(integrator, alg) # Update cache.Q end @@ -864,7 +864,7 @@ function perform_step!(integrator, cache::ExtrapolationMidpointDeuflhardCache, integrator.opts.abstol, integrator.opts.reltol, integrator.opts.internalnorm, t) integrator.EEst = integrator.opts.internalnorm(cache.res, t) - cache.n_curr = i # Update chache's n_curr for stepsize_controller_internal! + cache.n_curr = i # Update cache's n_curr for stepsize_controller_internal! stepsize_controller_internal!(integrator, alg) # Update cache.Q end @@ -1066,7 +1066,7 @@ function perform_step!(integrator, cache::ExtrapolationMidpointDeuflhardConstant integrator.opts.reltol, integrator.opts.internalnorm, t) integrator.EEst = integrator.opts.internalnorm(res, t) - cache.n_curr = i # Update chache's n_curr for stepsize_controller_internal! + cache.n_curr = i # Update cache's n_curr for stepsize_controller_internal! stepsize_controller_internal!(integrator, alg) # Update cache.Q end @@ -1439,7 +1439,7 @@ function perform_step!(integrator, cache::ImplicitDeuflhardExtrapolationCache, integrator.opts.abstol, integrator.opts.reltol, integrator.opts.internalnorm, t) integrator.EEst = integrator.opts.internalnorm(cache.res, t) - cache.n_curr = i # Update chache's n_curr for stepsize_controller_internal! + cache.n_curr = i # Update cache's n_curr for stepsize_controller_internal! stepsize_controller_internal!(integrator, alg) # Update cache.Q end @@ -1719,7 +1719,7 @@ function perform_step!(integrator, cache::ImplicitDeuflhardExtrapolationConstant integrator.opts.reltol, integrator.opts.internalnorm, t) integrator.EEst = integrator.opts.internalnorm(res, t) - cache.n_curr = i # Update chache's n_curr for stepsize_controller_internal! + cache.n_curr = i # Update cache's n_curr for stepsize_controller_internal! stepsize_controller_internal!(integrator, alg) # Update cache.Q end @@ -1937,7 +1937,7 @@ function perform_step!(integrator, cache::ExtrapolationMidpointHairerWannerCache integrator.opts.abstol, integrator.opts.reltol, integrator.opts.internalnorm, t) integrator.EEst = integrator.opts.internalnorm(cache.res, t) - cache.n_curr = i # Update chache's n_curr for stepsize_controller_internal! + cache.n_curr = i # Update cache's n_curr for stepsize_controller_internal! stepsize_controller_internal!(integrator, alg) # Update cache.Q end @@ -2140,7 +2140,7 @@ function perform_step!(integrator, cache::ExtrapolationMidpointHairerWannerConst integrator.opts.reltol, integrator.opts.internalnorm, t) integrator.EEst = integrator.opts.internalnorm(res, t) - cache.n_curr = i # Update chache's n_curr for stepsize_controller_internal! + cache.n_curr = i # Update cache's n_curr for stepsize_controller_internal! stepsize_controller_internal!(integrator, alg) # Update cache.Q end @@ -2407,7 +2407,7 @@ function perform_step!(integrator, cache::ImplicitHairerWannerExtrapolationConst integrator.opts.reltol, integrator.opts.internalnorm, t) integrator.EEst = integrator.opts.internalnorm(res, t) - cache.n_curr = i # Update chache's n_curr for stepsize_controller_internal! + cache.n_curr = i # Update cache's n_curr for stepsize_controller_internal! stepsize_controller_internal!(integrator, alg) # Update cache.Q end @@ -2792,7 +2792,7 @@ function perform_step!(integrator, cache::ImplicitHairerWannerExtrapolationCache integrator.opts.abstol, integrator.opts.reltol, integrator.opts.internalnorm, t) integrator.EEst = integrator.opts.internalnorm(cache.res, t) - cache.n_curr = i # Update chache's n_curr for stepsize_controller_internal! + cache.n_curr = i # Update cache's n_curr for stepsize_controller_internal! stepsize_controller_internal!(integrator, alg) # Update cache.Q end @@ -3102,7 +3102,7 @@ function perform_step!(integrator, integrator.opts.reltol, integrator.opts.internalnorm, t) integrator.EEst = integrator.opts.internalnorm(res, t) - cache.n_curr = i # Update chache's n_curr for stepsize_controller_internal! + cache.n_curr = i # Update cache's n_curr for stepsize_controller_internal! stepsize_controller_internal!(integrator, alg) # Update cache.Q end @@ -3500,7 +3500,7 @@ function perform_step!(integrator, cache::ImplicitEulerBarycentricExtrapolationC integrator.opts.abstol, integrator.opts.reltol, integrator.opts.internalnorm, t) integrator.EEst = integrator.opts.internalnorm(cache.res, t) - cache.n_curr = i # Update chache's n_curr for stepsize_controller_internal! + cache.n_curr = i # Update cache's n_curr for stepsize_controller_internal! stepsize_controller_internal!(integrator, alg) # Update cache.Q end diff --git a/src/perform_step/rkn_perform_step.jl b/src/perform_step/rkn_perform_step.jl index c46d24a451..75ea187d10 100644 --- a/src/perform_step/rkn_perform_step.jl +++ b/src/perform_step/rkn_perform_step.jl @@ -191,7 +191,7 @@ end if integrator.iter < 2 && !integrator.u_modified perform_step!(integrator, Nystrom4VelocityIndependentConstantCache()) k = integrator.fsallast - k1cache = ArrayParition((k.x[1], f.f1(duprev, uprev, p, t + c1 * dt))) + k1cache = ArrayPartition((k.x[1], f.f1(duprev, uprev, p, t + c1 * dt))) kdu = uprev + dt * (c1 * duprev + dt * a21 * k1cache.x[1]) k₂.x[1] = f.f1(duprev, kdu, p, t + c1 * dt) integrator.stats.nf += 2 diff --git a/src/tableaus/sdirk_tableaus.jl b/src/tableaus/sdirk_tableaus.jl index 4db3b357e3..a573032b56 100644 --- a/src/tableaus/sdirk_tableaus.jl +++ b/src/tableaus/sdirk_tableaus.jl @@ -95,7 +95,7 @@ Coefficient on y₁-y₀: 6θ*(1-θ)/dt - (- (6 + 4.5sqrt(2))) # - (6 + 4.5sqrt(2)) given by Shampine -# Write only in terms of z primatives +# Write only in terms of z primitives y₀ = uprev y₁ = uprev + γ*z₁ + γ*z₂ y₁-y₀ = γ*z₁ + γ*z₂ @@ -337,7 +337,7 @@ Coefficient on z₂: Coefficient on y₁-y₀: (6θ*(1-θ)/dt) -# Write only in terms of z primatives +# Write only in terms of z primitives y₁ = uprev + a21*z₁ + γ*z₂ y₀ = uprev + γ*z₁ y₁-y₀ = (a21-γ)*z₁ + γ*z₂ diff --git a/src/tableaus/verner_tableaus.jl b/src/tableaus/verner_tableaus.jl index bbb268ae02..2f6289aa2e 100644 --- a/src/tableaus/verner_tableaus.jl +++ b/src/tableaus/verner_tableaus.jl @@ -3262,7 +3262,7 @@ function Vern9InterpolationCoefficients(T) end """ -From Verner's Webiste +From Verner's Website """ struct Vern9Tableau{T, T2} c1::T2 diff --git a/test/algconvergence/adams_tests.jl b/test/algconvergence/adams_tests.jl index 0517d2b7e8..4ab409511f 100644 --- a/test/algconvergence/adams_tests.jl +++ b/test/algconvergence/adams_tests.jl @@ -35,7 +35,7 @@ for i in 1:2 for i in 1:3 step!(integrator) end - # in perform_step, after swaping array using pointer, ϕstar_nm1 points to ϕstar_n + # in perform_step, after swapping array using pointer, ϕstar_nm1 points to ϕstar_n @test integrator.cache.ϕstar_nm1 == fixed_step_ϕstar(integrator.sol.k) step!(integrator) @test integrator.cache.ϕstar_nm1 == fixed_step_ϕstar(integrator.sol.k) diff --git a/test/algconvergence/ode_firk_tests.jl b/test/algconvergence/ode_firk_tests.jl index 665482083c..abf242ca7f 100644 --- a/test/algconvergence/ode_firk_tests.jl +++ b/test/algconvergence/ode_firk_tests.jl @@ -30,7 +30,7 @@ for iip in (true, false) @test length(solve(remake(vanstiff, p = 1e10), RadauIIA5())) < 190 end -##Tests fot RadauIIA3 +##Tests for RadauIIA3 for prob in [prob_ode_linear, prob_ode_2Dlinear] dts = 1 ./ 2 .^ (8:-1:1) sim = test_convergence(dts, prob, RadauIIA3()) diff --git a/test/algconvergence/rkc_tests.jl b/test/algconvergence/rkc_tests.jl index a2ed6323e1..a27bff1170 100644 --- a/test/algconvergence/rkc_tests.jl +++ b/test/algconvergence/rkc_tests.jl @@ -59,7 +59,7 @@ end #default ROCK2 sim = test_convergence(dts, prob, ROCK2()) @test sim.𝒪est[:l∞]≈2 atol=testTol - #testing ROCK2 for different minimum stages to insure that the constatns are right + #testing ROCK2 for different minimum stages to insure that the constants are right sim = test_convergence(dts, prob, ROCK2(min_stages = 5)) @test sim.𝒪est[:l∞]≈2 atol=testTol sim = test_convergence(dts, prob, ROCK2(min_stages = 10)) @@ -70,7 +70,7 @@ end println("ROCK4") sim = test_convergence(dts, prob, ROCK4()) @test sim.𝒪est[:l∞]≈4 atol=testTol - #testing ROCK4 for different minimum stages to insure that the constatns are right + #testing ROCK4 for different minimum stages to insure that the constants are right sim = test_convergence(dts, prob, ROCK4(min_stages = 6)) @test sim.𝒪est[:l∞]≈4 atol=testTol sim = test_convergence(dts, prob, ROCK4(min_stages = 10)) diff --git a/test/algconvergence/split_methods_tests.jl b/test/algconvergence/split_methods_tests.jl index f2b4e234a9..51e98e2a8c 100644 --- a/test/algconvergence/split_methods_tests.jl +++ b/test/algconvergence/split_methods_tests.jl @@ -3,7 +3,7 @@ testTol = 0.2 Random.seed!(100) -# Test that the infrustructure works +# Test that the infrastructure works f1 = (u, p, t) -> 2u f2 = (u, p, t) -> 2u diff --git a/test/algconvergence/symplectic_tests.jl b/test/algconvergence/symplectic_tests.jl index 50c4039e8e..a4ca540bcc 100644 --- a/test/algconvergence/symplectic_tests.jl +++ b/test/algconvergence/symplectic_tests.jl @@ -2,7 +2,7 @@ using Test, LinearAlgebra using OrdinaryDiffEq, DiffEqBase -# algoritm, dq(p) != p, convergence order +# algorithm, dq(p) != p, convergence order const ALGOS = ((SymplecticEuler, true, 1), (VelocityVerlet, false, 2), (VerletLeapfrog, true, 2), diff --git a/test/interface/jacobian_tests.jl b/test/interface/jacobian_tests.jl index 15a6746f6a..53e36a43e0 100644 --- a/test/interface/jacobian_tests.jl +++ b/test/interface/jacobian_tests.jl @@ -73,7 +73,7 @@ function rober(du, u, p, t) k₁, k₂, k₃, check = p if check && eltype(u) <: ForwardDiff.Dual && ForwardDiff.npartials(u[1]) != chunksize @show ForwardDiff.npartials(u[1]), chunksize - error("chunk_size is not as specifed") + error("chunk_size is not as specified") end du[1] = -k₁ * y₁ + k₃ * y₂ * y₃ diff --git a/test/interface/units_tests.jl b/test/interface/units_tests.jl index c353af1cf8..fc06d68ff6 100644 --- a/test/interface/units_tests.jl +++ b/test/interface/units_tests.jl @@ -65,7 +65,7 @@ end @testset "Without ArrayPartition" begin # coordinate: u = [position, momentum] - # parameters: p = [mass, force constanst] + # parameters: p = [mass, force constant] function f_harmonic!(du, u, p, t) du[1] = u[2] / p[1] du[2] = -p[2] * u[1] diff --git a/test/runtests.jl b/test/runtests.jl index 94bd9f426e..a82d9d6b95 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -27,7 +27,7 @@ end @time @safetestset "save_idxs Tests" begin include("interface/ode_saveidxs_tests.jl") end @time @safetestset "Scalar Handling Tests" begin include("interface/scalar_handling_tests.jl") end @time @safetestset "Static Array Tests" begin include("interface/static_array_tests.jl") end - @time @safetestset "u_modifed Tests" begin include("interface/umodified_test.jl") end + @time @safetestset "u_modified Tests" begin include("interface/umodified_test.jl") end @time @safetestset "Composite Algorithm Tests" begin include("interface/composite_algorithm_test.jl") end @time @safetestset "Complex Tests" begin include("interface/complex_tests.jl") end @time @safetestset "Ndim Complex Tests" begin include("interface/ode_ndim_complex_tests.jl") end