# Minimizing a nonlinear integral (in Matlab, I hope)

• Apr 28th 2009, 06:41 PM
canopy
Minimizing a nonlinear integral (in Matlab, I hope)
Ok, I think this is a pretty tricky one.

I'm trying to develop a script to minimize A in the following function. It looks like I want to use the fmincon() function, but I'm not really sure. I think I just need a push in the right direction...

(int((1-(1-x)^(1/(D1)))-x*(C1),z,0,h)-P1)^2+
(int((1-(1-x)^(1/(D2)))-x*(C2),z,0,h)-P2)^2+...
=A

So there's a different value of x for every z - I need it to be able to feed it a value for z and have it return the value of x that will minimize A.

There are eight given values for each of C D and P (as in, we have C1 though C8 along with eight different terms that need to be added)

Here are some conditions which are making this extra tricky:
1) x must increase as z increases, that is dx/dz is always positive
2) x must be positive at all points
3) x must be less than 1, and preferably less than 0.5

If anybody can help me with this, you really are the best person in the universe.

Thanks!

Canopy
• Apr 28th 2009, 08:38 PM
CaptainBlack
Quote:

Originally Posted by canopy
Ok, I think this is a pretty tricky one.

I'm trying to develop a script to minimize A in the following function. It looks like I want to use the fmincon() function, but I'm not really sure. I think I just need a push in the right direction...

(int((1-(1-x)^(1/(D1)))-x*(C1),z,0,h)-P1)^2+
(int((1-(1-x)^(1/(D2)))-x*(C2),z,0,h)-P2)^2+...
=A

So there's a different value of x for every z - I need it to be able to feed it a value for z and have it return the value of x that will minimize A.

There are eight given values for each of C D and P (as in, we have C1 though C8 along with eight different terms that need to be added)

Here are some conditions which are making this extra tricky:
1) x must increase as z increases, that is dx/dz is always positive
2) x must be positive at all points
3) x must be less than 1, and preferably less than 0.5

If anybody can help me with this, you really are the best person in the universe.

Thanks!

Canopy

I think you should post the real/original question

CB
• Apr 28th 2009, 09:17 PM
canopy
Thanks though
Ah, sadly there was no original question, so none of it was that straightforward. I'm trying to put together a model for melting of the mantle at mid ocean ridges. I think I just about have a numerical approach finished now though (one of those things where you have to ask the question in words in order to realize the answer)

But thanks for looking over it!