-
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
Velocity Constraints and The effect of the Scaling on the Mechanical Power #310
Comments
Here is how we construct the RM3:
|
Apologize the delayed response @En-Lo. This is an interesting approach that we haven't tried before. I haven't fixed all the issues and I can't confidently say that we easily can get constraints like this to work, but we can try to help you. The suggestions are implemented in the attached file Considering the dimensions of the device, all mechanical power results are basically zero so let's ignore the scaling for now and focus on the constraints. Issues with implementation:
Other issues:
Recommendations:
def auxiliary_nsub_td(wec, x_wec, x_opt, waves):
aux_fd = x_opt[nstate_pto:] # auxiliary continuous time-varying decision variable, a >= 0
time_matrix = wec.time_mat_nsubsteps(nsubsteps)
aux_td = np.dot(time_matrix,aux_fd)
return aux_td
nstate_pto = 2 * nfreq # PTO forces
nstate_a = 2*nfreq # instead of wec.nt * nsubsteps #
def pto_force_td(wec, x_wec, x_opt, waves, nsubsteps=1):
fpto_td = pto.force_on_wec(wec, x_wec, x_opt[:nstate_pto], waves, nsubsteps)
return fpto_td
def pto_velocity_td(wec, x_wec, x_opt, waves, nsubsteps=1):
velpto_td = pto.velocity(wec, x_wec, x_opt[:nstate_pto], waves, nsubsteps)
return velpto_td
f_add = {'PTO': pto_force_td}
def mechpower_avg(wec, x_wec, x_opt, waves, nsubsteps=1):
fpto_td = pto_force_td(wec, x_wec, x_opt, waves, nsubsteps)
velpto_td = pto_velocity_td(wec, x_wec, x_opt, waves, nsubsteps)
mechpow = fpto_td*velpto_td
mech_energy = np.sum(mechpow)
return mech_energy* wec.dt/nsubsteps / wec.tf
obj_fun = mechpower_avg the sum in the re-defined objective function requires Again, interesting way to formulate a desired behavior and that you basically couple both velocity and force constraints with an entirely new optimization variable and I don't want to discourage you from finding a way to implement it, but I do wonder what the intentions are of operating a WEC like this? |
for the scaling... you should not use a single scalar for the |
@En-Lo We are working to close some old issues. Are you still working on this problem? Did @dtgaebe and @cmichelenstrofer 's suggestions help? |
Describe the issue
We are trying to implement velocity constraints to solve for mechanical power of RM3 by following the formula:
and here is our code for the constraints:
Although the code successfully spits out the mechanical power with certain combinations of scale_x_wec, scale_x_opt, and scale_obj, these scaling factors have to be greater than 1 and influence the value of mechanical power greatly (ranging from 10^-15 to 10^-1). For instance, with scale_x_wec = 1e5, scale_x_opt = 1e2, and scale_obj = 1e3, power = -4.54e-1; with scale_x_wec = 1e1, scale_x_opt = 1e5, and scale_obj = 1e4, power = -1.22e-15.
my questions are:
To Reproduce
System:
The text was updated successfully, but these errors were encountered: