Spice/simulation tools - Page 1
Forum section: electronics / general

author: ricko_uk
author_rank: Super Contributor
timestamp: December 05, 2019, 02:49:23 pm
content: Hi,it has been long time since I played with analog simulation. I want to start again and choose the ideal one for me... 1) quick and simple to learn and use 2) availability of most component models (not sure if there are more than one SPICE types of component models or if all models work with all simulation tools)The ones I'm looking at are:1) Altium2) LTSpice3) others you might suggest?Thank you in advance for any feedback

author: Pseudobyte
author_rank: Frequent Contributor
timestamp: December 05, 2019, 04:05:43 pm
content: You really cannot go wrong with LTSpice. I also use Qucs for s parameter type simulations.

author: ricko_uk
author_rank: Super Contributor
timestamp: December 05, 2019, 04:35:54 pm
content: where can I find a very simple primer for both?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 05, 2019, 04:53:23 pm
content: Altium because you already have/use it..?Models are loaded in the, well, model section of a SCH part; some built-in libraries come with these, and you can load them (in the project, or installed libraries) as you see fit. Also, if you create new .mdl or .ckt, by default, it gets added to the current project, thus making it available to schematic parts.Anyway, Altium's documentation on this is straightforward, at least for getting started. It's not well explored or developed or maintained, as far as I can tell it's just about been forgotten since 2009, if not earlier... but it is still usable.Tim

