Skip to content

Commit 61ee01d

Browse files
awageDatseris
andauthored
Small bug in projected system initial check (#178)
* Small bug in projected sys * remove debug info * Update Project.toml --------- Co-authored-by: awage <> Co-authored-by: George Datseris <[email protected]>
1 parent 458d123 commit 61ee01d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DynamicalSystemsBase"
22
uuid = "6e36e845-645a-534a-86f2-f5d4aa5a06b4"
33
repo = "https://github.com/JuliaDynamics/DynamicalSystemsBase.jl.git"
4-
version = "3.2.0"
4+
version = "3.2.1"
55

66
[deps]
77
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"

src/derived_systems/projected_system.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function ProjectedDynamicalSystem(ds::DynamicalSystem, projection, complete_stat
7373
remidxs = setdiff(1:dimension(ds), projection)
7474
!isempty(remidxs) || error("Error with the indices of the projection")
7575
else
76-
length(complete_state(u0)) == dimension(ds) ||
76+
length(complete_state(y)) == dimension(ds) ||
7777
error("The returned vector of complete_state must equal dimension(ds)")
7878
remidxs = nothing
7979
end

test/projected.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ p0_cont = [0.1, -0.4, -0.2]
1414
proj_comp1 = (1:2, [1.0])
1515
proj_comp2 = (1:2, (y) -> [y[1], y[2], y[2] + 1])
1616
proj_comp3 = (u -> u/norm(u), y -> 10y)
17+
proj_comp4 = (1:2, y -> [y..., 0])
1718

1819
function projected_tests(ds, pds, P)
1920
@testset "projected dedicated" begin
@@ -43,13 +44,13 @@ function projected_tests(ds, pds, P)
4344
end
4445
end
4546

46-
@testset "IDT=$(IDT), IIP=$(IIP) proj=$(P)" for IDT in (true, false), IIP in (false, true), P in (1, 2, 3)
47+
@testset "IDT=$(IDT), IIP=$(IIP) proj=$(P)" for IDT in (true, false), IIP in (false, true), P in (1, 2, 3, 4)
4748
SystemType = IDT ? DeterministicIteratedMap : CoupledODEs
4849
rule = !IIP ? trivial_rule : trivial_rule_iip
4950
p0 = IDT ? p0_disc : p0_cont
5051
ds = SystemType(rule, u0, p0)
5152

52-
projection, complete = (proj_comp1, proj_comp2, proj_comp3)[P]
53+
projection, complete = (proj_comp1, proj_comp2, proj_comp3, proj_comp4)[P]
5354
pds = ProjectedDynamicalSystem(ds, projection, complete)
5455
u0init = recursivecopy(current_state(pds))
5556

0 commit comments

Comments
 (0)