Thread Subject: fmincon constraints

Subject: fmincon constraints

From: Mehdi

Date: 16 Sep, 2009 20:06:56

Message: 1 of 2

Hello everyone,
I am using fmincon to obtain 3 parameters that all are positive real
numbers. However, Matlab gives me complex values. Is there any way to
define the constraints so Matlab only consider real values while
searching for the minimum?

Thank you,
Mehdi

Subject: fmincon constraints

From: Matt

Date: 16 Sep, 2009 20:21:04

Message: 2 of 2

Mehdi <zeidouni@gmail.com> wrote in message <cc984186-51dc-4636-b87a-0eb55d1eae41@y28g2000prd.googlegroups.com>...
> Hello everyone,
> I am using fmincon to obtain 3 parameters that all are positive real
> numbers. However, Matlab gives me complex values. Is there any way to
> define the constraints so Matlab only consider real values while
> searching for the minimum?


MATLAB already does only consider only real values.

If you're seeing complex numbers, it's probably because your iterations crossed some natural boundary where the evaluation of the function and its gradient mistakenly produced complex numbers. For example, this could occur if you have log(Arg) expressions in your gradient and Arg strayed negative, at which point fmincon would start to update your variables using complex arithmetic.

Make sure you have applied constraints such that Arg>0, in addition to constraints on the variables themselves.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com