Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant problems and solvers #120

Merged
merged 5 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,17 @@ SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
SpecialMatrices = "928aab9d-ef52-54ac-8ca1-acd7ca42c160"
ToeplitzMatrices = "c751599d-da0a-543b-9d20-d0a503d91d24"

[weakdeps]
FdeSolver = "1746e360-1058-44a5-9855-ddd460437d0c"

[extensions]
FractionalDiffEqFdeSolverExt = "FdeSolver"

[compat]
ConcreteStructs = "0.2.2"
DiffEqBase = "6.156"
FastClosures = "0.3.2"
FdeSolver = "1.0.9"
FFTW = "1.8.0"
ForwardDiff = "0.10.36"
HypergeometricFunctions = "0.3.23"
Expand All @@ -42,7 +49,8 @@ ToeplitzMatrices = "0.8.3"
julia = "1.10"

[extras]
FdeSolver = "1746e360-1058-44a5-9855-ddd460437d0c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
test = ["FdeSolver", "Test"]
16 changes: 0 additions & 16 deletions benchmarks/fdde/bench.jl

This file was deleted.

27 changes: 0 additions & 27 deletions benchmarks/fode/multiterms/multitermsfode.jl

This file was deleted.

22 changes: 0 additions & 22 deletions benchmarks/fode/singleterm/singletermfode.jl

This file was deleted.

25 changes: 25 additions & 0 deletions ext/FractionalDiffEqFdeSolverExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module FractionalDiffEqFdeSolverExt

using DiffEqBase, SciMLBase, FractionalDiffEq
using FdeSolver

# const default_values = (2^-6, 1, nothing, 1e-6, 100)
function SciMLBase.__solve(prob::FODEProblem, alg::FdeSolverPECE; dt = 0.0, abstol = 1e-3, maxiters = 1000, kwargs...)
(; f, order, tspan, u0, p) = prob

tSpan = [first(tspan), last(tspan)]
# FdeSolver only supports out-of-place computing
newf = function (t, y, par)
du = similar(y)
f(du, y, par, t)
return du
end
t, y = FDEsolver(newf, tSpan, u0, order, p, JF = prob.f.jac, h = dt, tol = abstol)
u = eachrow(y)

return DiffEqBase.build_solution(prob, alg, t, u)
end

export FdeSolverPECE

end
41 changes: 20 additions & 21 deletions src/FractionalDiffEq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import Polynomials: Polynomial

@reexport using DiffEqBase, SciMLBase

include("types/problems.jl")
include("types/algorithms.jl")
include("problems.jl")
include("algorithms.jl")
include("types/solutions.jl")

# Multi-terms fractional ordinary differential equations
Expand All @@ -35,11 +35,6 @@ include("fode/implicit_pi_rectangle.jl")
include("fode/implicit_pi_trapzoid.jl")
include("fode/grunwald_letnikov.jl")
include("fode/nonlinearalg.jl")
include("fode/newton_polynomials.jl")
include("fode/atangana_seda.jl")

# System of fractal-fractional ordinary differential equations
include("ffode/atangana_seda.jl")

# Fractional delay differential equations
include("delay/pece.jl")
Expand All @@ -60,8 +55,6 @@ include("mlfun.jl")

# Lyapunov exponents
#include("lyapunov.jl")

include("utils.jl")
include("auxiliary.jl")

function __solve(
Expand All @@ -84,41 +77,33 @@ end
export FDEProblem

# FDDE problems
export FDDEProblem, FDDESystem, FDDEMatrixProblem
export FDDEProblem, FDDEMatrixProblem

# FODE problems
export FODEProblem, MultiTermsFODEProblem, DODEProblem, FFPODEProblem, FFEODEProblem,
FFMODEProblem
export FODEProblem, MultiTermsFODEProblem, DODEProblem

# Fractional Discrete probelms
export FractionalDiscreteProblem, FractionalDiscreteSystem

###################################################

export AbstractFDESolution
export FODESolution, FDifferenceSolution, DODESolution, FFMODESolution
export FODESystemSolution, FDDESystemSolution, FFMODESystem

# FODE solvers
export PIRect, PITrap, PECE, PIEX
export MatrixDiscrete, GL
export AtanganaSedaAB

export MTPIRect, MTPITrap, MTPECE, MTPIEX

# System of FODE solvers
export NonLinearAlg, BDF, NewtonGregory, Trapezoid, NewtonPolynomial
export AtanganaSedaCF
export AtanganaSeda

# FDDE solvers
export DelayPIEX, DelayPECE, DelayABM, MatrixForm

# DODE solvers
export DOMatrixDiscrete

# Fractional Differences Equations solvers
# export PECE
# export extension solvers
export FdeSolverPECE

###################################################

Expand All @@ -134,4 +119,18 @@ export mittleff, mittleffderiv
# Distributed order auxiliary SpecialFunctions
export DOB, DOF, DORANORT, isFunction

#=
function chua!(du, x, p, t)
a, b, c, m0, m1 = p
du[1] = a*(x[2]-x[1]-(m1*x[1]+0.5*(m0-m1)*(abs(x[1]+1)-abs(x[1]-1))))
du[2] = x[1]-x[2]+x[3]
du[3] = -b*x[2]-c*x[3]
end
α = [0.93, 0.99, 0.92];
x0 = [0.2, -0.1, 0.1];
tspan = (0, 100);
p = [10.725, 10.593, 0.268, -1.1726, -0.7872]
prob = FODEProblem(chua!, α, x0, tspan, p)
=#

end
11 changes: 4 additions & 7 deletions src/types/algorithms.jl → src/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,6 @@ year={2018}
"""
struct PECE <: FODEAlgorithm end

"""
AtanganaSedaAB

Solve Atangana-Baleanu fractional order differential equations using Newton Polynomials.
"""
struct AtanganaSedaAB <: FODEAlgorithm end

"""
MatrixDiscrete

Expand Down Expand Up @@ -271,3 +264,7 @@ struct MTPIRect <: MultiTermsFODEAlgorithm end
Use implicit product integration trapezoidal type method to solve multi-terms FODE.
"""
struct MTPITrap <: MultiTermsFODEAlgorithm end

###################### extension algorithms ######################

struct FdeSolverPECE <: FODEAlgorithm end
Loading
Loading