How to optimise a definite integral?
조회 수: 10 (최근 30일)
이전 댓글 표시
In the attached image, I want to optimize the function Dt, as I know the end result of the integral. I have expressions for k1 and k0 in terms of k2 and N, and it is k2 and N that I would like to optimize. They have constraints, needing to be between certain values. I have it all setup in my code, but I am just unaware of how to tell the genetic alogrithm to optimize an integral function? Is there something I'm missing here?
EDIT: Usually, the integration is completed numerically on MATLAB, I don't actually know what the analytical result is.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/190858/image.png)
댓글 수: 0
답변 (3개)
sloppydisk
2018년 5월 27일
편집: sloppydisk
2018년 5월 27일
You don't need to have the analytical result, simply pass the integral as the objective function with a function handle and k2 and N as the design variables. The genetic algorithm will use the outputs of the objective function to determine its minimum. If you need help with passing the function handle please post your code.
Kunwar Pal Singh
2021년 5월 8일
How to code this equation....could anyone help me ..
im getting errors in contraints
%LOGICAL Convert symbolic expression to logical array
% Y = LOGICAL(X) converts each element of the symbolic
% array X into the value true or false.
% Symbolic equations are converted to true
% only if the left and right sides are identically
% the same. Otherwise the equation is converted to
% false. Inequalities which cannot be proved will
% throw an error.
the equation is ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/611470/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/611470/image.jpeg)
댓글 수: 4
DGM
2021년 5월 9일
편집: DGM
2021년 5월 9일
Did you even read what sloppydisk posted?
This is not an answer to the original question. If you have a question, make a new post for it instead of putting it in some random place.
EDIT: Oh I see this isn't the first time. Walter has already given you an answer on this. If you have a question, ask a complete, descriptive question without concealing the sum of your efforts to date, and without dumping off-topic things where they don't belong. Doing this only makes it less likely that anyone will see your question, let alone understand it or answer it. Hiding questions and omitting information is contrary to the basic purpose of communication.
참고 항목
카테고리
Help Center 및 File Exchange에서 Genetic Algorithm에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!