From 3477d28eb0bf18185d871d49a8b089b22f56f8c9 Mon Sep 17 00:00:00 2001 From: ErikQQY <2283984853@qq.com> Date: Tue, 19 Apr 2022 09:43:55 +0800 Subject: [PATCH] Fix examples Signed-off-by: ErikQQY <2283984853@qq.com> --- example/3dexample.jl | 2 +- example/arbitrary_order_derivative.jl | 2 +- example/derivative_of_sin.jl | 2 +- example/derivative_of_x.jl | 2 +- example/integer_high_order_deriavtive.jl | 2 +- example/integer_order_derivative_example.jl | 2 +- example/integral_of_x.jl | 2 +- src/Derivative/Caputo.jl | 2 +- src/Derivative/RL.jl | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/example/3dexample.jl b/example/3dexample.jl index fbcf114a..a6f47e90 100644 --- a/example/3dexample.jl +++ b/example/3dexample.jl @@ -6,7 +6,7 @@ y=collect(0.1:0.1:5) z=zeros(50, 50) for j in range(1, 50, step=1) - z[j, :] = fracdiff(sin, 0.02*j, y, 0.01, RLDiff_Approx()) + z[j, :] = fracdiff(sin, 0.02*j, y, 0.01, RLDiffApprox()) end plot(x, y, z, st=:surface) diff --git a/example/arbitrary_order_derivative.jl b/example/arbitrary_order_derivative.jl index f2643af7..013a6f78 100644 --- a/example/arbitrary_order_derivative.jl +++ b/example/arbitrary_order_derivative.jl @@ -8,7 +8,7 @@ s="\$D^{3.6}x^5\$" tspan=collect(0:0.01:6) -result=fracdiff(x->x^5, 3.6, 6, 0.01, RLDiff_Matrix()) +result=fracdiff(x->x^5, 3.6, 6, 0.01, RLDiffMatrix()) plot(tspan, result, title=s, legend=:bottomright, label="Numerical") plot!(tspan, target, lw=3, ls=:dash, label="Analytical") diff --git a/example/derivative_of_sin.jl b/example/derivative_of_sin.jl index 622843a4..f9bb1022 100644 --- a/example/derivative_of_sin.jl +++ b/example/derivative_of_sin.jl @@ -6,7 +6,7 @@ tspan=collect(0:0.01:15) examplederivative = [] for i in range(0.1, 0.9, step=0.1) - push!(examplederivative, fracdiff(sin, i, tspan, 0.001, RLDiff_Approx())) + push!(examplederivative, fracdiff(sin, i, tspan, 0.001, RLDiffApprox())) end plot(tspan, examplederivative, title="Different order of derivative", linewidth=3, label=["α=0.1" "α=0.2" "α=0.3" "α=0.4" "α=0.5" "α=0.6" "α=0.7" "α=0.8" "α=0.9" "α=1"], legend=:bottomright) \ No newline at end of file diff --git a/example/derivative_of_x.jl b/example/derivative_of_x.jl index 757dd013..339cd8c9 100644 --- a/example/derivative_of_x.jl +++ b/example/derivative_of_x.jl @@ -6,7 +6,7 @@ tspan=collect(0:0.01:2) examplederivative = [] for i in range(0.1, 0.9, step=0.1) - push!(examplederivative, fracdiff(x->x, i, tspan, 0.001, RLDiff_Approx())) + push!(examplederivative, fracdiff(x->x, i, tspan, 0.001, RLDiffApprox())) end plot(tspan, examplederivative, title="Different order derivative", linewidth=3, label=["α=0.1" "α=0.2" "α=0.3" "α=0.4" "α=0.5" "α=0.6" "α=0.7" "α=0.8" "α=0.9"], legend=:bottomright) \ No newline at end of file diff --git a/example/integer_high_order_deriavtive.jl b/example/integer_high_order_deriavtive.jl index 70655a97..4ff7442e 100644 --- a/example/integer_high_order_deriavtive.jl +++ b/example/integer_high_order_deriavtive.jl @@ -5,6 +5,6 @@ s="\$(x^4)'''=24x\$" tspan=collect(0:0.01:6) -result=fracdiff(cos, 3, 6, 0.01, RLDiff_Matrix()) +result=fracdiff(cos, 3, 6, 0.01, RLDiffMatrix()) plot(tspan, result, title=s, legend=:bottomright) \ No newline at end of file diff --git a/example/integer_order_derivative_example.jl b/example/integer_order_derivative_example.jl index b5f2acc3..1d9c37b5 100644 --- a/example/integer_order_derivative_example.jl +++ b/example/integer_order_derivative_example.jl @@ -5,6 +5,6 @@ s="\$(x^2)'=2x\$" tspan=collect(0:0.01:3) -result=fracdiff(x->x^2, 1, 3, 0.01, RLDiff_Matrix()) +result=fracdiff(x->x^2, 1, 3, 0.01, RLDiffMatrix()) plot(tspan, result, title=s, legend=:bottomright) \ No newline at end of file diff --git a/example/integral_of_x.jl b/example/integral_of_x.jl index 0b145cf7..66d9aab3 100644 --- a/example/integral_of_x.jl +++ b/example/integral_of_x.jl @@ -6,7 +6,7 @@ tspan=collect(0:0.01:3) exampleintegral = [] for i in range(0.1, 0.9, step=0.1) - push!(exampleintegral, fracint(x->x, i, tspan, 0.001, RLInt_Approx())) + push!(exampleintegral, fracint(x->x, i, tspan, 0.001, RLIntApprox())) end plot(tspan, exampleintegral, title="Different order of integral", linewidth=1, label=["α=0.1" "α=0.2" "α=0.3" "α=0.4" "α=0.5" "α=0.6" "α=0.7" "α=0.8" "α=0.9" "α=1"], legend=:bottomright) \ No newline at end of file diff --git a/src/Derivative/Caputo.jl b/src/Derivative/Caputo.jl index e1b87da5..cc6d239a 100644 --- a/src/Derivative/Caputo.jl +++ b/src/Derivative/Caputo.jl @@ -315,7 +315,7 @@ function wj(n::Int64, r::Int64, α) return A end -function w(i::Int64, r::Int64, j, n, a) +function w(i::Int64, r, j, n, a) ar = ones(r-1) br = ones(r-1) for lj = 1:r-2 diff --git a/src/Derivative/RL.jl b/src/Derivative/RL.jl index 6558c549..a6d8d80a 100644 --- a/src/Derivative/RL.jl +++ b/src/Derivative/RL.jl @@ -190,7 +190,7 @@ function z̄ₘₖ(m, k, α) end end -function c̄ⱼₖ(j, k::Int64, α) +function c̄ⱼₖ(j, k, α) if k==0 return (j-1)^(3-α)-j^(2-α)*(j-3+α) elseif 1 ≤ k ≤ j-1