-
Notifications
You must be signed in to change notification settings - Fork 57
Control optimal gains interpolation #96
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
Control optimal gains interpolation #96
Conversation
Adds semicolon to one of the lines
|
@MShabara Thanks for these updates! They look good, just waiting on the latching and declutching cases. |
|
@jtgrasb There appears to be a bug in When calculated manually, the device’s natural frequency is 1.2853 rad/s, but the functions in the latching and declutching cases compute it as 1.4500 rad/s. This discrepancy leads to incorrect latching and de clutching time values. The main reason for this difference is the definition of the added mass. For the latching control: When manually setting the natural frequency in the functions to 1.2853 rad/s, the resulting times match the optimal values obtained from the parameter sweep using the MCR. For declutching control: Correcting the natural freq does not solve the issue Do you have an idea of what might be wrong? |
|
@MShabara What do you mean by calculating the natural frequency manually? By running a free decay test? |
|
@jtgrasb this is actually an interesting question, there are two ways to do that: 1- The first is using the SDOF natural freq equation for heave only motion 2- Second using the decay test by applying
When trying to get the natural freq graphically using the This value is close to the one the |
|
@MShabara Thanks for explaining. I was also confused so did some digging:
|
|
Thanks for this clarification, I think the explanation you mentioned in the first point should be added in the documentation as well in PR 1553 Correct me if I’m wrong, but my understanding of
If this is correct, it worth adding it to the PR too. The difference between them is not clearly documented in WEC-Sim. Then when using |
|
@MShabara Yes, I believe your explanation is correct. A regular wave is a purely linear based on the velocity and radiation damping coefficient at a single frequency. A regularCIC wave uses the convolution integral (which takes into account the entire spectrum) and infinite frequency added mass. I think these are already described in the code structure section, but it could definitely be improved. However, the impedance representation is still accurate for either wave type and the result in terms of resonance is still the same. To show this, I ran regularCIC: When using the infinite frequency added mass, the predicted optimal gain is not accurate to the actual optimal gain. |





This PR updates the
optimalGainCalcfiles for the P and PI controllers to compute the gains and power using interpolated hydrodynamic coefficients instead of relying on the values at the nearest frequency.Benefit:
Interpolating the hydrodynamic coefficients improves the accuracy of the computed gains and power, especially when the hydrodynamic data is available only at coarse frequency intervals.
Below are a comparison of the codes results before (-- orange) and after the modification (blue)

PI:
P:
