1

我正在与您联系以尝试获得有关与非线性问题相关的问题的一些答案。

事实上,我试图将方程线性化,所以为此我取了 c1 = c10 + dc1,其中 c1 是我的变量,c10 是初始常数,dc1 是增量。

对应的代码是:

//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).

为了确定增量 dc1,我使用了一个循环:

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 ; 
};

当我编译代码时,c1 的值完全不正确,并且增加得非常快。

有人可以帮助我吗?或者给我一些关于这段代码的提示?

我希望我已经提供了足够的信息来让您理解代码,尤其是我必须编写的错误。

先感谢您。

4

0 回答 0