Eliano Marques <eliano.m.marq...@gmail.com> writes:

> Hi there,
>
> I need help in an optimization procedement.
>
> I'm trying to maximize the function fn=x^2+5y^2 with the restriction of
> fn1=x-y<=5.
>
> I tried the genoud method and as well the alabama method.
>
> I have problems to set the constraint in R.
>
> Can someone help me please?

Probably not.

 fn <- function(x,y) x^2+5*y^2
 fn1 <- function(x) x-5 # solve for y at boundary
 curve( fn(x,fn1(x)), -1000,1000)

what maximum?

Chuck

>
> Regards,
> Eliano
>
>       [[alternative HTML version deleted]]
>

-- 
Charles C. Berry                            Dept of Family/Preventive Medicine
cbe...@tajo.ucsd.edu                        UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to