Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Langevin Equation

Please login with a confirmed email address before reporting spam

Hi everyone,

I'm trying to solve a simplified Langevin equation with the COMSOL Mathematics Module. I use the sub-module Global ODEs and DAEs and my equation is :

xt - rn1(t)*sqrt(2*D/dt) ( = 0 )

where xt is the time derivative of a position x. D is a diffusion constant whereas dt is the time step and rn1(t), a normally distributed random number with a mean of 0 and standard deviation of 1.

Problem : I don't find the correct behavior of the mean square displacement (expected linear in time) after a statistical analysis with a Python algorithm. If you look at the attached picture, you will note that any COMSOL resolution method isn't able to give the correct behavior, except one. The BDF method doesn't converge and the Runge-Kutta Cash-Karp method is abnormally long.
The Alpha Generalized method seems to be functional however I don't have any confidence in its result. You can compare it with a very simple Euler method made with Python. The set of parameters is : D = 5 m*m/s, dt = 1s, x(t=0)=0, integration time to 100000.

I also tried with an inertial term, my equation is then :

xtt + g*xt - g*rn1(t)*sqrt(2*D/dt) ( = 0 ) where g is the friction coefficient by mass unit (m, mass),

and the results are better (some methods don't converge, others work - see the second attached picture).

I have the intuition that the problem is the real time step management of COMSOL because the software uses its own time segmentation which, I think, sometimes, distorts the evaluation of the Gaussian noise rn1(t). It seems the process is time segmenting dependent, mostly when the equation is singular.

Is there anybody who has a better idea or a solution ?

Sincerely,


0 Replies Last Post 2016年11月17日 GMT-5 10:41
COMSOL Moderator

Hello John Palmeri

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.