GA Optimization - Error Message

1 visualización (últimos 30 días)
Abderrahmane DADA
Abderrahmane DADA el 31 de Ag. de 2019
Comentada: Abderrahmane DADA el 2 de Sept. de 2019
Hello.
I have an optimization problem that is to be solved through 3 iteration "t".
Starting from the 2nd iteration, the constraint function follows some conditions.
My problem is that my code runs only for the 1st iteration while for 2 remaining iterations, I always get the error message as indicated by the attached screenshot "Error Message".
Can you anyone help me dealing with and fixing the error I'm having?
Regards.
===============
NB:
Optimization code => OptimCode.m
Constraint Function => ConstFun.m (it calls the 2 functions, Layer_L_Fcn and Layer_U_Fcn to formulate some constraints)
Objective Function => ObjFun.m

Respuesta aceptada

Walter Roberson
Walter Roberson el 1 de Sept. de 2019
C_Geom = [100 - x(7+(t-1)*m); ...
x(2+(t-1)*m)+x(7+(t-1)*m)*cos(deg2rad(x(8+(t-1)*m))) - 9500; ...
x(3+(t-1)*m)+x(7+(t-1)*m)*sin(deg2rad(x(8+(t-1)*m))) - 4500; ...
];
emits 4 non-linear constraints in that case, where-as the other two branches emit 10. The code is expecting that the same number be emitted each time. You should put another 6 zeros on the bottom of that case.
  1 comentario
Abderrahmane DADA
Abderrahmane DADA el 2 de Sept. de 2019
Editada: Abderrahmane DADA el 2 de Sept. de 2019
Thanks Walter for your answer.
That really works: starting from the 2nd condition, the sizes of my two constraints have to be the same for my code to run.
Thanks a lot again

Iniciar sesión para comentar.

Más respuestas (1)

Matt J
Matt J el 31 de Ag. de 2019
Editada: Matt J el 31 de Ag. de 2019
Execute dbstop if error at the command line
>>dbstop if error
and then re-run the optimization. The code will pause execution where the error has occurred. Go inside your objective function using the Function Call Stack in the DEBUG panel and observe what has caused the error.
  8 comentarios
Matt J
Matt J el 1 de Sept. de 2019
Did you try
>> dbstop if caught error
Abderrahmane DADA
Abderrahmane DADA el 2 de Sept. de 2019
Thanks a lot Matt for your support.
The answer given wy Walter has worked for me.

Iniciar sesión para comentar.

Categorías

Más información sobre Linear Programming and Mixed-Integer Linear Programming en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by