author: ricko_uk
author_rank: Super Contributor
timestamp: December 05, 2019, 05:21:44 pm
content: Thank you Tim,I have a license of Altium 2013. I am thinking of upgrading to the latest version but not sure if they fully support simulation and you also say the documentaiton has not been well maintained.Do you know if Altium:1) puts decent effort in still developing it? If I ask them they obviously say yes2) they continually keep adding models or do so only on customers request (i.e. I would have to buy support package too)?3) most important, how difficult is it for me to create a Spice model to use in Altium (if the manufacturer already supplies some sort of spice model)?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 05, 2019, 06:21:07 pm
content: 1. Seemingly a little. I've had a bug or two in this area flagged as "fixed". Don't know if that's just token patching or real maintenance. Anyway, they haven'tremovedit, it's fine.2. Don't know if Vault items ever have SPICE. But I only ever look in there for models (SCH/PCB) for big annoying things, that aren't practical to simulate anyway so I don't expect them to have models.3. Most I can think is about five steps:0. You've already downloaded the file, or copied it from a datasheet, or whatever.1. Rename to .mdl (contains .MODEL statements) or .ckt (.SUBCKTs)2. Make excerpts if needed (Altium seems to have trouble parsing enormous libraries; search to find desired MODEL/SUBCKT, copy relevant matter into new file, save)3. Load file into project or whatever4. Add model to part5. Run the simulation, or keep adding models or whatever, you're on your own at this point.Again, this stuff is in the docs (well, not #2). Have you not looked at the documentation for the product you own? Get simulating already. Go!Tim

author: chrisl
author_rank: Regular Contributor
timestamp: December 06, 2019, 07:27:02 am
content: Micro-cap from Spectrum Softwarehttp://www.spectrum-soft.com/download/download.shtmNo license required.

author: ricko_uk
author_rank: Super Contributor
timestamp: December 06, 2019, 02:31:45 pm
content: How precise/reliable is it? I watched a video just now and it looks a bit basic. I also couldn't fine one showing full simulation on graph output (i.e. time domain analisys/output). What about the component libraries? Does it have a large library of coponents for simulation (ICs, etc)?

author: thm_w
author_rank: Super Contributor
timestamp: December 07, 2019, 01:18:38 am
content: Quote from: ricko_uk on December 06, 2019, 02:31:45 pmDownload it and try it out, the component library is huge, there are many sample simulations.I prefer it over ltspice, unless you want to sim a specific LT component.

author: CadenceAE
author_rank: Contributor
timestamp: December 07, 2019, 02:57:01 pm
content: you should also consider PSpiceWww.pspice.com.It offers a free trial, which if your only doing small circuits, maybe sufficient for your needs.-More models than any of the other solutions being looked at. (LT spice kinda forces you to use their devices only)-A mature and robust solution-Used professionally by many fortune 500 companies-Built in Spice and analog training-Advanced analysis like Monty Carlo, optimizer, smoke-Built in integration with TI webbench-Integration with Matlab for system simulatoin-Supports mixed signal

author: PKTKS
author_rank: Super Contributor
timestamp: December 08, 2019, 10:23:49 am
content: Quote from: CadenceAE on December 07, 2019, 02:57:01 pmTRUE. It was the best option due to large "spice" based compat.and having large pspice manufact. published libs.No longer the best option since the ngspicehttp://ngspice.sourceforge.net/is now mature enough to reliable simulation with advantages:- it is PSPICE fully compatible- it is now VDMOS (aka LTSpice) fully compatible- it is stable and backwards all compatible with spice itself(programmable, intrinsic syntax and other goodies)FREE open source - no royalties no crappy dealsYou have a more or less front end in KiCAD.However IHMO - all front ends lack the programmable advantage od SPICE.so.. indeed SPICE scripts are the bottom lineno longer the fancy "UIs interface."Unfortunately digital simulation is not trivial and not easily doneNevertheless I have myself crafted some fancy toys on that.Some shots attached - pure spice.ReagrdsPaul

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 08, 2019, 06:02:27 pm
content: I also recommend ngspice. Not really for someone looking for just point-and-click software, though, IMO. (Although KiCad now integrates it, but haven't tried a lot.)LTSpice is usually much faster though, and more user-friendly.

author: PKTKS
author_rank: Super Contributor
timestamp: December 09, 2019, 10:53:46 am
content: Quote from: SiliconWizard on December 08, 2019, 06:02:27 pmI agree with the part "more user-friendly"But "fast" does not match because there is no way to compare them.LTSpice became to much biased to their own product lineand to complicate things further their "MODELS" are proprietaryall models are VDMOS based and PSPICE compatibility is limitedto say the least.Now that ngspice supports VDMOS natively you can use publicPSPICE models and still simulate even LTSpice based onesOnce SPICE itself is fully programmable with data logging andpost analysis function there is no way simple to "compare" thatvisually oriented interface with such programmable data-logger one.Results are not even close. And "faster" may just be forsome particular models they have crafted for their own (proprietary) useReason why they are "faster" - does not mean better.They are too much biased today - IMHOPaul

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 09, 2019, 03:10:20 pm
content: Quote from: PKTKS on December 09, 2019, 10:53:46 amYes there is. Just simulate the same circuit with the same Spice base elements. LTspice is a Spice-based simulator before anything else. Sure it supports in-house models but you don't have to use them.LTSpice has a multi-threaded engine (and even if it's not optimal, you still get significant speed increase compared to single-threaded typically) and has been optimized for speed all in all for years. This was not the case for ngspice, which I think had more accuracy as a goal than speed. There is a multi-threaded version of ngspice (I think based on OpenMP?) but I've never gotten around to using it - there is no official binary, I don't think the dev teams guarantees anything with it, and I couldn't manage to built it (but some may have).Again, just take the same Spice circuit, with only base elements, and compare.

author: PKTKS
author_rank: Super Contributor
timestamp: December 09, 2019, 03:38:16 pm
content: Quote from: SiliconWizard on December 09, 2019, 03:10:20 pmDone that several times in the last decade while convertingall my stuff from LTSpice (which I used quite a lot a decade ago)to the new ngspice/spice based syntax.In the process, which took a while, I also tested acrossseveral different systems some single core, some multicoreImportant detail - I ditched MS crappy stuff in the late 90sno longer capable to support their crappy software and practices.So all checks were made from pristine sources compiled withbest tool chain at time. Results are likely:- for single core only their "crafted" models perform faster- for multi core using POSIX pthread based ngspice may be fasterat least equivalent if using base PSPICE modelsA multithreaded ngspice setup will likely bind:Code:(..) others..libfftw3.so.3libgomp.so.1libgcc_s.so.1libpthread.so.0result being totally managed by gomp and pthreadwhich in any *NIX system is quite damn good and superiorthread controlled - only EXCEPTION really is when theircrafted models - which only their version of spice can handleplay a roleAll other cases from 00's to something like 2015 (when Icompleted ditched LTSpice - as all my stuff was converted)were checked under WINE - which indeed is multithreadedvia the same pthread bindings...Final opinion is that LTSpice only matters today **IF**:- you really need their stuff -- models and crafted version ofa particular class -e.g. their products- you really need or want or like their netlist "CAPTURE" interfaceOtherwise today KiCAD can CAPTURE your netlistand the multi threaded bindings of ngspice will doa much similar or sometimes better result..You see.. you have a "FAST" and an ACCURATE choicein SPICE using method=gear or method=trap whichindeed produce far different results (and speeds)A good crafted MODEL will perform just fine and equally fastin your multi threaded (gomp/pthreaded) binary as it willin the modified LTSpice version of spice if using plain modelsAssuming your simul will converge. Which in some casestheir modified version also performs different - impossible to say"how" but sometimes while one method converges others failFinal details which do matter as well are SPICE options forconvergence like: reltol abstol vntol ramptime accuratethey all produce quite different results - not available in LTSpicethat simple to programmable chekcs...Paul