# F.Hecht, G.Lance, E. TrĂ©lat
# Reusable template to solve optimization problem using IpOpt within FreeFEM
# Example taken from "PDE constrained optimization within FreeFEM"
# Example (2.1,2.2,2.3) in Section 2.1.4:
# Solving template for LQ example using AMPL
# \min_{u} \int_{\Omega} (y-y_d)^2\,dx + \alpha \int_{\Omega} u^2 \,dx
# under the constraints
# -\Delta y = u, y_{\vert \partial \Omega} = 0, y(0)= 0
#
# Use of AMPL solver -> data file needed by AMPL
data;
param m := 2600;
param: indexA: A :=
include A.txt
;
param: indexB: B:=
include B.txt
;
param yd := 0.1;
read{i in index}(L[i]) < L.txt;