[R] optimal control, maximization with several variables?
Ravi Varadhan
rvaradhan at jhmi.edu
Thu Feb 5 17:33:51 CET 2009
I assume that you are looking to solve, in R, the constrained optimization problem:
H (u1, u2) = a*u1+b*u2+c*f1(u2)+lambda*(x')
with constraints: 0<u1<x, 0<u2<f2(x,u2)
where a, b, x, and x' are known.
Am I right?
If so, you can use the package Rdonlp2.
I have written an extension of ConstrOptim that can handle nonlinear inequality constraints. This is another option.
Best,
Ravi.
____________________________________________________________________
Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and Gerontology
School of Medicine
Johns Hopkins University
Ph. (410) 502-2619
email: rvaradhan at jhmi.edu
----- Original Message -----
From: Frederik Noack <frederik.noack at gmx.de>
Date: Thursday, February 5, 2009 8:47 am
Subject: [R] optimal control, maximization with several variables?
To: R-help at r-project.org
> Dear all,
> I would like to solve the following problem, which can be done with
> optimal control theory or dynamic programming:
>
> max(x,y) a*u1+b*u2+c*f1(u2) s.t. 0<u1<x, 0<u2<f2(x,u2), x'=f3(u1,u2,x)
>
> which can be rewritten if optimal control theory should be applied as
>
> H=a*u1+b*u2+c*f1(u2)+lambda*(x') s.t. 0<u1<x, 0<u2<f2(x,u2)
>
> The maximum principle conditions would solve the problem.
> However in steady state conditions the system simplifies further with
> u1=x' und lambda=a.
> Is it possible to solve this problem in R and if yes then how?
> It might be sufficient for me to maximize a simple nonlinear function
> f(x,y) w.r.t. x and y.
> Does anyone know how to do it? I tried optim and genoud but untill
> now it did not work.
> Best wishes
> Frederik
>
>
>
> --
> Jetzt 1 Monat kostenlos! GMX FreeDSL - Telefonanschluss + DSL
> für nur 17,95 Euro/mtl.!*
>
> ______________________________________________
> R-help at r-project.org mailing list
>
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list