Lisa.
Lisa.

Reputation: 11

How it is possible to linearize this equation and to implement it in FreeFEM++ code?

I am contacting you to try to get some answers about a problem related to a non linear problem.

In fact, I tried to linearize the equation so for this I took c1 = c10 + dc1 where c1 is my variable, c10 is an initial constant and dc1 is the increment.

The corresponding code is :

//Initial value 
dc=0;

//Problem
problem first(c1,c2) = int2d(Sh)(c2*dc1/dt) - int2d(Sh)(c2*dc/dt) + int2d(Sh)(R(dx(c1)dx(c2)+dy(c1)dy(c2))/(c10 + dc1)) + int2d(Sh)(ESN*(dx(c1)dx(c2)+dy(c1)dy(c2))c1) - int2d(Sh)(R(c10 + dc1)F/NDgrad(c2)‘grad(S)) - int2d(Sh)(ESFgrad(c2)’*grad(S)) + on(1,c1=C0) + on(2,c1=C0) + on(3,c1=C0) + on(4,c1=C0)
//Where dc is the incement at t-1 
//and c2 is the test function added when the variational form, of the problem, was written.

problem second([Vx, Vy],[Ux, Uy]) = -int2d(Sh)(A*epsilon(Vx,Vy)'*epsilon(Ux,Uy)+C*div(Ux,Uy)*div(Vx,Vy)) + int2d(Sh)((B+A)*c1*X*div(Ux,Uy)) + on(1,Vx=0) + on(2,Vy=0)
// Where Vx, Vy are my variables and Ux, Uy are functions test (in the same way as previously).

To determine the increment dc1, I used a loop:

second;
for (iter=1;iter< niter+1;iter=iter+1) 
{
first;
dc1 = c1-c10;
second;
cout << "t = " << tt << "/"<< dt*niter <<" -> residu = " << residu << endl ;
// iteration //
tt=iter*dt;
dc=dc1 ; 
};

When I compiled the code, the values of c1 are completely incorrect and increase very quickly.

Could someone help me? Or give me some tips on this code?

I hope I have given enough information to allow you to understand the code and especially the error I had to write.

Thank you in advance.

Upvotes: 1

Views: 65

Answers (0)

Related Questions