Hi Omer,

You may want to post the whole script so we can run it and also post the full traceback. Before doing
that you may want to identify which equation, which term in the equation and which part of the
coefficient is throwing the error. You can then post a striped down script with only those parts that
are required to throw the error.

The error you are getting could be associated with the "/" in the coefficient. Check that the divisor is
not too small.

On Nov 14, 2006, at 4:35 PM, Omer Yassur wrote:

Hello,
 
I am trying to solve Poisson equation in SAMFET (Self Assembly Monolayer Field Effect Transistor).
The device is consisted of electrolyte - oxide - semiconductor. I have written charge _expression_ (for  the different regions) in the following way:
 
# calculate the charge density in the semiconductor
x = mesh.getCellCenters()[...,0]
s1_semi =( -((q*B)/(eps_si))*(Na*exp(-B*psy)+np0*exp(B*psy))) * (x <= dbulk)
s0_semi= ((q/eps_si)*(Na*(exp(-B*psy)-1)-np0*(exp(B*psy)-1))-s1_semi*psy) * (x <= dbulk)
from fipy.terms.implicitSourceTerm import ImplicitSourceTerm
implicitSource_semi = ImplicitSourceTerm(coeff = s1_semi)
 

# calculate the charge density in the diffuse layer
psyD=psy-Vref
s1_electrolyte=-(((q*Ho*B)/(eps_aqa))*(exp(-B*psyD)+exp(B*psyD))) * (x >= dh)
s0_electrolyte=(((q*Ho)/(eps_aqa))*(exp(-B*psyD)-exp(B*psyD))-s1_electrolyte*psyD) * (x >= dh)
from fipy.terms.implicitSourceTerm import ImplicitSourceTerm
implicitSource_electrolyte = ImplicitSourceTerm(coeff = s1_electrolyte)
 
 
and the equation is written in the following way:
samfet_eq = diffTerm + s0_semi + implicitSource_semi + s0_electrolyte + implicitSource_electrolyte == 0
 
Running my full script will cause the following errors:
>>>>
cg not converged
....
....
....  errors 
....
ValueError: math domain error
 
It seems that FiPy is trying to solve it, has convergence problem and then exit because of error that is not clear to me.
I will appreciate if you could give some clue about this error.
 
Thanks,
Omer
 


--
Daniel Wheeler


Reply via email to