Parametric optimisation toolbox help
显示 更早的评论
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 个评论
Ameer Hamza
2020-3-28
Can you show the code to find the optimal solution for a given span value (say 1m)?
Sadu
2020-3-28
John D'Errico
2020-3-28
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
2020-3-28
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
2020-3-28
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
2020-3-28
Ameer Hamza
2020-3-28
Glad to be of help.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Get Started with Optimization Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!