How to optimise a definite integral?
26 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Harvey Rael am 27 Mai 2018
Bearbeitet: DGM am 9 Mai 2021
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.
sloppydisk am 27 Mai 2018
Bearbeitet: sloppydisk am 27 Mai 2018
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.
Torsten am 29 Mai 2018
Bearbeitet: Torsten am 29 Mai 2018
R = @(theta) k0*exp(k1*sin(k(1)*theta + phi));
theta_dot = @(theta) sqrt(mu./R(theta).^3./(k1*k(1)^2*sin(k(1)*theta + phi) + 1));
z = @(theta) 1./theta_dot(theta);
y = integral(z,0,(psi+2*pi*k(2))) - 94608000;
Kunwar Pal Singh am 8 Mai 2021
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
Find more on Solver Outputs and Iterative Display 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!