Hello everyone

In the following example, some optimization algorithms in NLOPT are called to solve the extreme value problem. There is a piece of code that I don’t understand.

int NN = 6;

load"medit"

mesh Th = square(NN,NN);

func f1=1.;

func f2=-1.;

func g1=0.;

func g2=0.1;

int iter=0;

int nadapt=10;

real starttol=1e-6,bctol=6.e-12;

fespace Vh(Th,P1);

Vh oldu1,oldu2;

varf BVF(v,w) = int2d(Th)(0.5*dx(v) dx(w) + 0.5dy(v)dy(w));*w);

varf LVF1(v,w) = int2d(Th)(f1w);

varf LVF2(v,w) = int2d(Th)(f2

matrix A = BVF(Vh,Vh);

real[int] b1 = LVF1(0,Vh),b2 = LVF2(0,Vh);

varf Vbord(v,w) = on(1,2,3,4,v=1);

Vh In,Bord;

Bord = Vbord(0,Vh,tgv=1);

In = Bord ? 0:1;

Vh gh1=Bord*g1,gh2=Bord*g2;

func real J(real[int] &X)

{

Vh u1,u2;

u1 = X(0:Vh.ndof-1);

u2 = X(Vh.ndof:2*Vh.ndof-1);
iter++;
real[int] Au1 = A*u1, Au2 = A*u2;

Au1 -= b1;

Au2 -= b2;

real val = u1‘*Au1 + u2’*Au2;

if(iter %10==9)

plot(u1,u2,nbiso=30,fill=1,dim=3,cmm="adapt level " + al + " - iteration " + iter + " - J = " + val,value=1);

cout<<“a=”<<u1<<endl;

}

I don’t understand the X in line 24. I hope someone can give me some answers.

```
thank you
```