|
From: | Julien Bect |
Subject: | Re: Optimization in Octave |
Date: | Fri, 28 Feb 2014 13:55:39 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
On 28/02/2014 12:07, Juan Pablo
Carbajal wrote:
On Fri, Feb 28, 2014 at 11:45 AM, Urs Hackstein <address@hidden> wrote:Dear all, we have the following optimization problem: Given a (nonlinear, but almost everywhere differentiable) function p:[0.5,20]^4*[5,200]\to\mathbb{C} we want to find the maximum of Re(p(x_1,x_2,x_3,x_4,x_5)) for fixed imaginary part Im(p(x_1,x_2,x_3,x_4,x_5))=y_0. Is it possible to solve this problem using Octave? Thanks a lot in advance! Best regards, Urs Hackstein _______________________________________________ Help-octave mailing list address@hidden https://mailman.cae.wisc.edu/listinfo/help-octaveIf you have the function, and you want to fix the imaginary part, then you have a real function. If it is differentiable, I see no problem using gradient based methods. If it is not differentiable then you can use ga, or in prticular cma-es https://www.lri.fr/~hansen/cmaes_inmatlab.html I would rather say that this is an *equality constrained* problem with 5 variables and 1 equality constraint. In Octave core, you can try sqp to solve it. Something like : F = @(x)(real (p (x(1), x(2), x(3), x(4), x(5))); G = @(x)(imag (p (x(1), x(2), x(3), x(4), x(5)) - y_0); lb = [0.5 0.5 0.5 0.5 5]; ub = [20 20 20 20 200]; x_opt = sqp (x_init, F, G, [], lb, ub) Type "help sqp" for more details. You can also provide the gradient, if you have it. If sqp doesn't work for you, have a look at the optim package or NLopt. @++ Julien |
[Prev in Thread] | Current Thread | [Next in Thread] |