cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

onlinear programming with constraints

wperezsena
1-Visitor

onlinear programming with constraints

i got some  questions,  if someone would answer them, I would appreciate it very much.

well there something called nonlinear programming with constraints and also without them, i've been searching in here how to solve this type of problem but what i found wasn't exactly what i was expecting.

for example: if i want to optimise (minimize or minimize o just find a solution that fits) a variable of  a single function, a system of equations or a system of differential equations.

How can i make it?  there is a sheet attached  with the different types of problem i mentioned.



ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:wperezsena)

Would this help in case of your example 2 ?

BTW, Vrl is NOT a guess value.

EDIT: Text in the picture has a typo. Of course I assumed you want Cc1 to be postive, not Cd1 (which is > 36 anyway).

View solution in original post

22 REPLIES 22
Werner_E
25-Diamond I
(To:wperezsena)

Would this help in case of your example 2 ?

BTW, Vrl is NOT a guess value.

EDIT: Text in the picture has a typo. Of course I assumed you want Cc1 to be postive, not Cd1 (which is > 36 anyway).

yes, it helps alot, thank you. you're right Vr1 it's not a guess value, i put it there by mistake. i have changed some things that were also wrong in the sheet. but i can't find the attach button in this chat to upload the modificated sheet.

Werner_E
25-Diamond I
(To:wperezsena)

To attach files you have to chose "Use advanced editor" at the upper right and you will be given the "attach" option at the lower right.

Werner_E
25-Diamond I
(To:wperezsena)

Here is a solution for your Example 3. Hope I understood correctly what you wanted to achieve.

I still don't understand your example 1. What should x1, x2,x3 denote? What exactly are you looking for?

WE

Hi Wander.

Lineal means linear relations between variables. Also implies that you have all the lineal algebra tools for solve it.

Nonlineal means complications. There are some few theory about nonlinear systems, but in the practice what can be done is linearize the system near points of interest. This is taking tangent planes which linearize the system. Newton-Raphson method do that: substitute the curve or the surface by the lineal equivalent :a rect for one variable, planes for two.

Programming mean nothing. It's just the cooknie from economists and similar professionals for call the function or system of functions for minimize.

Optimization means find minimal's (or max's: if min(f) = ym, then max(-f) = -ym, so, it is the same problem). Minimals appear in critical points, which are the set of borders, non-domain (isolated or not) discontinuities, and where diff (or grad) is zero.

Borders are very important no not forgot: the min for f(x) = 3 x -1 subject to x>5 is 14. Also, remember to distinguish between where the min occur (x=5) and which value the min it is (14). There are also two kinds of min's: extremes (the point isn't in the domain set, as this example) and true mins (point is in the set). Is not casual that the simbol for the border of a set B is dB (well, delta, in Greek). For some few figures there are different words for each one: circle and circumference, for example.

Restrictions means restrictions to the "normal" domain of the independent variables (the x's). Suppose that you want to study the better place for the sound in a cinema. So your restrictions are the walls: if there are a better solution outside de cinema, isn't very well solution.

In other situations, domains are not rectangles, but any domain in the (x,y) plane, like circles, paraboles, etc. That's a topology question, and actually it is very complicated (for example, what happen with holes). This is more interesting if you go to study complex variable calculus.

Usual situations for "programming" problems are, like your example, one function of multiple variables, system of functions of several variables, and differential equations system.

In your first example, I guess that you mixes two notations: f(x,y) = f(X), where X[1]=x, X[2]=y. So, X[3] in your example is actually a mistake. In matchad can use both for minimizing.

Werner present the well construct for your second example.

About mixing differential equations searching minimals, it is more delicate questions, for a lot of reasons. For instance, numerical methods are very sensible (inexact's) in the borders, and we see that they are very important. Other important thing about minimizing diff systems of equations, is that diff is a punctual property, so can vary a lot from points very closed. But, in the other hand, integrals are much more stables, are a interval property of the function, and, at least, is always continue "by the left". So, for systems more or less complicated, (and in your example seems very complicated one) the better way is transform the diff equations into integral equations. Benefits of that, is stability in point variations, and in the borders. (remember that the integral for a<x<b is the same of a<=x<=b, this is, can take out the borders and not change the value of the integral, that's stability in the borders).

Best regards.

Alvaro.

thanks alvaro, for those great explanations, and btw you are so right I put the wrong constraints for the example 1.

the right ones are these:

mt.png

with valery's example i could solve it, but i still don't know how to subject the system to the constraint "they cant be decimal number'.

Hi Wander. Ask to who write the problem what that meaning. Naturals are decimal numbers: for instance, a decimal representation of number six is 5.9999 ... = 6, where "..." means infinite nines. So, it's not a diophantic problem. Rationals are obviously decimal numbers. Reals too, or at least have a decimal representation, and with some considerations can set them as the number by itself. So, "cant be decimal numbers", for me, is translated as "can be reals". Can't be complexes, just because don't have an order relationship, so, there are not max nor mins. By the "last algebra theorem" there are not other "numbers". At least, in algebra.

Best regards.

Alvaro.

Lovely forum this, it's hard to see new posts. I don't see this post from Wander.

Hi Wander. Attached, the analytic and numeric solution for your problem. MC11, sorry. Some considerations are:

- Can do some 3d plots to see f(x,y) restricted to the triangle

- For this case, max and min are points, but could be anything (curves or planes).

- With the restrictions as they are write (with < and not with <=) f don't have a minimum. Have a lower extrema (in spanish, an ínfimo, don't know how to say that in english). That's because the point (20,0) isn't in the function domain.

Best regards.

Alvaro.

AlvaroDíaz написал(а):

- Can do some 3d plots to see f(x,y) restricted to the triangle

Best regards.

Alvaro.

May be so

Study 7. Thermal engineers' gift to water chemists

Oh, no! That's a triangular plot of chemical species. Too complicated for this simple problem. Just some simple 3D plot like the attached. There can see the max near 100, and min near -400.

King regards Valery.

Alvaro.

Ejercicio.gif

AlvaroDíaz написал(а):

Oh, no! That's a triangular plot of chemical species. Too complicated for this simple problem. Just some simple 3D plot like the attached. There can see the max near 100, and min near -400.

May be so

22.gif

Yep. That is it.

Best regards.

Alvaro.

It will be good to use units by using same problems.

3_17_Chairs_1.png

Hi Valery. $=sec could be dangerous. Maybe is best $=cd (candela).

Best regards.

Alvaro.

Yes!

It is the sheet for old Mathcad without units of currency.

Thanks, Alvaro!

thanks valery,your example is very clear to me, it will be really useful.

Thanks Werner, alvaro and valery. yours solutions are ok for me. that was just to learn how to do it. i appreciate it.

Now i present to all of you the real problem i had, as alvaro said  system of diff equations is a more complicated thing to optimise. if it is so what i really had it was much more complicated, i guess. i had a final project in which i had to optimise a concentrations coming out of a system of reactor in series. i had 3 system like example2 one following the other, following the third one i had a system like example 3. In that project,final values of a reactor are the initial conditions for the next one.  but what really matter is the values coming out of the final reactor.

I explain it in the in the sheet, if it isn't clear enough, please let me know, i'll find a way to make it understandable, btw my english is not that good, im sry for that.

The sheet is attached

Hi. A favor: can someone upload as pdf? Thanks in advance.

Alvaro.

LucMeekes
23-Emerald III
(To:AlvaroDíaz)

Mathcad 11 better?

Added a pdf.

LucMeekes wrote:

Mathcad 11 better?

Added a pdf.

Hi Luc. Tempeted to say perfect, but it isn't. Much better, as you say.

Thanks very much.

Alvaro.

One same problem with a paradox and video.

Prime (with me) cannot solve a transportation problem

Announcements

Top Tags