Skip to content

Commit

Permalink
warn if objectives imaginary or non-finite
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccamccabe committed Dec 18, 2024
1 parent 6ec3253 commit 51078b4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mdocean/simulation/simulation.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@
g(23) = X_constraints(4); % float amplitude obeys linear theory
g(24:end) = X_constraints(5:end); % prevent rising out of water/slamming

criteria = all(~isinf(g)) && all(~isnan(g)) && all(isreal(g));
%assert( criteria )
criteria = all(~isinf([g LCOE P_var])) && all(~isnan([g LCOE P_var])) && all(isreal([g LCOE P_var]));
if ~criteria
warning('Inf, NaN, or imaginary constraint detected')
end
Expand Down

0 comments on commit 51078b4

Please sign in to comment.