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

# Thread Subject: Optimizing Integral Equations

Subject: Optimizing Integral Equations

From: Dian

### Dian

Date: 5 Nov, 2012 21:00:08

Message: 1 of 3

How do I set-up an integral function where the limits are not constants so that I can optimize x.

min ( \int_{a(x)}^{b(x)} f(u) du - constant)^2
x

It seems to me that quad only accepts constant limits.

thanks for any help
Dian

Subject: Optimizing Integral Equations

From: Roger Stafford

### Roger Stafford

Date: 5 Nov, 2012 21:51:08

Message: 2 of 3

"Dian" wrote in message <k799co$507$1@newscl01ah.mathworks.com>...
> How do I set-up an integral function where the limits are not constants so that I can optimize x.
> min ( \int_{a(x)}^{b(x)} f(u) du - constant)^2
> x
- - - - - - - -
As I see it, your minimum will occur in one of two ways. Either it will be a zero at one or more places where your integral crosses over the "constant" value, or if this never happens, the minimum will occur at a point where f(b(x))*db(x)/dx = f(a(x))*da(x)/dx.

In the latter case the equality of these derivatives ought to be much easier to compute than continually evaluating the integral.

I am assuming here you have placed no bounds on the variable x. If you have, such bounds would also be candidates for a minimum.

Roger Stafford

Subject: Optimizing Integral Equations

From: Roger Stafford

### Roger Stafford

Date: 5 Nov, 2012 22:30:09

Message: 3 of 3

"Dian" wrote in message <k799co$507$1@newscl01ah.mathworks.com>...
> How do I set-up an integral function where the limits are not constants so that I can optimize x.
- - - - - - - - -
An added note about terminology. It is generally understood in mathematics that an "integral equation" involves an unknown function similarly to a differential equation, rather than an unknown value of a variable.

Roger Stafford