How to produce an Excel file when running an optimization with fmincon?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have the following matrix:
M=[15 10 5 6 22 15 27 100; 11 29 9 4 68 14 15 150; 10 8 35 29 22 49 47 200; 6 7 38 43 15 102 39 250; 8 13 16 20 15 21 0 93; 3 3 6 10 4 7 0 33; 47 80 91 138 0 0 0 356; 100 150 20 250 146 208 128 0]
This matrix can be divided in the following matrixes:
A=[15 10 5 6; 11 29 9 4; 10 8 35 29; 6 7 38 43]
Y=[22 15; 68 14; 22 49; 15 102]
FE=[27; 15; 47; 39]
FI=[8,13,16,20,15,21]
VA=[47,80,91,138,0,0]
X=[100;150;200;250;93;33;356]
T=[100,150,200,250,146,208,128]
I want to optimize the difference between this matrix and a new matrix which is constrained. The author has formed the new matrix by filling in the original matrix in one large column and after that he or she took the difference. The objective function is defined as follows:
y = sum(x(1:44,1) .* (log(x(1:44,1)./xo(1:44,1)) - 1) + xo(1:44,1))
so 44 unknown variables should be found and xo, which is the matrix M written in a column, is given. In the paper the difference between Z and Z1, Y and Y1, FE and FE1 and VA and FE1 are taken. Everything with a 1 behind it is unknown.
The constraints are:
1) sum(Z1,2)+sum(Y1,2)+FE1=X1 % Z1,Y1FE1 and X1 are all unknown and part of the new table
2) Y1 > 0.68*Y
3) VA1 < 1.56*VA
4) sum(X1)=0 or sum(Z1+Y1)=0 (These are two scenario's of which one is the case)
I want to minimize the difference between the new and old (M-matrix) using fmincon. I saw an example where they put the matrix in a long column in Excel and then optimized by defining the A, Aeq and b and beq in Excel. However, how should my A look like in Excel if the matrix is put in one large column?
0 comentarios
Respuestas (1)
Walter Roberson
el 1 de Jun. de 2016
Questions about how to represent constraints in Excel for the purpose of running Excel functions, are not questions about MATLAB, and should be asked in some Excel resource.
2 comentarios
Ver también
Categorías
Más información sobre Surrogate Optimization en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!