资源简介
混合整数非线性规划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图像压缩编码
相关资源
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
- k近邻算法matlab实现
评论
共有 条评论