# **********************************************************************************
# * Copyright (c) 2019 Process Systems Engineering (AVT.SVT), RWTH Aachen University
# *
# * This program and the accompanying materials are made available under the
# * terms of the Eclipse Public License 2.0 which is available at
# * http://www.eclipse.org/legal/epl-2.0.
# *
# * SPDX-License-Identifier: EPL-2.0
# *
# * @file problem.txt
# *
# * @brief File containing an exemplary optimization problem in ALE syntax
# *
# **********************************************************************************

definitions:
# Variables
binary x;
real y in [-2,2];

# Initialize parameters
real a  := 20;
real p1 := 0.2;
real p2 := 3.14159265358979323846; # ~ PI

# Functions for reduced-space
real f1() := -p1 * sqrt( (x^2 + y^2) / 2 );               # This is a function without arguments
real f2(real m, real l) := (cos(p2*m) + cos(p2*l)) / 2;   # This is a function

# Initial point
x.init <- 0;
y.init <- 1;

constraints:
# Inequality constraints
x <= 1 "x <= 1";

# Equality constraints
pow(x,2) + sqr(y) = 1 "circle equality";

relaxation only constraints:
# Relaxation-only inequality
#y - 1 <= 0 "y <= 1";

# Relaxation-only equality
#y + x = 1 "y + x = 1";

outputs:
# Additional output
f1()    "Result of f1()";
f2(x,y) "Result of f2(x,y)";

objective: # Always minimizing
# Objective given as the Ackley function
-a * exp(f1()) - exp(f2(x,y)) + a + exp(1);