How to solve multivariable nonlinear optimization problem (fmincon or another optimization)

19 views (last 30 days)
Hello everybody,
If someone can help my problem, I will very much appreciate him/her. I want to minimize an objective function which is condition number of a matrix W having many rows and each row having time-dependent variables.
It is a problem in robotics. I have an observation matrix. In this matrix, in one row there are different variables such as positions q1,q2,q3,... velocities dq1,dq2,dq3,... accelerations ddq1,ddq2,ddq3,... and also in each row same variable is changing according to time. For example, in second row q1(2),q2(2),q3(2), and velocities dq1(2),dq2(2),dq3(2),... so on...
I have 18 parameters in 1 row, and these 18 parameters are changing as time-dependent. If 10 seconds, the observation matrix W will have 18*10=180 parameters.
My target is to find optimum parameters to provide min(cond(W)) minimum condition number
Also, I will have a constraint equation such as min-max joint positions.
I could not set fmincon. Because it depends on only one variable x, but I have 18 variable and they change with time.
How can I optimize that kind of problem?
Thank you very much in advance

Answers (1)

Thiago Henrique Gomes Lobato
fmincon accepts a vector of variables, which means that as long as you pack all your variables in a vector x it doesn't matter if there are 1, 18 or 180 variables. So you can either pass 18 variables and then change them internally with time or all 180 and let the optimizer find the best solution. Try doing something like this to get all the variables that you want:
function y = opt(x)
var1 = x(1);
var2 = x(2);
....
end
  1 Comment
Muzaffer Citir
Muzaffer Citir on 29 Dec 2019
Thank you for answer. I tried to do that but my model is very complicated and they are produced by very long process. I mean I could not write the function as manually. And so, I tried to subs() command to change my variable with q1, q2 ,q3... X(1), x(2), x(3)... However, after I did that they are not behavior such a symbolic variables.. I changed like that: Sysm x(t) for t=1:20 newFunc = subs(oldfunc, [q1,q2...], [x(t+1), x(t+2)...]) end
I just write an example. When I did that I could change all variable with new one until x(180). However, they are not behaving such a symbolic variable. Am I correct way?

Sign in to comment.

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!