The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 2:30am
Pages: 1
Send Topic Print
Natural Log Convergence (Read 1799 times)
littlenasboy
New Member
*
Offline



Posts: 6

Natural Log Convergence
Sep 11th, 2008, 8:19am
 
I'm working on a model which requires the use of the natural log operator.  The model works fine when driven with voltage sources over the entire range of operation, but won't converge when using current sources.

Here is a sample of the code...

if (ID >=0) begin
LNID=ln(ID+1e-12);
end else begin
LNID=ln(ID+1e-12);
end

Perhaps the derivative blows up for ID values near 0...but I don't know how to prevent that...
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Natural Log Convergence
Reply #1 - Sep 12th, 2008, 6:28am
 
I think you mistyped; the if and else blocks are the same.

You could have an issue, depending on the rest of your code, that the simulator uses an initial guess of 0 for the branch current.  Then again, maybe not, since it's the same model code independent of what's driving.

You probably need to look more closely at your probes and sources (contributions).  You might have something that looks like two current sources in series with a very slight mismatch in the sourced current.  What if you put in a huge resistance in parallel, or shrink the 1e-12 so that it's less than abstol?
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.