How to use Simulated Annealing Algorithm with matrices in the function

2 次查看(过去 30 天)
I want to find the minimum of the function by Simulated Annealing Algorithm where the function invovles the matrices and FFT also
like this f = Em.*exp(angle(fftshift(ifft2(fftshift(sqrt(v1)*Emmf11a+sqrt(v2)*Emmf11b.*exp(-1i*(v3*pi))));
where Em, Emmf11a, Emmf11b are matrices of 1000x1000 and we have variables as v1, v2 and v3. and conditions are v1 + v2 = 1 and 0=< v3 >=2*pi
or is there any other algorithm that can determine the minimum or the maximum of the function ??

回答(1 个)

Alan Weiss
Alan Weiss 2013-5-24
Optimization Toolbox and Global Optimization Toolbox minimize scalar functions. If your objective function f is a scalar, not a vector or matrix, then the toolbox functions can work.
simulannealbnd works only on bounded problems, so you would have to reformulate your problem from three decision variables to two as follows:
v2 = 1 - v1
Minimize over v1 and v3. Use the vector x = (v1,v3), a 2-D vector, with bounds
lb = [-Inf,0];
ub = [Inf,2*pi];
For details of the syntax for bounds, see the documentation.
Alan Weiss
MATLAB mathematical toolbox documentation
  4 个评论
Liaquat Ali
Liaquat Ali 2013-6-4
Actually f is not a scalar rather it is a 1000X1000 matrix and i want to find the values of V1, V2 and V3 for which the f is maximum ??
Alan Weiss
Alan Weiss 2013-6-4
编辑:Alan Weiss 2013-6-4
What does it mean to find the maximum of a matrix? I know what it means to find the maximum of one element in a matrix. However, as soon as you have two or more elements, it can be that changing the V matrix causes one element to increase, another to decrease, and so there is a trade off. Therefore, there is no such thing as the maximum of a function that has two or more elements. There is multiobjective optimization (see my previous link) that explicitly deals with multiple objective functions.
It is possible you want to maximize the sum of squares of the elements of your matrix. In that case, sum the squares as your objective function, and maximize that.
Alan Weiss
MATLAB mathematical toolbox documentation

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Genetic Algorithm 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by