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.
log function
Posted May 6, 2015, 12:25 a.m. EDT Low-Frequency Electromagnetics, Chemical Reaction Engineering Version 5.1 2 Replies
Please login with a confirmed email address before reporting spam
There is a variable psi_init in my model which is defined as follows:
psi_init=((Vt*(((comp1.N<0)*(-log(abs(comp1.p init/ni))))+((comp1.N>=0)*log(abs(comp1.n init/ni)))))-X si)-(0.5*Egap)
The funny thing is that, the parameter inside the log function has an abs() enclosed. Why I got the following error from my solver? Does this mean that abs() function can return a negative value? Or there is a bug from COMSOL?
Failed to find a solution for all parameters,
even when using the minimum parameter step.
Attempt to evaluate real logarithm of negative number.
Function: log
Failed to evaluate variable.
Variable: comp1.psi init, Defined as: ((Vt*(((comp1.N<0)*(-log(abs(comp1.p init/ni))))+((comp1.N>=0)*log(abs(comp1.n init/ni)))))-X si)-(0.5*Egap)
Failed to evaluate variable.
Variable: comp1.es.V0, Defined as: comp1.psi init
Failed to evaluate expression.
Expression: comp1.es.V0-comp1.psi0
Returned solution is not converged.
- Feature: Stationary Solver 1 (sol1/s1)
psi_init=((Vt*(((comp1.N<0)*(-log(abs(comp1.p init/ni))))+((comp1.N>=0)*log(abs(comp1.n init/ni)))))-X si)-(0.5*Egap)
The funny thing is that, the parameter inside the log function has an abs() enclosed. Why I got the following error from my solver? Does this mean that abs() function can return a negative value? Or there is a bug from COMSOL?
Failed to find a solution for all parameters,
even when using the minimum parameter step.
Attempt to evaluate real logarithm of negative number.
Function: log
Failed to evaluate variable.
Variable: comp1.psi init, Defined as: ((Vt*(((comp1.N<0)*(-log(abs(comp1.p init/ni))))+((comp1.N>=0)*log(abs(comp1.n init/ni)))))-X si)-(0.5*Egap)
Failed to evaluate variable.
Variable: comp1.es.V0, Defined as: comp1.psi init
Failed to evaluate expression.
Expression: comp1.es.V0-comp1.psi0
Returned solution is not converged.
- Feature: Stationary Solver 1 (sol1/s1)
2 Replies Last Post May 6, 2015, 10:51 a.m. EDT