Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 5773

Langevin function (division by zero)

$
0
0

Dear Forum,

I am trying to implement a modified version of the Poisson Nerst-Planck equation, where the electric permitivity of the medium varies with the local electric field. Which is calculated like this:

Where is the electric potential, is the avogadro number, is the concentration of solvent, and is the dipolar moment of the solvent.

Then the dipolar moment is calculated as

Where L(x) = coth(x) - 1/x, is the Langevine function.

When trying to implement this L(x) in COMSOL as an analytic function within the Definitions of my model, and running my model I get the following error.

' - Feature: Stationary Solver 1 (sol1/s1) Division by zero. - Function: / Failed to evaluate expression. - Expression: coth(an1__x__internalArgument)-1/an1__x__internalArgument Error in user-defined function. - Function: comp1.an1'

Basically COMSOL detects a divergence in the division, however the Langevine function does not have a divergence a x=0 because the coth(x) compensates the 1/x.

How can I solve this problem? Is there any way of including this functions within COMSOL?\

Best regards,

Oier.


Viewing all articles
Browse latest Browse all 5773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>