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

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?

Answers (2)

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
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 Comment

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

Sign in to comment.

Categories

Asked:

on 28 Jan 2019

Commented:

on 29 Jan 2019

Community Treasure Hunt

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

Start Hunting!