Skip to content

Commit

Permalink
Fix PTO force attribute and tutorial 1 constraint (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtgrasb authored Oct 8, 2024
1 parent 362b78c commit fa0b584
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/tutorial_1_WaveBot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@
"nsubsteps = 4\n",
"\n",
"def const_f_pto(wec, x_wec, x_opt, waves): # Format for scipy.optimize.minimize\n",
" f = pto.force_on_wec(wec, x_wec, x_opt, waves, nsubsteps)\n",
" f = pto.force(wec, x_wec, x_opt, waves, nsubsteps)\n",
" return f_max - np.abs(f.flatten())\n",
"\n",
"ineq_cons = {'type': 'ineq',\n",
Expand Down Expand Up @@ -974,7 +974,7 @@
" f_max = 750.0\n",
"\n",
" def const_f_pto(wec, x_wec, x_opt, waves):\n",
" f = pto.force_on_wec(wec, x_wec, x_opt, waves, nsubsteps)\n",
" f = pto.force(wec, x_wec, x_opt, waves, nsubsteps)\n",
" return f_max - np.abs(f.flatten())\n",
"\n",
" ineq_cons = {'type': 'ineq', 'fun': const_f_pto}\n",
Expand Down
2 changes: 1 addition & 1 deletion wecopttool/pto.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ def _postproc(wec, res, waves, nsubsteps):
vel_attr = {'long_name': 'Velocity', 'units': 'm/s or rad/s'}
acc_attr = {'long_name': 'Acceleration',
'units': 'm/s^2 or rad/s^2'}
force_attr = {'long_name': 'Force or moment on WEC',
force_attr = {'long_name': 'PTO force or torque',
'units': 'N or Nm'}
power_attr = {'long_name': 'Power', 'units': 'W'}
mech_power_attr = {'long_name': 'Mechanical power', 'units': 'W'}
Expand Down

0 comments on commit fa0b584

Please sign in to comment.