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:
short question maximize integral restriction (fmincon?)

Subject: short question maximize integral restriction (fmincon?)

From: leo nidas

Date: 31 Oct, 2012 21:31:08

Message: 1 of 2


Hi there,

I have a general question. If it is too general I will return with more details..

I want to minimize a function with respect to some parameters.
This function is non linear with respect to these parameters.

I need the maximization to be done under one equality restriction. The restriction is an integral (that involves the parameters of interest) which I want to demand to be equal to specific real value. The integral cannot be solved analytically but always exist.

Is there a way of passing such a restriction to a minimizer?

Thank you in advance for any answers!

Subject: short question maximize integral restriction (fmincon?)

From: Roger Stafford

Date: 1 Nov, 2012 04:22:08

Message: 2 of 2

"leo nidas" <bleonidas25@yahoo.gr> wrote in message <k6s5as$kuu$1@newscl01ah.mathworks.com>...
> I want to minimize a function with respect to some parameters.
> This function is non linear with respect to these parameters.
> I need the maximization to be done under one equality restriction. The restriction is an integral (that involves the parameters of interest) which I want to demand to be equal to specific real value. The integral cannot be solved analytically but always exist.
- - - - - - - - - -
  Though I haven't done this, I would think you could enter the integral equality as the 'ceq(x)' equality condition on 'fmincon'. The manual for 'fmincon' states:

"The function nonlcon can be specified as a function handle.

 x = fmincon(@myfun,x0,A,b,Aeq,beq,lb,ub,@mycon)

where mycon is a MATLAB function such as
function [c,ceq] = mycon(x)
 c = ... % Compute nonlinear inequalities at x.
 ceq = ... % Compute nonlinear equalities at x."

Your version of 'mycon' would make an appropriate call on a quadrature function to perform the required integration.

  However I would expect such an equality condition would be rather time-consuming, since every call on the 'ceq(x)' function, of which there should be a great many, would require a complete definite integration using the given parameters and x to be performed, rather than merely evaluating some analytic function.

Roger Stafford

Tags for 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