How to optimise 2 variable with different dimension?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I have two motion data set. The first data set is x, the system state which contains all the joint angles of a 2D arm in different time frame and the last data set is u, 1d control input in different time frame. I have to do a motion optimisation where i have to find the optimised x and u by minimising a objective function. I have tried using matlab function like fminunc, fminsearch and lsqnonlin. However i have no idea how to set two different variables data set with different dimension as an initial guess for the optimisation function.
0 Commenti
Risposta accettata
Walter Roberson
il 27 Nov 2012
The initial guess should be a single vector which is the vector concatenation of all of the entries to be varied. The optimization function you pass should break the vector into appropriate pieces.
For example, if x0 is (say) 5 x 2, and u0 is (say) 7 x 1, then
initial_guess = [x0(:); u0(:)];
and the minimization function would accept a single parameter,
function output = myminfunc(P)
thisx = reshape(P(1:10), 5, 2);
thisu = P(11:17);
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Robust Control Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!