simulation.run

simulation.run.run_single(p, b, X)

Function run_single()

Parameters:
  • p – Parameter struct

  • b – Design variable bounds struct

  • X – Design variable vector

Returns:

Figure handless

Returns:

LCOE

Returns:

output value struct

Run and plot a single design. Defaults to nominal design if no X input.

simulation.run.experiments(p, b)

Function experiments()

Parameters:
  • p – Parameter struct

  • b – Design variable bounds struct

Returns:

X_ins

Returns:

ratios

Returns:

Levelized cost of energy ($/kWh)

Returns:

cost

Returns:

power

Returns:

Indices or names of violated constraints

simulation.run.power_matrix_compare(X, p, wecsim_filename, report, override)

Function power_matrix_compare()

Parameters:
  • X – Design variable vector

  • p – Parameter struct

  • wecsim_filename – wecsim_filename

  • report – report

  • override – override

Returns:

weighted_power_error

Returns:

max_float_amp_error

Returns:

power_mech_err_matrix

Returns:

float_amp_err_matrix

Returns:

Figure handles

simulation.run.convergence_study()

settings

simulation.run.run_and_catch_warnings(fcn, warning_ids, nout)

RUN_AND_CATCH_WARNINGS Call a function once, silently capturing warnings.

This function saves the current warning state (restoring it via onCleanup), configures warning display so that each warning’s printed text contains its identifier string, then runs FCN exactly once inside evalc so that all Command-Window output — including warning messages — is captured rather than printed to the terminal. After the call it counts occurrences of each identifier in WARNING_IDS in the captured text.

Warning states do NOT need to be in any particular state before this call; this function handles all promotion and restoration internally.

Implementation detail: MATLAB’s verbose warning mode adds the line

(Type “warning off <identifier>” …)

to every warning printout. This makes the identifier searchable in the evalc-captured text without requiring warnings to be elevated to errors.

Parameters:
  • fcn – Zero-argument function handle, e.g. @() myfun(a, b).

  • warning_ids – 1×M cell array of warning identifier strings to detect, OR the string ‘all’ to detect all warnings of any identifier that fire during fcn.

  • nout – Number of output arguments to request from fcn.

Returns:

outputs – 1×nout cell array of outputs from fcn. warning_hit – When warning_ids is a cell: 1×M integer array counting

how many times each warning fired. When warning_ids is ‘all’: containers.Map from warning identifier string to integer count (only IDs that fired are present as keys).

captured_text – char vector of all text captured by evalc.

simulation.run.check_max_CW(filename_uuid, p, b_or_X, plot_on)

Function check_max_CW()

Parameters:
  • filename_uuid – filename_uuid

  • p – Parameter struct

  • b_or_X – b_or_X

  • plot_on – plot_on

Returns:

hydro_ratio

Returns:

P_wave

Returns:

CW_max

Returns:

P_elec

Returns:

force_sat_ratio

Returns:

drag_ratio

Returns:

eff

Returns:

val_no_drag

Checks whether the maximum radiation-limited capture width is violated. b_or_X: provide b (or no input) if you want to use the design with highest avg power (worst case), vs provide X if you want to check a certain design.

simulation.run.validate_MEEM()

Function validate_MEEM()

Returns:

figPotMatch

Returns:

figVelMatch

Returns:

figAMatrixSparsity

Returns:

figHydroCoeff

simulation.run.validate_nominal_RM3(mode)

Function validate_nominal_RM3()

Parameters:

mode – mode

Returns:

feasible

Returns:

Indices or names of violated constraints

Returns:

simulated

Returns:

actual

Returns:

tab

Returns:

Figure handle

simulation.run.make_all_cases(runOnlyFewSeaStates)
simulation.run.hydro_coeff_err(plot_on)

Function hydro_coeff_err()

Parameters:

plot_on – plot_on

Returns:

mean_abs_err

Returns:

R2

Returns:

Figure handle

simulation.run.is_feasible(g_nonlin, x, p, b, idx_ignore)

Function is_feasible()

Parameters:
  • g_nonlin – g_nonlin

  • x – Design variable vector

  • p – Parameter struct

  • b – Design variable bounds struct

  • idx_ignore – idx_ignore

Returns:

feasible

Returns:

A_ineq

Returns:

Indices or names of violated constraints

Returns:

feasible_lin