-
Notifications
You must be signed in to change notification settings - Fork 22
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
residual function #253
Comments
@cmichelenstrofer - I'm a bit confused by your comment above. The scaled residual function is indeed created in Lines 766 to 770 in 6c9b852
but there is a hidden function for the residual equation that a user can call Lines 604 to 612 in 6c9b852
|
To print all the residuals (each DOF at each time step) you can do something like this: def callback(wec, x_wec, x_opt, waves):
wot._log.info(f"dynamic equation residual: {wec.residual(x_wec, x_opt, waves)}")
return or to just check if it is satisfied: def callback(wec, x_wec, x_opt, waves):
wot._log.info(f"dynamic equation residual: {np.allclose(wec.residual(x_wec, x_opt, waves), 0)}")
return The callback is called after each iteration. I tried it with Tutorial 1 and the condition is satisfied after the first iteration (never prints Similarly the callback could include user defined constraints functions. |
The hydrodynamic bodies's residual constraint is built in the
core
solver. One can recreate it with the post-processed time-series, but it might be useful to just supply a function that does this calculation. The main residual (and any other equality constraint) could also be printed during the optimization output.The text was updated successfully, but these errors were encountered: