MATLAB Answers

0

How to replace an array of symbolic variable in optimization problem?

Md. Monirul Islam さんによって質問されました 2019 年 1 月 28 日
最新アクティビティ Alan Weiss
さんによって コメントされました 2019 年 1 月 29 日
I have a 3D array of symbolic variable. 1st row of the array is like below:
syms x111 x112 x113 x114 x115 x116 x117 x118 x119 x1110 x1111 x1112 real
NVFMS(1,1,:)=[x111 x112 x113 x114 x115 x116 x117 x118 x119 x1110 x1111 x1112];
These variables are used in all objective function and constraints. How can I update all the variables in a loop of 10 iteration?

  0 件のコメント

サインイン to comment.

2 件の回答

Alan Weiss
回答者: Alan Weiss
2019 年 1 月 29 日

I do not understand what you are asking. But perhaps these examples will allow you to help yourself in using symbolic math with optimization functions:
Alan Weiss
MATLAB mathematical toolbox documentation

  0 件のコメント

サインイン to comment.


回答者: Md. Monirul Islam 2019 年 1 月 29 日

Thanks Alan for your response.
In my problem, there are the following steps:1) defining the symbolic variables, 2) initialize the symbolic variables, 3) updating the symbolic variable with the iteration. I have initialized the symbolic variable values and initialize the values using subs command. However, I couldn't update the values automatically inside the loop.

  1 件のコメント

Alan Weiss
2019 年 1 月 29 日
I'm sorry, but I still do not know what you mean "I couldn't update the values automatically inside the loop." If you give some code then maybe we can understand what you are trying to do.
By the way, are you trying to perform a numerical optimization? If so, then it is usually wise not to use symbolic variables in the optimization, but instead to use functions (perhaps converted from symbolic using matlabFunction) and a numerical optimizer such as fmincon.
Alan Weiss
MATLAB mathematical toolbox documentation

サインイン to comment.



Translated by