Basic simulation epic fail - Page 1
Forum section: electronics / projects

author: mcinque
author_rank: Unknown
timestamp: December 24, 2013, 09:58:23 pm
content: Playing with multisim I've noticed a strange behavior on a very, very basic circuit: a push button with a pull down resistor and an electrolytic generates more vcc than provided!? Of course this is not possible with this minimal circuit, so I think I'm missing something about the software or the simulation engine... Could you please suggest me where I'm wrong?

author: free_electron
author_rank: Super Contributor
timestamp: December 24, 2013, 10:02:44 pm
content: two possibilities1) the simulator is faulty2) the simulator is correct : it simulates a Tektronix scope …

author: Jon86
author_rank: Frequent Contributor
timestamp: December 24, 2013, 10:18:13 pm
content: Quote from: mcinque on December 24, 2013, 09:58:23 pmLooks like we've found your problem

author: chrisbrown
author_rank: Contributor
timestamp: December 24, 2013, 10:28:34 pm
content: Add 5 or 10 ohms in series with your switch and see if that improves things. I believe what you see is the effect of parasitic inductances that Multisim (or maybe Spice) inserts behind the scenes.

author: c4757p
author_rank: Super Contributor
timestamp: December 24, 2013, 10:39:36 pm
content: I'm thinking computational errors due to the switch and capacitor. I don't know about Multisim, but LTspice (most SPICE, I'd guess) approximates the switch as a piecewise linear resistance, which is not continuously differentiable. This means that the capacitor current (i = C dv/dt) is undefined at a couple points during switch transit. It seems to discretize this as a three-piece function with intervals equal to the simulation timestep, which means very high dv/dt.

author: calexanian
author_rank: Super Contributor
timestamp: December 24, 2013, 11:44:38 pm
content: Ironically you most likely will see some noise like that. Although that has more to do with the physical implementation of a switch. I would not think the simulation software would do that. Or its just garbage data, or garbage software. Perhaps all of the above.

author: krish2487
author_rank: Frequent Contributor
timestamp: December 25, 2013, 07:15:05 am
content: I think you might want to try connecting the "G" symbol on the scope to your circuit ground. I ve had issues kike this earlier with multisim..Sent from my GT-I9300 using Tapatalk

author: Jon86
author_rank: Frequent Contributor
timestamp: December 25, 2013, 08:04:19 am
content: Quote from: krish2487 on December 25, 2013, 07:15:05 amAh there you go, that's probably what it'll be.I've never understood why anyone would want to use multisim

author: hans
author_rank: Super Contributor
timestamp: December 25, 2013, 09:56:51 am
content: Ditch Multisim.The spice engine is horrible and cannot be taken seriously for anything.For all it knows, a switch is lethal and a high voltage generator is safe.

author: mcinque
author_rank: Unknown
timestamp: December 25, 2013, 10:08:13 am
content: Quote from: chrisbrown on December 24, 2013, 10:28:34 pmThank you, I will try to do that. But I wonder why a software that claims to be a good simulation software does that kind of errors. I'm starting to think it's garbage like others say.Quote from: c4757p on December 24, 2013, 10:39:36 pmThat should be kept in mind by the software, don't you?Quote from: calexanian on December 24, 2013, 11:44:38 pmSo if I read that kind of errors in a death simple circuit, I imagine what kind of garbage I could grab in a complex one.How they can even think to sell that software at 4k$??Quote from: hans on December 25, 2013, 09:56:51 amThank you all for your replies. Could anyone suggest a better engine for simulation?

author: mcinque
author_rank: Unknown
timestamp: December 25, 2013, 10:09:37 am
content: Quote from: krish2487 on December 25, 2013, 07:15:05 amThe same behavior happens with the other multisim DSO with properly grounded G.

author: penfold
author_rank: Frequent Contributor
timestamp: December 25, 2013, 06:39:54 pm
content: I'm not going to attack multisim, I know it has its uses, I don't know what they are,Depending how your system is going to evolve they are ofcourse various options of a better simulator. For top level, purely behavioural stuff and microprocessor things I've used Proteus VSM with some success. For analogue behaviour then LTSpice is good, just very difficult to add any 'user input' during the simulation.

author: Neilm
author_rank: Super Contributor
timestamp: December 25, 2013, 07:06:07 pm
content: Tina is reasonable. It is available for TI. However, due to this tie in, there are a few restrictions. It has been a while since I used it so I'm not too sure what these are now. When I last used, it insisted that an IC had to be present, even if the input was connected to 0V.

author: c4757p
author_rank: Super Contributor
timestamp: December 25, 2013, 07:56:04 pm
content: Quote from: mcinque on December 25, 2013, 10:08:13 amEven the good ones, for the most part, are blindly doing computations. Every component is "ideal", with all the nastiness implied thereby.

author: free_electron
author_rank: Super Contributor
timestamp: December 26, 2013, 04:35:07 am
content: Quote from: c4757p on December 25, 2013, 07:56:04 pmGet Eldo. i can tell from experience that that simulator is 100% accurate. it knowns how real world stuff behaves.

author: jesuscf
author_rank: Frequent Contributor
timestamp: December 31, 2013, 06:19:36 am
content: Quote from: mcinque on December 24, 2013, 09:58:23 pmThis is not a simulator fail. It is a very well known behavior of ANY simulator (SPICE based or otherwise) that uses the trapezoidal integration method. The trapezoidal rule may generate these "spikes" every time the Jacobian matrix of the system is abruptly changed; for example after flipping an ideal switch. That being said, the trapezoidal rule has many advantages: smaller truncation error, zero phase distortion, A-stability, and small number of history terms. For those reasons it is often set as the default in many simulators. If you want a "spike" free simulation use the Backward Differentiation Formulas (BDF) often referred as the Gear Integration methods.To change the integration method in Multisim:Simulate->Interactive Simulation Settings->Use custom settings->Customize->Transientand change the "Integration method" from "Trapezoidal" to "Gear". The default order of the "Gear" method is set to two (max is 6). Gear order two is neither the fastest nor the most accurate, but it is the only one BDF that is A-stable. So you'll playing it safe by leaving the order at two.p.s. A-stable in this context means that you simulation will not get numerically unstable with any eigenvalue with a negative real part.

author: mcinque
author_rank: Unknown
timestamp: December 31, 2013, 07:47:19 am
content: Very interesting, thank you jesusc!