-
Notifications
You must be signed in to change notification settings - Fork 24
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
Feature request: apply nsubsteps
to dynamics equality constraint
#307
Comments
After thinking about it some more, instead of the default |
To recap the discussion regarding this issue today:
@rebeccamccabe was there anything else you were hoping to be addressed with this issue? If not, I will go ahead and close it. |
The main idea is this:
|
Sounds good. The main thing I’m still unclear about is the intuition on why the frequency vector and time vector are coupled in the pseudo spectral method. I looked at Giorgio’s thesis and the unnumbered equation below eq 4.96 seems to show this relationship but doesn’t explain. My intuition is saying that even with a single frequency, it’s possible to discretize the sin wave with a different number of points in time and enforce dynamics at those times, so I’m not sure why the Fourier transform demands differently. |
@rebeccamccabe in that case you would have more equations (equality constraints) than unknowns and the problem is over determined. I guess you could still optimize it and you would get a best fit (based on some error measure for the objective function). But if you want to solve for an exact solution you need as many collocation points (equality constraints) as you have variables. This is not an issue for inequality constraints (e.g. max force) for which the solution is a subspace not a single point. |
Ah that makes a lot of sense, thanks! Does that mean the problem is also over constrained if the user adds more non-dynamics equality constraints than there are variables in x_opt? |
Yes, that is correct. |
Feature description.
Right now
nsubsteps
only applies to the user-defined constraints, but I propose that it also applies to the internal dynamics equality constraint. This is needed when running with a regular wave and limiting the frequencies to a few harmonics of the excitation wave, sonfreq
is rather small (ie 5), and therefore the dynamics are not enforced at very many timesteps (9). Or, allowing the user to specifynt
rather than fixing it toncomponents
would work too.If we figured out how to quantify the error as a function of number of collocation points in the pseudospectral method, perhaps in the long term
nt
could be calculated based on a user-specified error tolerance, which is how the step size is chosen in a regular ODE solver. But for now, any option in the API to changent
independently fromnfreq
would be helpful, whether it is directly or throughnsubsteps
.Describe alternatives you've considered
Currently I am just setting
nfreq
higher than I otherwise would, in order to get enough timesteps. This is fine for now but eventually when I am doing bigger problems, the increased size of the optimization problem could interfere with performance.Interest in leading this feature development?
This is more of an API thing so I'm not particularly interested. Perhaps it aligns with the work being done in #292.
The text was updated successfully, but these errors were encountered: