登录

  • 登录
  • 忘记密码?点击找回

注册

  • 获取手机验证码 60
  • 注册

找回密码

  • 获取手机验证码60
  • 找回
毕业论文网 > 外文翻译 > 理工学类 > 电气工程及其自动化 > 正文

自动化立体仓库控制系统设计外文翻译资料

 2022-08-21 11:08  

翻译要求:

1.文章约17000字(包含不用翻译的语句),每人约5500字,由顾琳完成绿色部分,余志翔完成紫色部分,袁娇娇完成蓝色部分

2.文章来自网站http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Tutorials.Installation

3.拷贝过程中,少量公式以及图片丢失,待文字部分翻译结束后请至上面网站补充完整

4.YALMIP作为一种非常有效的工具,国内尚无完整的资料,请各位尽最大努力完成

5.逢10号、20号、30号发送一次翻译成果至liwdedy@qq.com

6.我翻译了1.2(附于1.2后),供参考(黑色部分)

1. Introduction

1.1 Installation

YALMIP is entirely based on m-code, and is thus easy to install. Remove any old version of YALMIP, unzip the file YALMIP.zip and add the following directories to your MATLAB path

/yalmip

/yalmip/extras

/yalmip/demos

/yalmip/solvers

/yalmip/modules

/yalmip/modules/parametric

/yalmip/modules/moment

/yalmip/modules/global

/yalmip/modules/sos

/yalmip/operators

A lazy way to do this is addpath (genpath(yalmiprootdirectory)).

If you have MPT installed, make sure that you delete the YALMIP distribution residing inside MPT and remove the old path definitions.

If you have used YALMIP before, type clear classes or restart MATLAB before using the new version.

The solvers should be installed as described in the solver manuals. Make sure to add required paths.

To test your installation, run the command yalmiptest. For further examples and tests, run code from this Wiki!

If you have problems, please read the FAQ.

YALMIP is primarily developed on a Windows machine using MATLAB 7.12 (2011a). The code should work on any platform, but is developed and thus most extensively tested on Windows. Most parts of YALMIP should in principle work with MATLAB 6.5, but has not been tested (to any larger extent) on these versions. MATLAB 5.2 or earlier versions are definitely not supported.

1.2 Basics

The following piece of code introduces essentially everything you ever need to learn. It defines variables, constraints, objectives, options, checks result and extracts solution (Note that the code specifies the solver to CPLEX. If you dont have CPLEX installed, simply remove that solver selection in the definition of options. YALMIP will pick some other solver it finds installed)

% Define variables

x = sdpvar(2,1);

% Define constraints and objective

Constraints = [sum(x) lt;= 1, x(1)==0, x(2) gt;= 0.5];

Objective = x*x norm(x);

% Set some options for YALMIP and solver

options = sdpsettings(verbose,1,solver,cplex,cplex.qpmethod,1);

% Solve the problem

sol = optimize(Constraints,Objective,options);

% Analyze error flags

if sol.problem == 0

% Extract and display value

solution = value(x)

else

display(Hmm, something went wrong!);

sol.info

yalmiperror(sol.problem)

end

Having seen that, let us start from the beginning.

1.2.1 YALMIPs symbolic variable

The most important command in YALMIP is sdpvar. This command is used to the define decision variables. To define a matrix (or scalar) P with n rows and m columns, we write

P = sdpvar(n,m)

A square matrix is symmetric by default!. To obtain a fully parameterized (i.e. not necessarily symmetric) square matrix, a third argument is needed.

P = sdpvar(3,3,full)

The third argument can be used to obtain a number of pre-defined types of variables, such as Toeplitz, Hankel, diagonal, symmetric and skew-symmetric matrices. See the help text on sdpvar for details. Alternatively, the associated MATLAB commands can be applied to a vector.

x = sdpvar(n,1);

D = diag(x) ; % Diagonal matrix

H = hankel(x); % Hankel matrix

T = toeplitz(x); % Hankel matrix

Scalars can be defined in three different ways.

x = sdpvar(1,1); y = sdpvar(1,1);

x = sdpvar(1); y = sdpvar(1);

sdpvar x y

Note that due to a bug in MATLAB, the last command-line syntax fails in some cases (inside functions), if the variable name is the same as some built-in function or variable (i, j, e, beta, gamma).

The sdpvar objects are manipulated in MATLAB as any other variable and most functions are overloaded. Hence, the following commands are valid

P = sdpvar(3,3) diag(sdpvar(3,1));

X = [P P;P eye(length(P))] 2*trace(P);

Y = X sum(sum(P*rand(length(P)))) P(end,end) hankel(X(:,1));

In some situations, coding is simplified with a multi-dimensional variable. This is supported in YALMIP with two different constructs, cell arrays and multi-dimensional sdpvar objects.

The cell array is nothing but an abstraction of the following code

for i = 1:5

X{i} = sdpvar(2,3);

end

By using vector dimensions in sdpvar, the same cell array can be setup as follows

X = sdpvar([2 2 2 2 2],[3 3 3 3 3]);

The cell array can now be used as usual in MATLAB.

The drawback with the approach above is that the variable X not can be used directly, as a standard sdpvar object. As an alternative, a completely general multi-dimensional sdpvar is available. We can create an essentially equivalent object with this call.

X = sdpvar(2,3,5);

The difference is that we can operate directly on this object, using standard MATLAB code.

Y = sum(X,3)

X((:,:,2)

Note that the two first slices are symmetric (if the two first dimensions are the same), according to standard YALMIP syntax. To create a fully paramterized higher-dimensional, use trailing flags as in the standard case.

X = sdpvar(2,2,2,2,full);

For an illustration of multi/dimensional variables, check out the Sudoku example.

1.2.2 Constraints

To define a collection of constraints, we simply define and concatenate them. The meaning of a constraint is context-dependent. If the left-hand side and right-hand side are Hermitian, th

剩余内容已隐藏,支付完成后下载完整资料


  1. 说明

1.1安装

YALMIP是完全基于m代码的工具,因此也很容易安装。移除YALMIP的所有旧版本,解压YALMIP的压缩包文件,然后把下面的目录添加到你的MATLAB路径中。

/yalmip/ 附加部分

/yalmip/ 演示

/yalmip/ 解算

/yalmip/ 模块组

/yalmip/ 模块参数化

/yalmip/ 局部模块

/yalmip/ 全局模块

/yalmip/ 模块拯救

/yalmip/ 运行

比较懒的办法是添加搜索路径(genpath(yalmiprootdirectory))

如果你已经安装好了MPT,确保你已经删除了属于MPT里的YALMIP的部分,并且消除原来定义好的路径。

如果你以前用过YALMIP,在使用新的版本之前,要分清楚不同的类别或者重启MATLAB。

解算器应该像解算手册里描述的那样安装,确保要添加需要的路径。

为了测试安装是否可行,运行指令yalmiptest,想要得到进一步的样例及测试结果,可以从维基百科运行这个代码。

如果你有任何问题,请阅读FAQ。

YALMIP是在一个使用MATLAB 7.12 (2011a)的微软工具上开发起来的。它的代码可以在任何一个平台上运行,但是只能在微软上开发或者得到广泛的测试。YALMIP中的大部分在原则上只能和MATLAB 6.5兼容,但是在这些版本上还没有被测试。而MATLAB 5.2或者更早期的版本当然是不支持的。

  1. 标准问题

2.1线性规划

在这个样例里,我们将给出两个系列的数据,称为蓝色系列和绿色系列。我们的目的是用一个线性的分类器将它们分离开来。

randn(2,25) %蓝色系列

randn(2,25) 2 %绿色系列

显示如下:

plot(greens(1,:),greens(2,:),g*)

hold on

plot(blues(1,:),blues(2,:),b*)

一个线性的分类器意味着我们需要为所有蓝色和绿色的数据点找到一个矢量和一个标量。纵观所有的数据,很明显这是不可能的。然后有人想要这么做,找到一个对数据点的分类产生尽可能少的错误的超平面。这是一个典型的复杂的组合问题,所以我们用一个近似的问题代替它。

作为一个误分类的代替品,我们引进正数[Math Processing Error]和[Math Processing Error],并且把分类改变到[Math Processing Error]和[Math Processing Error],如果这两者的数学处理误差都很小的话,我们就获得了一个很好的分类方法。

我们把它定义为利益的决策变量

a = sdpvar(2,1);

b = sdpvar(1);

我们对每个不同的数据点会采用特定的处理误差,因此我们创造了两种符合长度的向量。这很明显解释了为什么我们将它们定义为行向量

u = sdpvar(1,25);

v = sdpvar(1,25);

这种分类的约束条件很容易被定义为探索MATLABs和YALMIPs增加矢量和标量的能力。

约束条件= [a*greens b gt;= 1-u, a*blues b lt;= -(1-v), u gt;= 0, v gt;= 0]

我们想要数学处理误差变小,从某种意义上来说,意味着需要一个好的分类方法。一个简单的选择就是把所有误差元素的总数减到最小。然而,由于这个形式这个问题是不可能得到解决的。所以我们增加了一个约束条件,在误差处理中,所有元素的绝对值作为smaller 1.

目标= sum(u) sum(v)

约束条件=[Constraints, -1 lt;= a lt;= 1];

最后,我们可以解决问题了

完善(约束条件,目标)

误差处理最理想的价值在于它的使用价值。为了更好地阐述这个结果,我们使用YALMIPs来划分约束集合,目的是更简易地展现分离超平面。

x = sdpvar(2,1);

P1 = [-5lt;=xlt;=5, value(a)*x value(b)gt;=0];

P2 = [-5lt;=xlt;=5, value(a)*x value(b)lt;=0];

clf

plot(P1);hold on

plot(P2);

plot(greens(1,:),greens(2,:),g*)

plot(blues(1,:),blues(2,:),b*)

    1. 一次和二次规划

假设我们从一个复杂的线性回归y_t = a_tx e_t.中获得了数据,目的是估计参数x和给定的测量值y_t and a_t,然后我们将用3种不同的基于一次和二次规划的方法来解决。

创造一些带有严重异常值的噪声数据来协助工作。

x = [1 2 3 4 5 6];

t = (0:0.02:2*pi);

A = [sin(t) sin(2*t) sin(3*t) sin(4*t) sin(5*t) sin(6*t)];

e = (-4 8*rand(length(t),1));

e(100:115) = 30;

y = A*x e;

plot(t,y);

定义下面所需的变量:

xhat = sdpvar(6,1);

通过使用xhat和A中的回归变量,我们可以定义剩余变量

residuals = y-A*xhat;

为了解决1中的回归问题,我们可以定义一个变量,充当|y-A*xhat|中元素的基础(我们将更简便地解决这个问题而不是仅仅使用操作规范)。

bound = sdpvar(length(residuals),1);

若约束变量比剩余误差的绝对值要大,则

约束条件= [-bound lt;= residuals lt;= bound];

让YALMIP根据约束条件的限制把范围降到最小,YALMIP将自动发现这是一个线性程序,从而让任一可利用的LP解决程序到你的路径上工作。

optimize(Constraints,sum(bound));

最理想值总是从超负荷命令中得出的 x_L1 = value(xhat);

第二大规范问题将它视为一个不加任何约束条件的QP问题就很容易得到解决。

optimize([],residuals*residuals);

x_L2 = value(xhat);

若YALMIP自动发现目标是一个凸的二次函数,就可以用已安装的QP计算程序解决这个问题,如果QP计算程序找不到,则问题就转变为一个二阶锥规划问题socp,如果内部socp解决器不存在,则转变为SDP问题。

最终,这个问题将趋于无穷化,这相当于将最大剩余量降到最小,即在剩余的矢量中引入一个标量来限制最大值。

bound = sdpvar(1,1);

Constraints = [-bound lt;= residuals lt;= bound];

然后缩小范围

optimize(Constraints,bound);

x_Linf = value(xhat);

我们提出这个解决方案,并且注意到第一个规范问题得到了很好的解决,成功地捕捉到了潜在的兼容问题,尽管在第二阶段存在很严重的测量误差。反之,其他两个预算在这组数据上完成的很差。

plot(t,[y a*x_L1 a*x_L2 a*x_Linf]);

最后,我们声明,这里的一些操作通过使用YALMIP里的非线性结构执行起来会变得更容易。

optimize([],norm(residuals,1));

optimize([],norm(residuals,inf));

第二规范问题很容易会被阐述为QP规划问题,尽管在YALMIP的一些场合使用第二规范阐述问题会更高效,而这将会导致一个二阶问题的出现。

optimize([],norm(residuals,2));

原因就是一个带有处理误差的二次函数的变量可以由单项式组成,这需要YALMIP象征性地解决,如果你需要YALMIP的QP解决器完全地解决一个二次规划问题,要引入一个辅助变量和一个约束等式,这将会减少二次项(不仅仅是YALMIP,许多QP解决器在这次变革之后运行地也会快起来)。

aux = sdpvar(length(residuals),1);

optimize([aux == residuals],aux*aux);

当然,在这个例子中,这些都是没有意义的,因为只有6个决策变量。

2.3 二阶锥形规划

让我们根据线性二次规划的指导继续回归问题。问题归结为在一个适当的范围将Ax-y的绝对值最小化,我们选择第二规范,因为这次要解决的是在最坏情况下产生的损失最小化的问题。在这种假设下,变量A是不确定的,它的值等于A d,这时的d的范围为||d|| 2 le;1。这个问题可以等同于将||Axminus;y|| 2 ||x|| 2的值最小化。

这个问题使用YALMIP可以很容易得到解决,首先定义变量。

x = [1 2 3 4 5 6];

t = (0:0.02:2*pi);

A = [sin(t) sin(2*t) sin(3*t) sin(4*t) sin(5*t) sin(6*t)];

e = (-4 8*rand(length(A),1));

y = A*x e;

第一种方法,我们可以自己做模型,通过使用低水平的圆锥体来引入二阶锥模型。

xhat = sdpvar

剩余内容已隐藏,支付完成后下载完整资料


资料编号:[498779],资料为PDF文档或Word文档,PDF文档可免费转换为Word

您需要先支付 30元 才能查看全部内容!立即支付

企业微信

Copyright © 2010-2022 毕业论文网 站点地图