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

Dynamical system "iterator" for returning back to a set in state space #319

Open
PythagoreanCult opened this issue Nov 29, 2023 · 0 comments

Comments

@PythagoreanCult
Copy link

We already have fuctionality for estimating return times.

We can simplify and re-use the codebase, by creating a new type of dynamical system, that is in discrete time, and it iterates a given dynamical system until it returns to a prescribed set with at least distance e or smaller. Here is some initial draft code:

struct ReturnDynamicalSystem
    ds::DynamicalSystem
    set::Something # the set to return to 
    mind::Real # must come at least `mind` close to set
    dt::Real
    maxt::Real # safety variable. if evolve for more than maxt without coming `mind` close, stop iteration
end

function step!(rds::ReturnDynamicalSystem)
    u = current_state(rds.ds)
    n = 0
    while distace(u, rds.set) > rds.mind
        step!(rds.ds)
        u = current_state(rds.ds)
        n += 1
        if n > rds.maxt 
            error("we didn't return in time")
        end
    end
    rds.dt = n
    return rds
end

rds = ReturnDynamicalSystem(ds, ...)

step!(rds) # evolve the internal ds until it comes `mind` close to the set
# and in the field `.dt` it would have recorded how much time this took 
u_close = current_state(rds)
n = rds.dt

step!(rds)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant