Resolve an equation

Hi,

i hope that you can help me to solve my problem please.

I(x,t) is solution of a variational formulation: system.

To find I, we write

load “iovtk”

verbosity=1;

int Nbx=10000;

real L=2.;

real t=0.0;

real dt=0.1;

real T=50.0;

real beta=5.;

real a=10.;

real Dx=L/Nbx;

load “msh3”

meshL Thl=segment(Nbx,[x*L,0.]);

fespace Vh2(Thl,P1);

Vh2 I, IH;

Vh2 oldI=10;

problem system(I,IH,solver=UMFPACK)=

int1d(Thl)(IIH/dt + betaI*IH)

  • int1d(Thl)(oldIIH/dt + aIH);

for (real t=0;t<T;t+=dt) {

system,

}

My question is: how we can resolve the equation I(x,t)=0.5 for all t: find x=x(t) such that I(x,t)=0.5 for all t and after this, calculate c(t)=x’(t).

To find the solution of the equation I(x,t)=0.5 i try to write the following algotirhme

but the problem it that FF++ don’t understand the expression I(x0,t) or I(x1,t)

there is a solution to adapte this algorithm to FreeFrem++ and find the solution x=x(t)? Please.

real x0, x1, y0, V0, V1;

x0=0.0;

verbosity=1;
int Nbx=10000;
real L=2.;
real t=0.0;
real dt=0.1;
real T=50.0;
real beta=5.;
real a=10.;
real Dx=L/Nbx;
load “msh3”
meshL Thl=segment(Nbx,[xL,0.]);
fespace Vh2(Thl,P1);
Vh2 I, IH;
Vh2 oldI=10;
problem system(I,IH,solver=UMFPACK)=
int1d(Thl)(I
IH/dt + betaIIH)
- int1d(Thl)(oldIIH/dt + aIH);

for (real t=0;t<T;t+=dt) {
system,

I0=I(x0,t)-0.5;

real signe;
if (I0>0.0) { signe=1.0; }
else {signe=-1.0;}
for (int i = 1; i < N; i++)
{
x1=Lreal(i)/real(N-1);
I1=I(x1,t)-0.5;
if (I1
signe<0.0)
{
xt = (I1x0 - I0x1) / (I1 - I0)
}
x0=x1;
I0=I1;
}

}

Thank you in advance for the help

Best regards,