Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
wrong solution with quadprog

Subject: wrong solution with quadprog

From: Robert

Date: 28 Aug, 2007 19:45:28

Message: 1 of 4

dear matlab users,

I am solving a QP problem with a system matrix of around 240
times 360. Thus, I have 360 variables in the model and
around 240 constraints (all linear inequality constraints).
I use quadprog to solve the system.
the solution I get is just wrong meaning the constraints are
violated by large margins. sometimes over 50% outside the
bounds set by the constraints. meanwhile QUADPROG gives the
output: 1 QUADPROG converged with a solution X.

how is it possible to get such wrong results while still
getting an output structure saying everthing is fine ???

what is the maximal nr. of variables then QUADPROG can handle?

thanks, robert

Subject: wrong solution with quadprog

From: Derya Ozyurt

Date: 29 Aug, 2007 11:37:35

Message: 2 of 4

Dear Robert;
Could you send the description of your QP problem (to me)? I don't think the
size of the problem is an issue in this case.

Best Regards

Derya Ozyurt

Optimization Toolbox
The MathWorks, Inc.

"Robert " <schuetz@imsb.biol.ethz.ch> wrote in message
news:fb1u0o$3i0$1@fred.mathworks.com...
> dear matlab users,
>
> I am solving a QP problem with a system matrix of around 240
> times 360. Thus, I have 360 variables in the model and
> around 240 constraints (all linear inequality constraints).
> I use quadprog to solve the system.
> the solution I get is just wrong meaning the constraints are
> violated by large margins. sometimes over 50% outside the
> bounds set by the constraints. meanwhile QUADPROG gives the
> output: 1 QUADPROG converged with a solution X.
>
> how is it possible to get such wrong results while still
> getting an output structure saying everthing is fine ???
>
> what is the maximal nr. of variables then QUADPROG can handle?
>
> thanks, robert
>

Subject: wrong solution with quadprog

From: "Marcus M. Edvall

Date: 1 Sep, 2007 16:12:01

Message: 3 of 4

Do a check with SNOPT/CPLEX/QPOPT and you should see what the trouble
might be. CPLEX has a conflict refiner that may help you find issues
with the model.

Best wishes, Marcus
Tomlab Optimization Inc.
http://tomopt.com

Subject: wrong solution with quadprog

From: kamuran turksoy

Date: 21 Jul, 2011 23:13:08

Message: 4 of 4

"Derya Ozyurt" <dozyurt@mathworks.com> wrote in message <fb3lq3$2l1$1@fred.mathworks.com>...
> Dear Robert;
> Could you send the description of your QP problem (to me)? I don't think the
> size of the problem is an issue in this case.
>
> Best Regards
>
> Derya Ozyurt
>
> Optimization Toolbox
> The MathWorks, Inc.
>
> "Robert " <schuetz@imsb.biol.ethz.ch> wrote in message
> news:fb1u0o$3i0$1@fred.mathworks.com...
> > dear matlab users,
> >
> > I am solving a QP problem with a system matrix of around 240
> > times 360. Thus, I have 360 variables in the model and
> > around 240 constraints (all linear inequality constraints).
> > I use quadprog to solve the system.
> > the solution I get is just wrong meaning the constraints are
> > violated by large margins. sometimes over 50% outside the
> > bounds set by the constraints. meanwhile QUADPROG gives the
> > output: 1 QUADPROG converged with a solution X.
> >
> > how is it possible to get such wrong results while still
> > getting an output structure saying everthing is fine ???
> >
> > what is the maximal nr. of variables then QUADPROG can handle?
> >
> > thanks, robert
> >
>
>

Dear Derya

I have the same problem, here is my case

I have a function :

1/2*x'*H'x+b'*x+k

i want to find the x value which makes this function minimum with respect to A*x<c
In my inequality constraints i have rate and amplitude constraint for x
dxmin<dx<dxmax and xmin<x<xmax

For this problem i used matlab ''quadprog'' function but sometimes it gives wrong outputs,
for example in same case instead of giving xmin it gives higher values even sometimes xmax.

I also used fmincon to overcome this problem, but i could not.

Is there any other way to do it? Or any mistakes that i did?

Tags for this Thread

No tags are associated with this thread.

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.

Contact us