Some might remember me from some earlier questions. I have programmed an aircraft generator and analyzer. I'm trying to find an optimized aircraft, but after several months still no luck. Yesterday I started an optimization, which ran for about 12 hours and did 27 iteration successfully. I finally thought it was going to work, yet, halfway through the 28th iteration it failed again.
This time my objective function failed, so normally this is a fault in my own program. It returned an error that one of the variables had an imaginary part, which shouldn't be possible. After loading the currentxvector, which I save to debug problems like this, I quickly discovered that all of the values of the input vector (xvector as it is called in my program) are complex. How is this possible? I thought fmincon is not able to work with complex numbers. Did it make and error, or did I?
Needless to say that my start xvector has only real numbers and all of the preceding 27 iterations had only real numbers as well. I have no clue where this comes from and how to handle this problem. My xvector has a length of 31. I use an active-line algorithm now, that seemed to work fine until this came along.
I hope someone can help me out. I apologize for the number of questions asked. It is really a complex problem, which I hope to solve soon.
My xvector is saved as soon as the objective function is started, so I don't alter anything. If I'm right this is just the xvector created by fmincon. The way my xvector is saved:
function f = obj(aircraftstart,x)
eval(sprintf('%s%s%s','save(''optdata\',problem.TAG,...
'\currentxvector.mat'',''x'')'))
<Calculations>
return