I have an optimization problem where I want to minimize a numerical integration subject to certain constraints. Suppose that the objective function (the integration of "FUN") and the constraint are both computed using loops. I have one decesion variable "T" and one integration variable "M". I already wrote a part of the code(the part i wrote just performs the numerical integration )I really need to complete the code . What I need to complete is to minimize the integration of "FUN". The decesion variable is "T" . The constraint I have is computed in the same way of "FUN" , but with M=0 & "FUN"is restricted to the value "10". In otherwords, I want to minimize the integration of "FUN" where the integration variable is M, subject to the constraint that "FUN"=10 at M=0 and the decesion variable in this optimization is "T".
The code I was able to write(integrating "FUN") is:
There's a quite similar posting about this on comp.soft-sys.sas which I believe is from you as well. I've responded in the newsgroup but will respond here also in the interest of getting the information to as many interested parties as possible.
Thanks for posting this question. The best way to do this currently is to use PROC NLP along with PROC FCMP (a Base SAS procedure) to define the objective function. I consulted with one of our developers on this question and he sent some sample code which uses this approach for a problem that's pretty similar to yours. It's included at the end of this email.
PROC OPTMODEL in SAS/OR is the successor to PROC NLP (it handles
not only nonlinear but also linear, mixed integer, and quadratic optimization).
However OPTMODEL is not yet FCMP-enabled and so it's best, given your
requirements, for you to stick with PROC NLP for now.
If you have any questions please feel free to contact me.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.