-
Notifications
You must be signed in to change notification settings - Fork 23
estimate time shift #430
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
estimate time shift #430
Conversation
| inert = me.inertia(A, 0, 0, iZZ) | ||
| bodies = [me.RigidBody('body', P, A, m, (inert, P))] | ||
| # Driving force set to zero for t < delta | ||
| torque = F * sm.sin(omega*(t - delta)) * sm.Heaviside(t - delta) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is equivalent to a phase shift in the sin(): sin(w*t + phi).
opty does not yet support having time explicit in the equations of motion and we have shown how to make time explicit by introducing a variable T(t) in another example. So I'm not sure this adds any new tricks for a reader of the documentation. Let me know otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, nothing new here.
I will think of an example with explicit time, maybe Betts has one. My rolling ball on a spinning disc had explicit time, but I used your trick there with a known trajectory, as it made more sense.
|
Now I ran into something odd: I wrote Backend='numpy' accepted this without any issues, but backend='cython' raised a long error. 'numpy' seems raise the same error, just took it much longer to get there. |
|
I used
I will push this new version, with additional comments in the docstrings again. If what I found is correct, this may be an interesting example? |
|
Are you saying that |
It worked for me, if this is the argument of a known function, like sm.sin(omega(T(t) - delta)). |
|
The thing we are trying to solve with Christoph's PR is that an unknown state or input variable is a delayed function of time. It still is not clear if you are addressing the same issue or something else. |
|
No, this is not the same issue I am addressing. I have not tried anything like state_variable(omeaga(t - delta)). |
|
If |
|
Fair enough! An unknown parameter of course is an unknown constant. |
|
I pushed again for two reasons;
|
|
This example shows how to use |
|
I mentioned this in my comment. This where I got the idea to use it in my spinning disc. However I feel my second observation, if correct (all my tests confirmed it) is more interesting, and does seem to show something new. |
|
If you have a workaround to get expclit time working with variable time step, then we should show that. Maybe even in place of the idea shown in https://opty.readthedocs.io/stable/examples/beginner/plot_betts2003.html
I still don't understand what you are showing.
Testing whether these backends fail is not that pertinent. I know they will fail because they were not designed to do what you want them to do. The failure is very likely the same reason even if the raised error occurs at a different line in the code. |
Making T(t) a state variable, setting T(t).diff(t) = 1.0 in the oems works for variable time. I will write a simulation and push it.
What I want to show is this (based on my misunderstanding of Chris' needs): Say the known function of the driving force is This is want I want to show.
As you say, opty was not designed to do what I wanted it to do - but with the workaround using |
|
I looked at |
I wanted to play around with #294
Unfortunately, I misunderstood the issue, so this does not solve #294
What it does is this:$\delta$ (and on the way also F and $\omega$ ) if the driving force is e.g. $F\sin(\omega(t - \delta))$
It estimates
(of course sin could be replace by another given function)