Parametric optimisation toolbox help
Show older comments
I am a completely new user of MATLAB so some of the things I may say may sound dumb to the more experienced users out there.
I am looking into the optimal design of structural beams. Therefore, I was thinking of using the optimisation function "fminncon" to find the optimal design variables (e.g the depth and width of the beam) to give a minimal weight solution for a given span with multiple design constraints.
My question is, is there a way to find the optimal solution for different spans without manually changing the span each time.
So i am asking if it is possible to change span in intervals such as 1m to 15m at 0.1m intervals with and optimal solution for each 0.1m interval span. Is this feasible?
In the end i want to plot a span to optimal depth using the outputs. I do apologise if what I have said isn't clear as I am still in the early stages of modelling the problem so wanted to see what optimisation techniques i can use before i dive into the coding of it.
7 Comments
Ameer Hamza
on 28 Mar 2020
Can you show the code to find the optimal solution for a given span value (say 1m)?
Sadu
on 28 Mar 2020
John D'Errico
on 28 Mar 2020
Is it possible with fmincon? No.
Fmincon cannot use discrete variables, exactly what you are asking to do. Other solvers, GA specifically, can solve such a problem. But NOT fmincon.
Ameer Hamza
on 28 Mar 2020
Yes, using for loop, you can find the optimal solution for different values of parameter once you have developed the code for a single value. Consider a very simple example
A = 1:20; % parameter that will change in each iteration
f_sol = zeros(1, 20); % initialize the vectors for the optimal value
for i=1:numel(A)
a = A(i);
f = @(x) (x-a).^2; % the objective function
f_sol(i) = fmincon(f, 0);
end
Ameer Hamza
on 28 Mar 2020
John, I think that the OP is trying to solve the problem with continuous variables. OP wanted to know whether it is possible to solve the optimization problem for different values of parameters automatically.
Sadu
on 28 Mar 2020
Ameer Hamza
on 28 Mar 2020
Glad to be of help.
Accepted Answer
More Answers (0)
Categories
Find more on Get Started with Optimization Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!