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

Add more systems #5

Merged
merged 6 commits into from
Dec 23, 2023
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
133 changes: 119 additions & 14 deletions src/chaotic_attractors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -755,8 +755,23 @@ function LidDrivenCavityFlow()
return prob
end

# class BlinkingVortex(BlinkingRotlet):
# pass
function BlinkingVortex end
function originalcode(::typeof(BlinkingVortex))
"""
class BlinkingVortex(BlinkingRotlet):
pass
"""
end
@doc make_docstring(BlinkingVortex) BlinkingVortex
function BlinkingVortex()
prob = BlinkingRotlet()
u0 = Float64.(ATTRACTOR_DATA["BlinkingVortex"]["initial_conditions"])
p = format_parameters(ATTRACTOR_DATA["BlinkingVortex"]["parameters"])
T = ATTRACTOR_DATA["BlinkingVortex"]["period"] * N
tspan = (0.0, T)
prob = remake(prob, u0 = u0, p = p, tspan = tspan)
return prob
end

# class InteriorSquirmer(DynSys):

Expand Down Expand Up @@ -2050,8 +2065,23 @@ function Arneodo()
return prob
end

# class Coullet(Arneodo):
# pass
function Coullet end
function originalcode(::typeof(Coullet))
"""
class Coullet(Arneodo):
pass
"""
end
@doc make_docstring(Coullet) Coullet
function Coullet()
prob = Arneodo()
u0 = Float64.(ATTRACTOR_DATA["Coullet"]["initial_conditions"])
p = format_parameters(ATTRACTOR_DATA["Coullet"]["parameters"])
T = ATTRACTOR_DATA["Coullet"]["period"] * N
tspan = (0.0, T)
prob = remake(prob, u0 = u0, p = p, tspan = tspan)
return prob
end

function Rucklidge end
originalcode(::typeof(Rucklidge)) = """
Expand Down Expand Up @@ -2109,8 +2139,23 @@ function Sakarya()
return prob
end

# class LiuChen(Sakarya):
# pass
function LiuChen end
function originalcode(::typeof(LiuChen))
"""
class LiuChen(Sakarya):
pass
"""
end
@doc make_docstring(LiuChen) LiuChen
function LiuChen()
prob = Sakarya()
u0 = Float64.(ATTRACTOR_DATA["LiuChen"]["initial_conditions"])
p = format_parameters(ATTRACTOR_DATA["LiuChen"]["parameters"])
T = ATTRACTOR_DATA["LiuChen"]["period"] * N
tspan = (0.0, T)
prob = remake(prob, u0 = u0, p = p, tspan = tspan)
return prob
end

function RayleighBenard end
originalcode(::typeof(RayleighBenard)) = """
Expand Down Expand Up @@ -2196,8 +2241,23 @@ function Bouali2()
return prob
end

# class Bouali(Bouali2):
# pass
function Bouali end
function originalcode(::typeof(Bouali))
"""
class Bouali(Bouali2):
pass
"""
end
@doc make_docstring(Bouali) Bouali
function Bouali()
prob = Bouali2()
u0 = Float64.(ATTRACTOR_DATA["Bouali"]["initial_conditions"])
p = format_parameters(ATTRACTOR_DATA["Bouali"]["parameters"])
T = ATTRACTOR_DATA["Bouali"]["period"] * N
tspan = (0.0, T)
prob = remake(prob, u0 = u0, p = p, tspan = tspan)
return prob
end

function LuChenCheng end
originalcode(::typeof(LuChenCheng)) = """
Expand Down Expand Up @@ -2535,11 +2595,41 @@ function DequanLi()
return prob
end

# class PanXuZhou(DequanLi):
# pass
function PanXuZhou end
function originalcode(::typeof(PanXuZhou))
"""
class PanXuZhou(DequanLi):
pass
"""
end
@doc make_docstring(PanXuZhou) PanXuZhou
function PanXuZhou()
prob = DequanLi()
u0 = Float64.(ATTRACTOR_DATA["PanXuZhou"]["initial_conditions"])
p = format_parameters(ATTRACTOR_DATA["PanXuZhou"]["parameters"])
T = ATTRACTOR_DATA["PanXuZhou"]["period"] * N
tspan = (0.0, T)
prob = remake(prob, u0 = u0, p = p, tspan = tspan)
return prob
end

# class Tsucs2(DequanLi):
# pass
function Tsucs2 end
function originalcode(::typeof(Tsucs2))
"""
class Tsucs2(DequanLi):
pass
"""
end
@doc make_docstring(Tsucs2) Tsucs2
function Tsucs2()
prob = DequanLi()
u0 = Float64.(ATTRACTOR_DATA["Tsucs2"]["initial_conditions"])
p = format_parameters(ATTRACTOR_DATA["Tsucs2"]["parameters"])
T = ATTRACTOR_DATA["Tsucs2"]["period"] * N
tspan = (0.0, T)
prob = remake(prob, u0 = u0, p = p, tspan = tspan)
return prob
end

function ArnoldWeb end
originalcode(::typeof(ArnoldWeb)) = """
Expand Down Expand Up @@ -3874,8 +3964,23 @@ function Torus()
return prob
end

