Quick substitution of all multi-objective optimization results (gamultiobj) into optimization expressions
I’m using problem-based optimization formulation for the first time (it’s great!) and I’ve been struggling a bit with how to interact seamlessly with the results. My optimization is multi-objective and the setup has the following characteristics:
Using problem-based optimization formulation, I’m defining many variables using optimvar (e.g., rho, D, W)
From there I’m defining objective and constraint functions as OptimizationExpression objects, e.g. V=pi*(D/2)^2*W, M=rho*V (simplified but still relevant to my actual problem)
In my case, minimizing volume V is one of the objectives, but M is a part of another objective as well as some constraints, so I would like to quickly evaluate the OptimizationExpression M over the optimization results (Pareto front) returned within sol and use it in some post-processing plots.
After much experimentation, I did find that I can substitute a particular result by index into an existing OptimizationExpression object using the following syntax:
ii=10; % Index of solution I’m interested in
solStruct=struct(sol(ii));
Mval=evaluate(M,solStruct.Values);
Obviously I can build a loop over ii to get an array Mval, but is there a way to do it more elegantly? (And am I using the intended method to evaluate a single solution from the optimization?)I’m using problem-based optimization formulation for the first time (it’s great!) and I’ve been struggling a bit with how to interact seamlessly with the results. My optimization is multi-objective and the setup has the following characteristics:
Using problem-based optimization formulation, I’m defining many variables using optimvar (e.g., rho, D, W)
From there I’m defining objective and constraint functions as OptimizationExpression objects, e.g. V=pi*(D/2)^2*W, M=rho*V (simplified but still relevant to my actual problem)
In my case, minimizing volume V is one of the objectives, but M is a part of another objective as well as some constraints, so I would like to quickly evaluate the OptimizationExpression M over the optimization results (Pareto front) returned within sol and use it in some post-processing plots.
After much experimentation, I did find that I can substitute a particular result by index into an existing OptimizationExpression object using the following syntax:
ii=10; % Index of solution I’m interested in
solStruct=struct(sol(ii));
Mval=evaluate(M,solStruct.Values);
Obviously I can build a loop over ii to get an array Mval, but is there a way to do it more elegantly? (And am I using the intended method to evaluate a single solution from the optimization?) I’m using problem-based optimization formulation for the first time (it’s great!) and I’ve been struggling a bit with how to interact seamlessly with the results. My optimization is multi-objective and the setup has the following characteristics:
Using problem-based optimization formulation, I’m defining many variables using optimvar (e.g., rho, D, W)
From there I’m defining objective and constraint functions as OptimizationExpression objects, e.g. V=pi*(D/2)^2*W, M=rho*V (simplified but still relevant to my actual problem)
In my case, minimizing volume V is one of the objectives, but M is a part of another objective as well as some constraints, so I would like to quickly evaluate the OptimizationExpression M over the optimization results (Pareto front) returned within sol and use it in some post-processing plots.
After much experimentation, I did find that I can substitute a particular result by index into an existing OptimizationExpression object using the following syntax:
ii=10; % Index of solution I’m interested in
solStruct=struct(sol(ii));
Mval=evaluate(M,solStruct.Values);
Obviously I can build a loop over ii to get an array Mval, but is there a way to do it more elegantly? (And am I using the intended method to evaluate a single solution from the optimization?) optimization, multi-objective optimization, gamultiobj, problem-based optimization MATLAB Answers — New Questions









