plots.matlab_figs
- plots.matlab_figs.SOO_result_plots(Xs_opt, lambdas, grads, hesses, objs_opt, which_objs, p, b)
Function
SOO_result_plots()- Parameters:
Xs_opt – Xs_opt
lambdas – lambdas
grads – grads
hesses – hesses
objs_opt – objs_opt
which_objs – which_objs
p – Parameter struct
b – Design variable bounds struct
- Returns:
Figure handles
- Returns:
tab
- plots.matlab_figs.plot_nominal_constraint_circles(val, existing_axes)
PLOT_NOMINAL_CONSTRAINT_CIRCLES Visualize QCQP constraint circles in Gamma plane for the nominal design at the most constrained sea state. Shows the force, amplitude, and positive-power constraint circles with the feasible region shaded, directional arrows, and constraint labels.
- Inputs:
val -
simulation()output struct (must contain val.qcqp_debug)- Output:
fig - figure handle
- plots.matlab_figs.make_slamming_plot(T, Hs, phase_X, theta_slam, X_slam_max, X_slam_min, X_mag)
Function
make_slamming_plot()- Parameters:
T – wave energy period (s)
Hs – significant wave height (m)
phase_X – $\angle$ X
theta_slam – $\theta$ slam
X_slam_max – X_slam_max
X_slam_min – X_slam_min
X_mag – X_mag
- Returns:
fig
- plots.matlab_figs.b_inf_numeric()
Function
b_inf_numeric()- Returns:
Figure handle
- plots.matlab_figs.experiments_plot(b, X_ins, ratios, LCOE, cost, power, failed, pareto_results_struct)
Function
experiments_plot()- param b:
Design variable bounds struct
- param X_ins:
X_ins
- param ratios:
ratios
- param LCOE:
Levelized cost of energy ($/kWh)
- param cost:
cost
- param power:
power
- param failed:
Indices or names of violated constraints
- param pareto_results_struct:
pareto_results_struct
- returns:
Figure handles
- returns:
results_tab
EXPERIMENTS_PLOT Post processing for design space exploration
- plots.matlab_figs.module_runtime_compare(p, profile_multibody, profile_singlebody, profile_freq_domain, t_multibody_fullsim_timeit, t_singlebody_fullsim_timeit, t_freq_domain_fullsim_timeit, t_wecsim, profile_no_amp_sat, t_no_amp_sat_timeit, profile_no_force_amp_sat, t_no_force_amp_sat_timeit)
Function
module_runtime_compare()- Parameters:
p – Parameter struct
profile_multibody – profile_multibody
profile_singlebody – profile_singlebody
profile_freq_domain – profile_freq_domain
t_multibody_fullsim_timeit – t_multibody_fullsim_timeit
t_singlebody_fullsim_timeit – t_singlebody_fullsim_timeit
t_freq_domain_fullsim_timeit – t_freq_domain_fullsim_timeit
t_wecsim – t_wecsim
profile_no_amp_sat – profile with use_amp_sat=false
t_no_amp_sat_timeit – timeit with use_amp_sat=false
profile_no_force_amp_sat – profile with use_amp_sat=false and use_force_sat=false
t_no_force_amp_sat_timeit – timeit with use_amp_sat=false and use_force_sat=false
- Returns:
figs
- Returns:
pct_runtime_MEEM
- Returns:
pct_runtime_dynamics
- Returns:
pct_runtime_other
- plots.matlab_figs.all_sens_plots(par_J_par_p_local, dJ_star_dp_quad_local, dJ_star_dp_lin_local, dJstar_dp_global, par_x_star_par_p_local, par_x_star_par_p_global, delta_p_change_activity_local, delta_p_change_activity_global, param_names, dvar_names, b)
Function
all_sens_plots()- Parameters:
par_J_par_p_local – par_J_par_p_local
dJ_star_dp_quad_local – dJ_star_dp_quad_local
dJ_star_dp_lin_local – dJ_star_dp_lin_local
dJstar_dp_global – dJstar_dp_global
par_x_star_par_p_local – par_x_star_par_p_local
par_x_star_par_p_global – par_x_star_par_p_global
delta_p_change_activity_local – $\delta$ p change activity local
delta_p_change_activity_global – $\delta$ p change activity global
param_names – param_names
dvar_names – dvar_names
b – Design variable bounds struct
- Returns:
Figure handles
- plots.matlab_figs.compare(p, b, X, vals)
Function
compare()- Parameters:
p – Parameter struct
b – Design variable bounds struct
X – Design variable vector
vals – vals
- Returns:
DV_table
- Returns:
out_table
- Returns:
Figure handles
- plots.matlab_figs.spar_hydro_plot()
Function
spar_hydro_plot()- Returns:
f
- plots.matlab_figs.constraint_active_plot(residuals, fval, tol, b, reversed)
Function
constraint_active_plot()- Parameters:
residuals – residuals
fval – fval
tol – tol
b – Design variable bounds struct
reversed – reversed
- Returns:
idx
- Returns:
f
- plots.matlab_figs.slam_plot()
Function
slam_plot()- Returns:
Figure handle
- plots.matlab_figs.optimplotx_custom(x, optimValues, state, b)
Function
optimplotx_custom()- Parameters:
x – Design variable vector
optimValues – optimValues
state – state
b – Design variable bounds struct
- Returns:
stop
optimplotfvalconstr Plot value of the objective function vs iteration. Infeasible points are marked red. If no fval is available, this function will plot constraint violation (infeasibility).
- plots.matlab_figs.sin_desc_fcn_demo()
Function
sin_desc_fcn_demo()- Returns:
Figure handles
- plots.matlab_figs.force_sat_results(p, b)
Function
force_sat_results()- Parameters:
p – Parameter struct
b – Design variable bounds struct
- Returns:
Figure handle
- Returns:
fig2
- plots.matlab_figs.power_PDF(X, p, color, t, which_plots)
Function
power_PDF()- Parameters:
X – Design variable vector
p – Parameter struct
color – color
t – t
which_plots – which_plots
- Returns:
t
- plots.matlab_figs.multistart_postpro(p, b, X_opt, objs, flags, x0s, num_runs)
Function
multistart_postpro()- Parameters:
p – Parameter struct
b – Design variable bounds struct
X_opt – Optimal design variables
objs – objs
flags – Optimization output flags
x0s – x0s
num_runs – num_runs
- Returns:
treeFig
- Returns:
parallelFig
- Returns:
barFig
- Returns:
results
- plots.matlab_figs.plot_drag_integral_debug(B_drag, mag_v, phase_v, K_drag, X_guess, phase_X_guess, B_drag_2, gamma_drag)
- plots.matlab_figs.make_ctrl_polar_plot(MAG_GUESS, PHASE_GUESS, real_P, constraint_err, idx_opt, mag_ctrl_mult_stabilized, phase_ctrl_mult_stabilized)
Function
make_ctrl_polar_plot()Visualisation of the brute-force controller search grid on complex axes. Selects the sea state with the highest optimal power and shows:
- power as a pcolor patch map using a log10-scaled radius:
r = log10(|alpha|) - log10(min|alpha|)
so that cells are spread out in the radial direction.
cross-hatching where constraint_err ~= 0 (legend: ‘Constraint violated’)
single-line red hatching where power is Inf (legend: ‘Unstable’)
star marker at the controller with maximum power
scatter overlay of stabilized controllers that differ from the grid
Hatching uses per-cell quadrilateral patches (
hatchfill2()on a multi-face patch) so hatch boundaries follow cell edges exactly.Cells are centred at the true grid coordinates: corner vertices are constructed as midpoints between adjacent centres in (log_r, phase) space, with the inner radial edge clamped to 0.
- Parameters:
MAG_GUESS – meshgrid of ctrl mult magnitudes (n_phase x n_mag)
PHASE_GUESS – meshgrid of ctrl mult phases in rad (n_phase x n_mag)
real_P – power in W (n_Hs x n_T x n_ctrl), unmodified raw values
constraint_err – constraint error scalar (n_Hs x n_T x n_ctrl)
idx_opt – optimal controller index for each sea state (n_Hs x n_T)
mag_ctrl_mult_stabilized – (optional) stabilized ctrl mult magnitudes (n_Hs x n_T x n_ctrl)
phase_ctrl_mult_stabilized – (optional) stabilized ctrl mult phases in rad (n_Hs x n_T x n_ctrl)
- Returns:
fig Cartesian alpha-space figure handle
- Returns:
fig_gamma Polar gamma-space figure handle
- plots.matlab_figs.lagrange_multiplier_bar_chart(b, lambda)
Function
lagrange_multiplier_bar_chart()- param b:
Design variable bounds struct
- param lambda:
$\lambda$
- returns:
Figure handle
LAGRANGE_MULTIPLIER_BAR_CHART
- plots.matlab_figs.plot_drag_convergence(X_f_guesses, X_s_guesses, phase_X_f_guesses, phase_X_s_guesses, iters, multibody, X_tol, phase_X_tol)
Function
plot_drag_convergence()- Parameters:
X_f_guesses – X_f_guesses
X_s_guesses – X_s_guesses
phase_X_f_guesses – phase_X_f_guesses
phase_X_s_guesses – phase_X_s_guesses
iters – iters
multibody – multibody
X_tol – max allowable iteration error on magnitude of amplitude (m)
phase_X_tol – max allowable iteration error on phase angle of amplitude (rad)
- Returns:
Figure handle
- plots.matlab_figs.plot_net_value
calculate revenue and avoided carbon power/energy power
- plots.matlab_figs.unittest_time_bar_chart(suite, results)
Function
unittest_time_bar_chart()- Parameters:
suite – suite
results – results
- Returns:
figOut
- plots.matlab_figs.circle_intersect_script()
Generates the QP circles figure showing circle intersection optimization test cases used in the quadratic programming control analysis. Extracted from dev/
dynamics()/opt_ctrl_qp/circle_intersect.mlx.
- plots.matlab_figs.visualize_geometry(x, p, mini, color)
Function
visualize_geometry()- Parameters:
x – Design variable vector
p – Parameter struct
mini – mini
color – color
- Returns:
Figure handle
- plots.matlab_figs.optim_geomviz(x, p, b)
Function
optim_geomviz()- Parameters:
x – Design variable vector
p – Parameter struct
b – Design variable bounds struct
- Returns:
Optimization output flag
- plots.matlab_figs.global_sens_plots(ratios, LCOE, LCOE_nom, P_var, Pvar_nom, param_names, num_DVs, X_LCOE, X_LCOE_nom, dvar_names, X_Pvar, X_Pvar_nom, slope_LCOE_norm, slope_Pvar_norm, slope_X_LCOE_norm, slope_X_Pvar_norm, param_table)
Function
global_sens_plots()- Parameters:
ratios – ratios
LCOE – Levelized cost of energy ($/kWh)
LCOE_nom – LCOE_nom
P_var – P_var
Pvar_nom – Pvar_nom
param_names – param_names
num_DVs – num_DVs
X_LCOE – X_LCOE
X_LCOE_nom – X_LCOE_nom
dvar_names – dvar_names
X_Pvar – X_Pvar
X_Pvar_nom – X_Pvar_nom
slope_LCOE_norm – slope_LCOE_norm
slope_Pvar_norm – slope_Pvar_norm
slope_X_LCOE_norm – slope_X_LCOE_norm
slope_X_Pvar_norm – slope_X_Pvar_norm
param_table – param_table
- Returns:
Figure handles
- plots.matlab_figs.plot_power_matrix(X, p, b, filename_uuid)
Function
plot_power_matrix()- Parameters:
X – Design variable vector
p – Parameter struct
b – Design variable bounds struct
filename_uuid – filename_uuid
- Returns:
Figure handle