Skip to content

Commit

Permalink
Fix examples
Browse files Browse the repository at this point in the history
Signed-off-by: ErikQQY <[email protected]>
  • Loading branch information
ErikQQY committed Apr 19, 2022
1 parent 5205575 commit 3477d28
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion example/3dexample.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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())

This comment has been minimized.

Copy link
@Khurramcoder

Khurramcoder Jul 9, 2023

RLDiffApprox()
ERROR: UndefVarError: RLDiffApprox not defined
Stacktrace:
[1] top-level scope

end

plot(x, y, z, st=:surface)
Expand Down
2 changes: 1 addition & 1 deletion example/arbitrary_order_derivative.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion example/derivative_of_sin.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion example/derivative_of_x.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion example/integer_high_order_deriavtive.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion example/integer_order_derivative_example.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion example/integral_of_x.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion src/Derivative/Caputo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Derivative/RL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3477d28

Please sign in to comment.