-
-
Notifications
You must be signed in to change notification settings - Fork 217
MTK allows you to create faulty events without throwing an error. #2612
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
Comments
If we used the shift-index notation to describe the affect, we could actually handle cases like discrete_events = 5.0 => [X + 1.0 ~ X + 10.0] since it would be well-defined which discrete_events = 5.0 => [X(k) + 1.0 ~ X(k-1) + 10.0] for |
That's a pretty interesting proposal. We'd have to make validate that only a single shift is given but that would make that implicitness become explicit. |
I think the general answer here is actually the use of an implicit discrete system for the callback designation. |
What's the relationship between this one and #2077 ? I assume this issue need fixing currently (so that all of Torkel's examples throw an error when the ODESystem is declared) and the ImplicitDiscreteSystem thing is separate? |
Well the way to make all symbolic events in a naturally robust way would be to use ImplicitDiscreteSystem. Instead of having the user define a function like But in reality, the issue with events on DAEs is that they have other conditions to satisfy. If you have for example the pendulum, If you do this, then it's simply better defined what the syntax means, then a lot of these other cases can actually be supported. |
So this issue is just about a couple of erroneous inputs that do not generate errors on system creation. The obvious example would be that discrete_events = "A dIScreTe EvENtzzz"
@mtkbuild osys = ODESystem(eqs, t; discrete_events) should (and will) generate an error. However, there are a couple of notations that are wrong and will generate errors at some point of the pipeline. However, this is typically in the Then there is events for DAEs, which as Chris mentions might be a bit of a mess. |
But because we already know that we want to make this not be a separate kind of system and instead just an implicit discrete system, what we can do is just finish ImplicitDiscreteSystem, and then this would all just validate in the constructor for that, just like how we validate ODESystems. The issue is that right now the event code is just weird and non-standard, so by making it standard everything else follows. In other words, we just need to delete the current implementation. |
that I won't disagree with |
I have gone through the events in MTK. There are several cases where MTK allow your to build a system with a misformated event, and an error is not actually thrown until you create a problem or attempts to simulate it. Especially since it is a fit trick how to format the events, the errors should be thrown at the first possible time (when a system is created).
The text was updated successfully, but these errors were encountered: