[Ipopt] periodic boundary condition (modifying variables

Breannan Smith smith at cs.columbia.edu
Wed Apr 10 10:16:34 EDT 2013


Hi Knut,

You will probably have to make a copy of the data. Since you are using
Eigen, instead of using a map, do something like this:

Eigen::Matrix< Number, Eigen::Dynamic, 1 > x_mod =  const
Eigen::Map<const Eigen::Matrix< Number, Eigen::Dynamic, 1 > >( x, n );

You can then loop over all of your data to enforce the periodic
boundary conditions.

Best regards,
Breannan Smith


On Wed, Apr 10, 2013 at 7:46 AM, Knut Heidemann <heidemannknut at gmail.com> wrote:
> Hi,
>
> Projecting inside the evaluation routines should be possible and, I guess,
> sufficient.
> Where exactly should I modify the variables?
>
> For example
>
>     bool WLCNLP::eval_f( Index n, const Number* x, bool new_x, Number&
> obj_value )
>
> does not let me modify x. How would one usually do that?
>
> Currently I am processing x as follows, in order to get the objective value:
>
>     const Eigen::Map< const Eigen::Matrix< Number, Eigen::Dynamic, 1 > >
> x_map( x, n );
>     obj_value = system.evaluateEnergy(x_map);
>
> (I apologize for my very limited programming skills.)
>
> Best,
> Knut.
>
> Am 02.04.2013 17:53, schrieb Stefan Vigerske:
>
> Hi,
>
> I don't think that this is possible without implementation somewhere deep in
> Ipopt.
> Could you let the variables free and just project their values into [0,L]
> inside your evaluation routines?
>
> Stefan
>
> On 04/02/2013 01:45 PM, Knut Heidemann wrote:
>
> Hi everyone,
>
> I am searching for the feature in IPOPT, which allows me to modify the
> optimization variables in between iterations.
> In particular, I want to apply periodic boundary conditions on my
> problem, meaning that every time a variable leaves the interval [0,L], I
> want to do the following:
>
> If x < 0 : x+=L
> If x > L : x-=L
>
> Is there a way of realizing this such that none of the values stays
> outside the interval in between two steps of the "lowest" optimization
> level (inside the Newton type iteration)?
>
> Best,
> Knut.
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt
>
>
>
>
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt
>


More information about the Ipopt mailing list