Skip to content

Commit 90534fa

Browse files
author
fchen121
committed
Add docstring to fractional_to_ordinary
1 parent 06d5699 commit 90534fa

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/systems/diffeqs/basic_transformations.jl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,32 @@ function change_of_variables(
184184
return new_sys
185185
end
186186

187+
"""
188+
Generates the system of ODEs to find solution to FDEs.
189+
190+
Example:
191+
192+
```julia
193+
@independent_variables t
194+
@variables x(t)
195+
D = Differential(t)
196+
tspan = (0., 1.)
197+
198+
α = 0.5
199+
eqs = (9*gamma(1 + α)/4) - (3*t^(4 - α/2)*gamma(5 + α/2)/gamma(5 - α/2))
200+
eqs += (gamma(9)*t^(8 - α)/gamma(9 - α)) + (3/2*t^(α/2)-t^4)^3 - x^(3/2)
201+
sys = fractional_to_ordinary(eqs, x, α, 10^-7, 1)
202+
203+
prob = ODEProblem(sys, [], tspan)
204+
sol = solve(prob, radau5(), abstol = 1e-10, reltol = 1e-10)
205+
206+
time = 0
207+
while(time <= 1)
208+
@test isapprox((3/2*time^(α/2) - time^4)^2, sol(time, idxs=x), atol=1e-3)
209+
time += 0.1
210+
end
211+
```
212+
"""
187213
function fractional_to_ordinary(eqs, variables, alphas, epsilon, T; initials = 0)
188214
@independent_variables t
189215
D = Differential(t)

0 commit comments

Comments
 (0)