Optimising using a combination of linear equality constraints and no constraints

조회 수: 1 (최근 30일)
Hi,
I am currently trying to optimise at 18 variable input. 13 of my variables don't require any constraints on them except for ub and lb. 5 of the variables are summed to 1. I tried using simulannealbnd and normalising these weightings to each other. I have tried using patternsearch but patternsearch only seemed to consider the variables in the linear equality.
Does any one have any advise on what optimiser to use?
% set upper and lower bounds for time (s), PID and Error:
LB=[0.15,...%time delay
0,0,0,0,0,...%noise
0,0,0,0,0,0,0,...%gains
0,0,0,0,0]; %weights to sum to 1
UB=[0.15,...%time delay
1/10000,1/10000,1/1000,1/1000,1/1000,...%noise
10,10,500,1500,500,2,2,...%gains
1,1,1,1,1];%weights to sum to 1
INPUT=(LB+UB)/2; %set initial guess in the middle
Aeq=[zeros(1,13),ones(1,5)];
ObjectiveFunction=@(x) NN_v1_2_Parfor(INPUT,setup);
[x,fval,exitFlag,output] = patternsearch(ObjectiveFunction,INPUT,[],[],Aeq,1,LB,UB);

채택된 답변

Alan Weiss
Alan Weiss 2020년 7월 27일
I don't know whether your objective function is smooth or not. If it is smooth (differentiable), I would suggest that you use fmincon as your solver. If it is not smooth, then use patternsearch with the following option change:
options = optimoptions('patternsearch','PollMethod','GSSPositiveBasis2N');
Be sure to pass options in your solver call.
I also suggest that you remove variable 1 from the problem entirely, so your problem is 17 variables. And I suggest that you rescale your variables so that all are of the same order. Your objective function internally should divide the first five variables by 1000, and the upper bound for the first five variables should be 1. Similarly, the new variables 8, 9, and 10 should internally be multiplied by 500, 1500, and 500 respectively, and the corresponding upper bounds should all be 1.
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 7
Alan Weiss
Alan Weiss 2020년 7월 28일
Your problem needs to be better defined. Are you trying to minimize the mean of something? Then you need to take enough samples to have a good estimate of the mean. This might imply that your simulation should be run many, many times for each parameter, and the whole computation will then be slow.
I suspect that you need to think hard about what exactly you are attempting to do. What is the real objective function? The theoretical, deterministic thing that you are trying to optimize? Is there any way to calculate it, or can you only obtain samples from a distribution?
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
Adam Handley
Adam Handley 2020년 7월 28일
I am trying to minimise the difference between an inverted pendulum model and experimental collected data. The experimental data no one experiment is the same and to accurately have the simulation match the experiment the simulation cannot run exactly the same each time. Therefore I have adopted the approach of optimising based on the t-statistic from a set number of optimisations in order to determine if the simulation can replicate the sample of experimentally measured data. As I only have 10 sets of experimental data I have only been running 10 simulations.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by