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:
Need some help optimizing a function having an integral

Subject: Need some help optimizing a function having an integral

From: John

Date: 12 Feb, 2010 22:31:04

Message: 1 of 3

I am trying to optimize a function of the following form:

L = Int(t=0,t=T)[AR-x)dt]

i.e. I am trying to find the optimum x(t) that minimizes L over all admissible x(t)s. R is related to x using a relation:

dR/dt = axR - bR, where a and b are system parameters.

I was trying to use fminbnd and fminsearch but I keep getting some errors regarding functions. Can someone please help me with this?

Subject: Need some help optimizing a function having an integral

From: Yi Cao

Date: 12 Feb, 2010 23:31:06

Message: 2 of 3

John,

This is a dynamic optimization problem, some time also called optimal control problem. If you do not know much about optimal control theory, you can use a direct optimization approach.

Firstly, you can choose a sampling time, h to discrete the problem, so that T = hN. Then the problem can be approaximated as

L = sum_{k=0}^N (AR(k) - x(k))h (1)
R(k+1) = R(k) + (ax(k)-b)R(k)h, k=0,...,N-1 (2)
 
You can set both R(k) and x(k), k=0, ..., N are variables to be optimized. Equation (1) is the cost function, whilst (2) as the equality constraints. This problem should be solvable using fmincon.

HTH
Yi Cao

John <johnadams986@gmail.com> wrote in message <482873190.182844.1266013894815.JavaMail.root@gallium.mathforum.org>...
> I am trying to optimize a function of the following form:
>
> L = Int(t=0,t=T)[AR-x)dt]
>
> i.e. I am trying to find the optimum x(t) that minimizes L over all admissible x(t)s. R is related to x using a relation:
>
> dR/dt = axR - bR, where a and b are system parameters.
>
> I was trying to use fminbnd and fminsearch but I keep getting some errors regarding functions. Can someone please help me with this?

Subject: Need some help optimizing a function having an integral

From: John

Date: 13 Feb, 2010 03:45:11

Message: 3 of 3

Hi Yi Cao,

Thanks a lot for your time. I am pretty new to this domain so no wonder I couldn't recognize the problem to begin with.

From what you said, I referred to fmincon here:
http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/fmincon.html

I could understand the approximation you used, however, can you kindly explain your last sentence: "You can set both R(k) and x(k))". On the mathworks page, it gives a series of steps asking me to construct my function and then the bounds in the form of a matrix, but I seem to be missing out on how to do this because the example given there consists of some inequality constraints.

Thanks
John

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