如何线性化这个方程并在 FreeFEM++ 代码中实现它?

问题描述

我正在与您联系,试图就与非线性问题相关的问题获得一些答案。

事实上,我试图将方程线性化,所以为此我取了 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的值完全不正确,并且增加得非常快。

有人可以帮我吗?或者给我一些有关此代码提示

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

提前致谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)