-
Notifications
You must be signed in to change notification settings - Fork 20
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
better initial guess and fps = 20 for reduced running time #239
base: master
Are you sure you want to change the base?
better initial guess and fps = 20 for reduced running time #239
Conversation
Yes, basically there will be an upper limit of examples we can include as the times all add up. It is always helpful to redeuce their running time. |
solution, info = prob.solve(initial_guess) | ||
print('message from optimizer:', info['status_msg']) | ||
print('Iterations needed', len(prob.obj_value)) | ||
print(f'Optimal h = {solution[-1]:.3e} sec') | ||
np.save('ball_rolling_on_spinning_disc_solution.npy', solution) |
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 will now show up in the docs directory every time you build locally and will have to be manually removed. Either remove this line or include it in a comment.
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 will now show up in the docs directory every time you build locally and will have to be manually removed. Either remove this line or include it in a comment.
I simply forgot to remove it. I wil include in a comment, so people can see how to save a good initial guess for later use.
I will look at them one by one. Hopefully I can shave off a few seconds on some oth them. |
# final_state_constraints[y], num_nodes) | ||
# -i1 = -i3 / par_map[r] | ||
# -i4 = np.zeros(8*num_nodes) | ||
# -initial_guess = np.hstack((i1,i1a, i1b, i2, i3, i4, 0.01)) |
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.
Also, for examples it is best not to have commented code. You can create this initial guess and then overwrite it with the npy file just like you did in the other.
fig1, ax1 = plt.subplots(14, 1, figsize=(7.25, 0.75*14), sharex=True, | ||
layout='constrained') | ||
prob.plot_trajectories(initial_guess, ax1) | ||
|
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.
If you delete a figure, then the thumbnail figure may change, have you checked that? There will no longer be a figure 7, right?
I don't see any reason to delete the figure.
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.
If you delete a figure, then the thumbnail figure may change, have you checked that? There will no longer by a figure 7, right?
I don't see any reason to delete the figure. Is this related the the mixed up PRs?
I did not intentionally delete this. No idea what happened. Is this related to the mixed up PRs?
I will check and push again.
@@ -349,8 +349,10 @@ def obj_grad(free): | |||
) | |||
|
|||
# %% | |||
# The initial guess should meet the configuration constrains. It will be | |||
# plotted below. | |||
# The initial guess should meet the configuration constrains. Those below are |
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.
# The initial guess should meet the configuration constrains. Those below are | |
# The initial guess should meet the configuration constraints. Those below are |
I do not know, why it failed a test before, do not understand the message. |
By giving better initial guesses and reducing fps to 20 from 30 running time reduced from 47 sec to 38 sec on my PC.
Are such improvements worth doing them? If yes, I will have a look at other simu,ations in examples-gallery, too. II have time and Betts' book has not arrived, yet)