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

Handling unstable systems #27

Open
agerlach opened this issue Aug 27, 2020 · 10 comments
Open

Handling unstable systems #27

agerlach opened this issue Aug 27, 2020 · 10 comments

Comments

@agerlach
Copy link
Contributor

Unstable systems are causing extremely long quadrature run times. Seems like we can mitigate this with checking the status of the ODEProblem sol.

How should we handle the pull-back with unstable systems? Simply assign Inf to the pull back? Or assign Inf to all states in S(x) and then evaluate the observable.

@ChrisRackauckas
Copy link
Member

How should we handle the pull-back with unstable systems? Simply assign Inf to the pull back? Or assign Inf to all states in S(x) and then evaluate the observable.

Yes, treat it as Inf. sol.retcode != :Success && sol.retcode != :Converged is a way to do this.

@aml5600
Copy link
Contributor

aml5600 commented Aug 27, 2020

How should we handle the pull-back with unstable systems? Simply assign Inf to the pull back? Or assign Inf to all states in S(x) and then evaluate the observable.

The latter? would allow g(x=Inf) = 0 to proceed, for example.

@agerlach
Copy link
Contributor Author

I don't know if its so simple. What about the following

function eom(u,p,t)
  [-1.0, 1.0].*u
end

g(sol) = sol[1,end]

We have decoupled stable and unstable linear system. But g is only a function of stable state. B/c of the instability, I assume we cannot trust the value of either state and I don't know if we would even know what state is unstable. So, if I assign all the states to Inf, I would get the wrong result.

@aml5600
Copy link
Contributor

aml5600 commented Aug 27, 2020

I guess the question is, do we want to target the system we intended to represent via eom of eom itself? If the latter, and we consider Inf as a "member" of the state-space then the expressions above are valid.

@agerlach
Copy link
Contributor Author

agerlach commented Aug 27, 2020

I guess the question is, do we want to target the system we intended to represent via eom of eom itself?

I'm not clear on what you are asking here.

@aml5600
Copy link
Contributor

aml5600 commented Aug 27, 2020

Floating point representation will send u[2] to Inf in finite t (actual system), u[2] -> Inf as t ->Inf for ODE system (probably system the user was trying to represent)

@agerlach
Copy link
Contributor Author

agerlach commented Aug 27, 2020

Yes, but u[1]->0 as t->Inf and g() is only a function of u[1]. I interpret that you want to do g([Inf, Inf]) which isn't correct as the first state will be finite. The issue is that the integrator would have stopped early so we don't actually know what value it would be at the final time. I don't know if I have any better idea, just trying to highlight the issue.

Its seems like in the rest of the ecosystem the suggestion is to set g()=Inf: Link

The issue I see is that in the case in the link its up to the user to decide the appropriate behavior. However, here we are imbedding that decision into the expectation() call.

@aml5600
Copy link
Contributor

aml5600 commented Aug 27, 2020

to clarify, in the case of the two dimensions I was not saying send both to Inf, rather if one (or all) states go to Inf, send them to g as is. Wouldn't that then be up to the user?

@agerlach
Copy link
Contributor Author

When I faced this problem, I was think it was going to actually require changes in expectation() outside of the user supplied g(). But now that I look at it more, I don't know if that is the case.

@agerlach
Copy link
Contributor Author

agerlach commented Aug 27, 2020

Using Quadrature.jl with g(sol)=Inf leads to a bad time 😞. I was hoping the algorithms would just stop and return Inf.

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

3 participants