-
Notifications
You must be signed in to change notification settings - Fork 21
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 example for a multiphase problem. #333
base: master
Are you sure you want to change the base?
Conversation
Let me think about it. :-) |
There is essentially just 1 eom in this case because the block is always sliding: but at If you break the EoM into the moving right and moving left portions, then you can remove the dicontinuity in the EoM. So then you do have 2 EoMs, one for before and one after. |
As I understood the equations in your code, F = 0 after the impact, the equation above seems to imply F is present always?
I guess with Newtonian impact, by definition the speed will change discontinuously - something opty does not like. I am asking, so I know in which direction to think. |
I wrote one equation in this comment, but I split it into two in the opty formulation. |
The point of this example is to avoid discontinuities when transitioning between phases of a problem. I can solve this with an impact force, but that's not the purpose. Sometimes you want to model transitions from one eom to another, e.g. standing on the ground, jumping off, and landing but not have to model the contact forces with things such as Hunt-Crossely. Newton's momentum exchange is a perfectly good model for impact also. |
All clear now to me, I think. |
Could this be done as a two stage problem, similar to PR #262 ? In your example, splitting it up will simply result in using maximum force until impact, and in the second phase there is no control left for opty to do anything with. It will just slide. In PR #262 the second phase is depending on the first one, through the amount of fuel left. (the third phase is like your second phase: nothing left to be controlled) So, I guess the goal must be to do it in one stage (splitting it up is 'primitive') - let me think along these lines. |
Yes, I want to solve these kinds of problems where all phases are solve simultaneously. My example here may be able to be solved by separating into multiple optimal control problems but, in general, we'd like to solve problems this way that cannot be solved separately. That's what I'm trying to do, but there may not be a "hack" to get opty to do this. It may be something we have to build into opty more carefully. |
I do not know, but I am getting clearer in the direction of thinking. |
I realized that we can probably do multiphase problems with something like this. But I am currently limited to the duration of each phase having to be equal. @Peter230655 any ideas on how to let this block collide with the wall at any time? My intuition is that I need to move the collision equation from the instance constraints into the DAE somehow.