Navigator

  • uncertain
  • syntax
  • Examples
  • Reference

uncertain

uncertain表示这些变量是不确定的,或者作用于一系列约束,该符号可以表示对变量进行服从随机分布的采样

syntax

F=uncertain(w) % w variable
F=uncertain(W) % W constraint
F=uncertain(w, distribution)

Examples

robust optimization的建模代码如下

sdpvar x w
F = [x+w<=1];
W = [-0.5<=w<=0.5, uncertain(w)];
obj = -x;
optimize([F, W], obj);

或者等价的

sdpvar x w
F = [x+w<=1];
W = [uncertain(-0.5<=w<=0.5)];
obj=-x;
optimize([F, W], obj);

To specify random uncertainties for use in optimizers and sample. you specify the distribution, and all distribution parameters following the syntax in the RANDOM command in Statistic Toolbox

其中sample函数说明为:Draw a sample in an optimizer object and instantiates parameter
Q=sample(P, N) generates concatenated instantiated optimizer objects where samples have been drawn for all parameters with associated samples.
输入:
P:optimizer对象
N:采样的数量
输出:
Q:optimizer对象
关于optimizer对象的定义如下

OPT=optimizer(Constraints, Objective, options, x, u) exports an object that contains precompiled numerical data to be solved for varying arguments x, returning the optimal value of the expression u.ExampleThe following problem creates an LP with varying upper and lowerbounds on the decision variable.A = randn(10,3);b = rand(10,1)*19;c = randn(3,1);z = sdpvar(3,1);sdpvar UB LBConstraints = [A*z <= b, LB <= z <= UB];Objective = c'*z% We want the optimal z as a function of [LB;UB]optZ = optimizer(Constraints,Objective,[],[LB; UB],z);% Compute the optimal z when LB=1, UB = 3;zopt = optZ([1; 3])% Compute two solutions, one for (LB,UB) [1;3] and one for (LB,UB) [2;6]zopt = optZ([[1; 3], [2;6]])% A second output argument can be used to catch infeasibility[zopt,infeasible] = optZ([1; 3])% To avoid the need to vectorize in order to handle multipleparameters, a cell-based definition can be used optZ = optimizer(Constraints,Objective,[],{LB,UB},{z,sum(z)})[zopt,infeasible] = optZ({1,3});zopt{1}zopt{2}

建模代码如下

sdpvar x(2, 1) w(2, 1);
F = [-10<=x+w<=10, uncertain(w, 'normal', 1, 4)]; % constraints
P = optimizer(F, sum(x), [], w, x); % 目标为sum(x), LB, UB为空, 优化变量为w, x
Q = sample(P, 10);
plot(Q); % 绘制采样结果
xopt = Q([]);

也可以使用使用如下语法设置

F=[x+w<=1, uncertain(w, @mysampler, arg1, ...)];
F=[x+w<=1, uncertain(w, @random, 0, 1)];

Reference

YALMIP uncertain

【OR】YALMIP uncertain相关推荐

  1. 【OR】YALMIP 二阶锥规划

    导航 second order cone programming robust optimization References second order cone programming 对回归问题 ...

  2. 【OR】YALMIP 指数锥规划

    导航 Exponential cone programming Logistic regression example References Exponential cone programming ...

  3. 【OR】YALMIP Sum of squares(SOS)规划

    Navigator sos programming sos optimization References sos programming YALMIP内置了求解sos问题的模块,在sos问题中,需要 ...

  4. 【OR】YALMIP 半正定规划

    导航 Semidefinite Programming Semidefinite Programming 给定线性动态系统 x˙=Ax\dot{x}=Ax x˙=Ax 通过找到对称矩阵PPP证明系统的 ...

  5. 【电力系统】基于matlab YALMIP+CPLEX求解带储能的微电网优化调度问题【含Matlab源码 2175期】

    ⛄一.获取代码方式 获取代码方式1: 完整代码已上传我的资源:[电力系统]基于matlab YALMIP+CPLEX求解带储能的微电网优化调度问题[含Matlab源码 2175期] 点击上面蓝色字体, ...

  6. 对于人工智能的学习有哪些建议?【转】

    转自:https://www.zhihu.com/question/20132531 张石 咳咳,农民伯伯来了,我家那片代码有点荒了呀 人工智能编程--咳咳,我也是搬运工.... AI Program ...

  7. 【英语学习】【WOTD】grift 释义/词源/示例

    grift v. [GRIFT] 诈骗 Definition 1: to obtain (money) illicitly (as in a confidence game) 1:非法获利(例如从获信 ...

  8. 医学报告生成论文总结【4-24】

    医学报告生成论文总结 4-24 前言 一.Cross-modal Memory Networks for Radiology Report Generation 二.Radiology Report ...

  9. 【分享】“飞书自建“在集简云平台集成应用的常见问题与解决方案

    一.通讯录动作常见问题 1.通讯录动作出现错误了怎么办? 如果遇到"通讯录动作"出现问题,请点击以下链接,参考[通讯录常见问题]相关文档 [通讯录常见问题]文档:开发文档 - 飞书 ...

最新文章

  1. python nltk 入门demo
  2. 【解决方案】“‘javac’不是内部或外部命令,也不是可运行的程序或批处理文件”
  3. mysql列偏移_MySQL:如何对待分布偏移的数据
  4. 记一种数据库水平扩展的技巧
  5. URL中允许携带sessionid带来的安全隐患。
  6. 想靠大数据创业 你需要了解什么
  7. 解决larave-dompdf中文字体显示问题
  8. 大学计算机学生成绩综合管理系统,大学综合测评成绩管理系统的研究 计算机专业毕业论文.doc...
  9. shell数值运算的方法
  10. 前端面试面向对象_面向初级前端开发人员的面试问题
  11. 6.18-GTest
  12. 43.一维卷积-航空公司评论情感预测
  13. shell的logo含义_华为logo的寓意是什么
  14. 读书分享《The art of CRM》--CRM的艺术
  15. 互联网产品经理的主要职责(产品经理工作职责)
  16. Win7 安装PECL
  17. FCN(Fully Convolutional Network)与Unet:谈到语义分割不得不提的两个网络
  18. 明日方舟公式计算机,【科普向】明日方舟里的伤害计算公式
  19. 关于FIN_WAIT1
  20. 玩转pjsip之一 简介

热门文章

  1. 计算机非线编辑配置,非线性编辑系统的组成及原理
  2. 广州市地铁总公司网络工程方案
  3. 仿淘宝商品放大展示效果制作(放大镜效果)
  4. WinRTC中的简单音频混频器代码
  5. 揭秘信用卡账单、支付宝背后的黑色产业链
  6. 惠普服务器启动时主板显示40,HP 600G1 DM小主机低温不能启动,开机无显电源键红灯伴4长声报警...
  7. CoOS使用教程——任务的状态
  8. xposed android4.4,应用管理Xposed
  9. 创建电子文件封装(EEP)包的功能代码
  10. BlockChainIOT:区块链技术与互联网的结合以及场景应用