Frederik Noack
2009-Feb-05 12:50 UTC
[R] optimal control, maximization with several variables?
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.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a
Ravi Varadhan
2009-Feb-05 16:33 UTC
[R] optimal control, maximization with several variables?
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.
Seemingly Similar Threads
- Anomalous outputs from rbeta when using two different random number seeds
- grid 4.0 generates wrong results when adding two complex units by sum()
- A function that can modify an object? Or at least shows principles how to modify an object?
- You have not permission to view content of this location
- subsetting comparison problem