资源简介
混合整数非线性规划matlab代码,需要者请下吧~
代码片段和文件信息
% NONLINEAR MIXED INTEGER PROGRAM SOLVER
% This program solves mixed integer problems with a branch and bound
% method.
%
% Further work:
% Add heuristics to create a good initial integer solution
% Add cuts to the problem (branch and cut method)
%
% Some testing with the problem shows that it works well with up to
% around 30 integer variables and 10000 nlp variables.
%
% Version 1 - MILP by Thomas Tr鰐scher 2009
% Version 2 - MINLP by John Hedengren 2012
% Results:
% x_best - best integer solution found
% f_best - best objective found
clear all
close all
tic;
addpath(‘apm‘)
% select server
%server = ‘http://apmonitor.com‘;
%server = ‘http://byu.apmonitor.com‘;
server = ‘http://xps.apmonitor.com‘;
% application name
app = ‘minlp‘;
% clear previous application
apm(serverapp‘clear all‘);
% load model (can edit with text editor)
edit minlp.apm
apm_load(serverapp‘minlp.apm‘);
%
% Local Options
%
o.display = ‘iter‘;
% Algorithm display [iterimprovefinaloff]
%
o.iterplot = true;
% Plot upper and lower bounds on objective function value while iterating
% [truefalse]
%
o.solver = 1;
% NLP solver (1=apopt2=bpopt3=ipoptetc)
%
o.Delta = 1e-8;
% Stopping tolerance of the gap (f_integer-f_lp)/(f_integer+f_lp)
%
o.maxNodes = 1e5;
% Maximum number of nodes in the branch and bound tree to visit
%
o.branchMethod = 3;
% 1 - depth first 2 - breadth first 3 - lowest cost 4 - highest cost
%
o.branchCriteria = 1;
% 1 - most fractional 2 - least fractional 3 - highest cost 4 - lowest cost
%
o.intTol = 1e-6;
% Integer tolerance
apm_option(serverapp‘nlc.solver‘o.solver);
apm_option(serverapp‘nlc.imode‘3);
%Small test problem optimal solution should be -21
lb = [0 0 0 0]‘;
ub = [1 1 1 1]‘;
yidx = true(41);
nx = size(lb1);
for j = 1:nx
xi = [‘x[‘ int2str(j) ‘]‘];
apm_info(serverapp‘SV‘xi);
end
%Assume no initial best integer solution
%Add your own heuristic here to find a good incumbent solution store it in
%f_besty_bestx_best
f_best = inf;
y_best = [];
x_best = [];
%Variable for holding the objective function variables of the lp-relaxation
%problems
f = inf(o.maxNodes1);
f(1) = 0;
fs = inf;
numIntSol = double(~isempty(y_best));
%Set of problems
S = nan(sum(yidx)1);
D = zeros(sum(yidx)1);
%The priority in which the problems shall be solved
priority = [1];
%The indices of the problems that have been visited
visited = nan(o.maxNodes1);
%Plot each iteration?
i=0;
if o.iterplot
figure;
hold on;
title(‘Bounds‘)
xlabel(‘Iteration‘)
ylabel(‘Obj. fun. val‘)
end
%% Branch and bound loop
while i==0 || isinf(f_best) || (~isempty(priority) && ((f_best-min(fs(priority)))/abs(f_best+min(fs(priority))) > o.Delta) && i %Is the parent node less expensive than the current best
if i==0 || fs(priority(1)) %Solve the LP-relaxation problem
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 408 2012-03-17 03:42 apm\apm.m
文件 494 2012-03-17 03:42 apm\apm_info.m
文件 760 2012-03-17 03:42 apm\apm_load.m
文件 336 2012-03-17 03:42 apm\apm_meas.m
文件 176 2012-03-17 03:42 apm\apm_option.m
文件 923 2012-03-17 03:42 apm\apm_sol.m
文件 391 2012-03-17 03:42 apm\apm_t0.m
文件 294 2012-03-17 03:42 apm\apm_tag.m
文件 544 2012-03-17 03:42 apm\apm_var.m
文件 545 2012-03-17 03:42 apm\apm_web.m
文件 477 2012-03-17 03:42 apm\csv_data.m
文件 357 2012-03-17 03:42 apm\csv_element.m
文件 766 2012-03-17 03:42 apm\csv_load.m
文件 352 2012-03-17 03:42 apm\csv_lookup.m
文件 287 2012-03-17 03:42 apm\parse.m
文件 1036 2012-03-19 12:55 minlp.apm
文件 10028 2012-03-19 14:16 minlp.m
文件 1542 2014-02-12 13:54 license.txt
- 上一篇:基于VHDL语言的在FPGA上产生单相SPWM波形
- 下一篇:JPEG图像压缩编码
相关资源
- 基于LMS算法的均衡器MATLAB实现代码
- 蚁群、粒子群、GA、TS等算法解决Job
- matlab关于商场人数的泊松随机过程仿
- 脉冲编码调制PCM调制与解调
- 64QAM调制解调
- matlab遗传算法程序以求解函数的极值
- 毕业论文 基于matlab的PSK通信系统仿真
- matlab 代码实现 信号 数字 变频
- KUKA六关节机器人matlab仿真
- hurst指数的MATLAB实现
- PSO-RBF的MATLAB程序实现
- 商人过河MATLAB.rar
- MatlabR2017aWin64Crack.rar
- Student_5_BDS_Positioning.m
- IEEE-6 14 30节点系统 MATLAB 潮流计算
- 飞行器六自由度建模 线性化 matlab程序
-
三相电压不平衡度计算 simuli
nk模型 - PMSM矢量控制
- 毕业设计matpower潮流计算
- xPC target
- MATLAB与DSP进行UDP通信的简单程序
- 内点法最优潮流MATLAB算法
- Logistic曲线的三种参数估计方法及ma
- TDOA等无线定位算法大全
- 内点法测试程序—matlab
- 智能优化算法及其MATLAB
- 4QAM调制的OFDM程序matlab的
- 基于matlab的数字电子琴的完全指导手
- l1-Magic工具箱
- hough变换matlab程序
评论
共有 条评论