# class CaTwoPlusQuasiperiodic(CaTwoPlus):
# pass
function CaTwoPlusQuasiperiodic end
function originalcode(::typeof(CaTwoPlusQuasiperiodic))
"""
class CaTwoPlusQuasiperiodic(CaTwoPlus):
pass
"""
end
@doc make_docstring(CaTwoPlusQuasiperiodic) CaTwoPlusQuasiperiodic
function CaTwoPlusQuasiperiodic()
prob = CaTwoPlus()
u0 = Float64.(ATTRACTOR_DATA["CaTwoPlusQuasiperiodic"]["initial_conditions"])
p = format_parameters(ATTRACTOR_DATA["CaTwoPlusQuasiperiodic"]["parameters"])
T = ATTRACTOR_DATA["CaTwoPlusQuasiperiodic"]["period"] * N
tspan = (0.0, T)
prob = remake(prob, u0 = u0, p = p, tspan = tspan)
return prob
end

function Hopfield end
originalcode(::typeof(Hopfield)) = """
Expand Down
10 changes: 10 additions & 0 deletions test/test_chaotic_attractors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ using SafeTestsets
ChaoticDynamicalSystemLibrary.BickleyJet,
ChaoticDynamicalSystemLibrary.Blasius,
ChaoticDynamicalSystemLibrary.BlinkingRotlet,
ChaoticDynamicalSystemLibrary.BlinkingVortex,
ChaoticDynamicalSystemLibrary.Bouali,
ChaoticDynamicalSystemLibrary.Bouali2,
ChaoticDynamicalSystemLibrary.BurkeShaw,
ChaoticDynamicalSystemLibrary.CaTwoPlus,
ChaoticDynamicalSystemLibrary.CaTwoPlusQuasiperiodic,
ChaoticDynamicalSystemLibrary.CellCycle,
ChaoticDynamicalSystemLibrary.CellularNeuralNetwork,
ChaoticDynamicalSystemLibrary.Chen,
Expand All @@ -27,6 +30,7 @@ using SafeTestsets
ChaoticDynamicalSystemLibrary.CircadianRhythm,
ChaoticDynamicalSystemLibrary.CoevolvingPredatorPrey,
ChaoticDynamicalSystemLibrary.Colpitts,
ChaoticDynamicalSystemLibrary.Coullet,
ChaoticDynamicalSystemLibrary.Dadras,
ChaoticDynamicalSystemLibrary.DequanLi,
ChaoticDynamicalSystemLibrary.DoubleGyre,
Expand Down Expand Up @@ -70,6 +74,7 @@ using SafeTestsets
ChaoticDynamicalSystemLibrary.LorenzBounded,
ChaoticDynamicalSystemLibrary.LorenzCoupled,
ChaoticDynamicalSystemLibrary.LorenzStenflo,
ChaoticDynamicalSystemLibrary.LiuChen,
ChaoticDynamicalSystemLibrary.LuChen,
ChaoticDynamicalSystemLibrary.LuChenCheng,
ChaoticDynamicalSystemLibrary.MacArthur,
Expand All @@ -79,6 +84,7 @@ using SafeTestsets
ChaoticDynamicalSystemLibrary.NoseHoover,
ChaoticDynamicalSystemLibrary.NuclearQuadrupole,
ChaoticDynamicalSystemLibrary.OscillatingFlow,
ChaoticDynamicalSystemLibrary.PanXuZhou,
ChaoticDynamicalSystemLibrary.PehlivanWei,
ChaoticDynamicalSystemLibrary.Qi,
ChaoticDynamicalSystemLibrary.QiChen,
Expand Down Expand Up @@ -117,13 +123,17 @@ using SafeTestsets
ChaoticDynamicalSystemLibrary.SwingingAtwood,
ChaoticDynamicalSystemLibrary.Thomas,
ChaoticDynamicalSystemLibrary.Torus,
ChaoticDynamicalSystemLibrary.Tsucs2,
ChaoticDynamicalSystemLibrary.TurchinHanski,
ChaoticDynamicalSystemLibrary.VallisElNino,
ChaoticDynamicalSystemLibrary.WangSun,
ChaoticDynamicalSystemLibrary.WindmiReduced,
ChaoticDynamicalSystemLibrary.YuWang,
ChaoticDynamicalSystemLibrary.YuWang2,
ChaoticDynamicalSystemLibrary.ZhouChen)
@test ChaoticDynamicalSystemLibrary.originalcode(System) isa String
@test_nowarn ChaoticDynamicalSystemLibrary.make_docstring(System)

prob = @test_nowarn System()
@test prob isa ODEProblem
@test_nowarn solve(prob, Tsit5(), abstol = 1e-6, reltol = 1e-4)
Expand Down
7 changes: 7 additions & 0 deletions visualize_all_systems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ ALL_SYSTEMS = (ChaoticDynamicalSystemLibrary.Aizawa,
ChaoticDynamicalSystemLibrary.BickleyJet,
ChaoticDynamicalSystemLibrary.Blasius,
ChaoticDynamicalSystemLibrary.BlinkingRotlet,
ChaoticDynamicalSystemLibrary.BlinkingVortex,
ChaoticDynamicalSystemLibrary.Bouali,
ChaoticDynamicalSystemLibrary.Bouali2,
ChaoticDynamicalSystemLibrary.BurkeShaw,
ChaoticDynamicalSystemLibrary.CaTwoPlus,
ChaoticDynamicalSystemLibrary.CaTwoPlusQuasiperiodic,
ChaoticDynamicalSystemLibrary.CellCycle,
ChaoticDynamicalSystemLibrary.CellularNeuralNetwork,
ChaoticDynamicalSystemLibrary.Chen,
Expand All @@ -22,6 +25,7 @@ ALL_SYSTEMS = (ChaoticDynamicalSystemLibrary.Aizawa,
ChaoticDynamicalSystemLibrary.CircadianRhythm,
ChaoticDynamicalSystemLibrary.CoevolvingPredatorPrey,
ChaoticDynamicalSystemLibrary.Colpitts,
ChaoticDynamicalSystemLibrary.Coullet,
ChaoticDynamicalSystemLibrary.Dadras,
ChaoticDynamicalSystemLibrary.DequanLi,
ChaoticDynamicalSystemLibrary.DoubleGyre,
Expand Down Expand Up @@ -65,6 +69,7 @@ ALL_SYSTEMS = (ChaoticDynamicalSystemLibrary.Aizawa,
ChaoticDynamicalSystemLibrary.LorenzBounded,
ChaoticDynamicalSystemLibrary.LorenzCoupled,
ChaoticDynamicalSystemLibrary.LorenzStenflo,
ChaoticDynamicalSystemLibrary.LiuChen,
ChaoticDynamicalSystemLibrary.LuChen,
ChaoticDynamicalSystemLibrary.LuChenCheng,
ChaoticDynamicalSystemLibrary.MacArthur,
Expand All @@ -74,6 +79,7 @@ ALL_SYSTEMS = (ChaoticDynamicalSystemLibrary.Aizawa,
ChaoticDynamicalSystemLibrary.NoseHoover,
ChaoticDynamicalSystemLibrary.NuclearQuadrupole,
ChaoticDynamicalSystemLibrary.OscillatingFlow,
ChaoticDynamicalSystemLibrary.PanXuZhou,
ChaoticDynamicalSystemLibrary.PehlivanWei,
ChaoticDynamicalSystemLibrary.Qi,
ChaoticDynamicalSystemLibrary.QiChen,
Expand Down Expand Up @@ -112,6 +118,7 @@ ALL_SYSTEMS = (ChaoticDynamicalSystemLibrary.Aizawa,
ChaoticDynamicalSystemLibrary.SwingingAtwood,
ChaoticDynamicalSystemLibrary.Thomas,
ChaoticDynamicalSystemLibrary.Torus,
ChaoticDynamicalSystemLibrary.Tsucs2,
ChaoticDynamicalSystemLibrary.TurchinHanski,
ChaoticDynamicalSystemLibrary.VallisElNino,
ChaoticDynamicalSystemLibrary.WangSun,
Expand Down
Loading