Monday, January 1, 2024

Welcome to NL5

This blog is an "informal" part of NL5 Circuit Simulator website. I'm going to explain what NL5 is, how is it different from popular (Spice-based) simulation tools, and why it worth trying.

It turned out that in Spice-dominating world many people undervalue, or simply are not aware of apparent benefits of simulation with "ideal" components. Some people strongly oppose the whole idea of "ideal" simulation, some people love it. I believe, both "real" and "ideal" simulation approaches make sense, as long as you understand what you are doing: "use right tool for right task".
Thanks.

19 comments:

  1. Can new devices added to Nl5 ?

    ReplyDelete
  2. Sure, especially if it is something useful for everybody. Just e-mail it, submit on "Contact us" page of NL5 website, or start topic in the NL5 forum.
    If the component/model is something very special, or you don't wont it to be offered for public, we can discuss that as well.

    ReplyDelete
  3. As I remember my work 20 years ago simulating ideal switches as extreme representatives of being either voltage controlled or current controlled 2-terminals is not possible with the modified nodal approach. It lead to in accurate and unsolveable matrix scaling issues. I investigate long time ago time variant tableau approaches which lead to time variant modified state matrix representation in partly explicte and implicite time integration solution. The origin of that work was time variable state space representation of switching networks like DC-DC. But also similar structures like MOS with switch like numerical terminal behaviour profit from this general work. I have extension formulas also for switched networks with time varing degree defficiency where currents and voltages could have distributive nature. A further sideeffect was the study of special sparse matrix solution methods which combine direct and interative solution to balance computation and memory reference based on coefficent classification derived on binary classes built up from the dulmage-mendelsohn decomp.

    Today some of this principles could be found here and there in comercial simulators.

    Is there a similar method used in NL5?

    ReplyDelete
  4. It's hard to say, mostly because I don't understand 50% of what you've said (sorry ! :). Some terms sound familiar though, but I can't recognize for sure what problems are described. Is it something about ideal switches?

    I can just say that I've developed all the algorithms myself, solving all problems in (as I believe) natural and obvious way, except some moments and tricks which probably distinguish NL from other piecewise-linear simulators.

    ReplyDelete
  5. Yes,

    ready my post again is very compressed and cryptic. After discovering what basically NL5 should solve I remember my finding in circuit simulator development which I leave more than 20 years ago.

    I will explain the most similarity between what I have done and what I think is implemented in NL5.

    One of the first procedures in circuit simulation is to built a spanning tree or forest form the connectivity information of the flat netlist. So in effect you assign components to the tree or to the cotree. That means that they are either be voltage of current controlled. That general principle could also be applied to controlled sources of either type but the algrithms are then not based on graph theory but on matroid theory. There typical conflicts like cutsets of sources or loops of voltage sources. For all these are methods to either reducing the number of degrees either in the state variable or there derivation over time.

    That is all known and there are well developed algos. I remember that IBM have used these in there inhouse simulator. But to be honest I am not on current track of development now.

    The new point is that like switches and also MOS device chare a property which make the static assignment to being either voltage of current controlled by numerical difficult. In modified nodal analysis that is not solved at the orign but by adding glue elements like minimum res or minium conductance. I realized that more time effectice solution of the further matrix operation after assigning elements is done if there assignment is done dynamic. So it is not only more accurate but more efficient. And the specific reason is not that the fill in is better or the condition number is lower but it allows a combination of special tearing and combining direct and iterative sparse matrix solution.

    Hope that explain a little my thinking about a possible similarity.

    ReplyDelete
  6. Does not help much...
    1. While creating netlist I'm not using neither graph nor matroid theory (what is it?)
    2. I don't care if the component is voltage or current controlled and if there are current or voltage loops.
    3. There are no minimum res or minimum conductance (ideal switches are zero/infinity), there are no iterations solving linear system: it's simple Gauss elimination (with some modification though)
    4. I'm not using sparse matrix technique, at least in its common meaning. NL is optimized for speed, not for memory. It is not supposed to simulate thousands of transistors, it is tool primarily for fast evaluation of reasonably small circuits.

    ReplyDelete
    Replies
    1. With respect to point 3&4, it appears that you are aware of the problem of loops formed by capacitors and ideal voltage sources (you call it "a problem to be fixed real soon now" somewhere), or cut-sets of current sources and inductors. Solving this problem with series and parallel resistors is possible, but it creates stiff sets of equations where Gaussian elimination produces very inaccurate results. However, this problem only becomes obvious with quite large sets of equations (> 200 components), maybe smaller than NL5 is designed for. Hope this helps to understand Anonymous' quite interesting remarks.

      Delete
    2. Thank you for your comment.
      Of course I am aware of those problems: this is the first thing you have to take care of when dealing with true ideal components.
      Stiff system is also a problem, and in fact it is noticeable even in small circuits with just a few components: may be not by average user, but I can see it quite often.

      Delete
  7. To anonymous specialist in circuit analysis: first of all hello! I'm interested to discuss the theoretical background and different approaches to compose the equations (state-space, MNA, etc.) IMHO, the best place for such discussion is the NL5 forum. So, I suggest for both of us to register there.

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. I am not saying it is simple, and I agree that ideal switches (ideal components in general) are problematic.
    However, this is my job to handle it, not users.
    You might have noticed, if there no solution, I honestly display a message "No solution".
    If there are many solutions, I select any of them, since the user most likely does not care, and it does not affect the rest of the circuit anyway.
    Other that that, solution is correct, and I don't see any reason why ideal components should not be allowed, even with some headache for me.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  10. I don't know if my approach is similar or different, since I was never interested in other's solutions. Maybe just reinvented the wheel, or could be something very different.
    As for "showing a way", please note that there is a very LONG way from an idea in scientific article to a working product. The main problem is that most of suggested ideas apply to specific cases and conditions only, while a good product should work for any real, stupid, and even unreal circuit topology and component values without exceptions.

    ReplyDelete
  11. This comment has been removed by a blog administrator.

    ReplyDelete
  12. What is the difference between NL5 and Fastmean?

    ReplyDelete
  13. Is everything ok in the program? Judging by the comments - no.
    https://www.linkedin.com/posts/denis-batishchev-bb4510217_we-continue-to-explore-the-nl5-circuit-simulator-activity-7199180051106439168-lnVj?utm_source=share&utm_medium=member_desktop

    ReplyDelete
  14. First of all, you are unblocked in my LinkedIn, so you can comment there if you wish. but please no "WTF"s. I won't reply in this blog anymore, since nobody comes here to read this.
    As for your comment, you are right, I have to add better explanation how zero rise/fall works in the Manual and Help. What happens is: zero rise/fall is shown as an "instantaneous jump" at ONE current simulation step, similar to switches. The current step depends on specified max simulation step, periods of pulse/sine sources in the schematic, etc., AND how the step is decreased at switching points. You probably used default transient advanced settings where this decrease is defined, and this default is different in NL5 Ver.2 and Ver.3. The switching step will be much smaller in Ver 2, so you have to zoom the slope much more to see it as you see in NL5 Ver.3.

    ReplyDelete
  15. Note to Readers: WTF (What The Fall), WTR (What The Rise), not what you think

    ReplyDelete