⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 presolve_bounds_from_domains.m

📁 matlab波形优化算法经常要用到的matlab toolbox工具箱:yalmip
💻 M
字号:
function model = presolve_bounds_from_domains(model);

% Sigmonial with non-integer powers must be positive
sigmonials = find((model.variabletype == 4));
for i = 1:length(sigmonials)
    j = sigmonials(i);
    involved = find(model.monomtable(j,:));
    fractional = involved(model.monomtable(j,involved)~=fix(model.monomtable(j,involved)));
    for k = 1:length(fractional)
        model.lb(fractional(k)) = max([1e-9  model.lb(fractional(k))]);
    end
end

% The evaluation based operators can communicate the domain (although
% this really should be available via domain constraints anyway)
% The operator model can however also include range constraints, which we
% just as well might extract and add to the model
for i = 1:length(model.evalVariables)
    j = model.evalVariables(i);
    model.lb(j) = max([model.lb(j) model.evalMap{i}.properties.range(1)]);
    model.ub(j) = min([model.ub(j) model.evalMap{i}.properties.range(2)]);
    j = model.evalMap{i}.variableIndex;
    model.lb(j) = max([model.lb(j) repmat(model.evalMap{i}.properties.domain(1),length(j),1)],[],2);
    model.ub(j) = min([model.ub(j) repmat(model.evalMap{i}.properties.domain(2),length(j),1)],[],2);
end


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -