# [R] Optimization

Tue Jul 17 15:50:31 CEST 2007

```Hi,

Your problem can be solved analytically.  Eliminate one of the variables,
say x3, from the problem by using the equality x1 + x2 + x3 = 1. Then solve
for the intersection of the circle (in x1 and x2) defined by the radical
constraint, with the straight line defined by the objective function.  There
will be, at most, two intersection points. The extremum has to be one of
these two points, provided they also satisfy the other inequalities (To me,
this sounds an awful lot like a homework problem).

Ravi.

----------------------------------------------------------------------------
-------

Assistant Professor, The Center on Aging and Health

Division of Geriatric Medicine and Gerontology

Johns Hopkins University

Ph: (410) 502-2619

Fax: (410) 614-9625

----------------------------------------------------------------------------
--------

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of massimiliano.talarico
Sent: Monday, July 16, 2007 4:50 PM
To: r-help
Subject: [R] Optimization

Dear all,
I need a suggest to obtain the max of this function:

Max x1*0.021986+x2*0.000964+x3*0.02913

with these conditions:

x1+x2+x3=1;
x1>=0;
x1<=1;
x2>=0;
x2<=1;
x3>=0;
x3<=1;

Any suggests ?