Skip to content

Conversation

@Yuksel-Rudy
Copy link
Collaborator

  • Reorganizing the plotOptimization function to separate design variables from constraints and cost function. It also gives units to different variables and constraints. It is also color-referenced. Here's an example of an optimization run for a shared line (previously, it was hard to see all plots in one column and now putting the name of d.v./constraints/cost as a title (with units) instead of it being a y-label):
Screenshot 2025-10-05 at 1 40 51 PM

If one constraint is not met, it will be plotted in red color to alert the optimizer this constraint is violated.

Screenshot 2025-10-05 at 1 42 05 PM
  • Adding units dictionary for constraints.
  • Adding two additional constraints related to the inclination angle of the line (works with either shared or anchored line). This could either be used as an alternative to min/max sag to control how deep the line should go in the water column but mostly it's helpful to control the line inclination angle to prevent it from colliding/intersecting with another line/cable sharing the same x-z plane. Here's an example of using minAngle and maxAngle on a shared line (with the settings setup. Here, index is 2 since we're interested in the fairlead angle. Remember since it's a shared line and it's set to be symmetrical, LineDesign sees half the line):
Screenshot 2025-10-05 at 1 43 06 PM

- Reorganizing the plotOptimization function to separate design variables from constraints and cost function. It also gives units to different variables and constraints. It is also color-referenced.
- Adding units dictionary for constraints.
- Adding two additional constraints related to the inclination angle of the line.
@Yuksel-Rudy Yuksel-Rudy requested a review from mattEhall October 6, 2025 01:45
@mattEhall
Copy link
Contributor

Awesome improvements in here! I have some requests/suggestions we can discuss:

  • y-axis labels: Think we should keep using them. Labeling y axis via title is uncommon.
  • Maybe the constraint threshold values could be displayed inside the plot rather than in the y label to save space.
  • Units in () rather than [] so it matches what we'd put in a paper.
  • X axis label only on bottom subplots since we're using sharex=True, to save space.
  • Can we also support the original arrangement where all the subplots are stacked vertically (add an option to the function)

- having option to switch between stacked 'tall' and a grid type. Default is tall.
- having ylabels instead of titles.
- other improvements to make sure there is no overlays between the subplots.
@Yuksel-Rudy
Copy link
Collaborator Author

Ok. sounds good. Now you have the option to switch between layout='tall' and layout='grid' with the default being 'tall' (just like it was).

Screenshot 2025-10-06 at 1 04 51 PM

@Yuksel-Rudy
Copy link
Collaborator Author

Reorganizing the plotOptimization function to
This pull request enhances the LineDesign class by adding unit tracking for design variables and constraints, introducing new angle constraints, and improving the plotting of optimization results. The changes improve clarity, traceability, and usability for both developers and users working with mooring line design optimization.

Units tracking and assignment

  • Added allVarsUnits to track units for each design variable, and X0Units to associate units with the active design variables. This ensures that units are consistently available throughout the optimization process. [1] [2]
  • Implemented a dictionary (conUnitsDict) to assign units to each constraint, and updated the constraints dictionary to include these units. An exception is raised if a constraint name is not recognized.

New constraints

  • Added two new constraint functions: con_min_angle and con_max_angle, enforcing minimum and maximum inclination angles for line sections. These are now available for use in optimization. [1] [2]

Plotting improvements

  • Refactored and enhanced the plotOptimization method to support both "tall" and "grid" layouts, display units for design variables and constraints, and allow returning the figure and axes for further customization.

@Yuksel-Rudy Yuksel-Rudy merged commit 956ed5e into dev Oct 9, 2025
12 checks passed
@Yuksel-Rudy Yuksel-Rudy deleted the LineDesignUpdate branch October 9, 2025 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants