Author Topic: Basic simulation epic fail  (Read 7747 times)

0 Members and 1 Guest are viewing this topic.

Offline mcinqueTopic starter

  • Supporter
  • ****
  • Posts: 1129
  • Country: it
  • I know that I know nothing
Basic simulation epic fail
« on: December 24, 2013, 09:58:23 pm »
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?

 

Online free_electron

  • Super Contributor
  • ***
  • Posts: 8520
  • Country: us
    • SiliconValleyGarage
Re: Basic simulation epic fail
« Reply #1 on: December 24, 2013, 10:02:44 pm »
two possibilities

1) the simulator is faulty
2) the simulator is correct : it simulates a Tektronix scope …   :-DD

Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline Jon86

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: Basic simulation epic fail
« Reply #2 on: December 24, 2013, 10:18:13 pm »
Playing with multisim

Looks like we've found your problem  :-+
Death, taxes and diode losses.
 

Offline chrisbrown

  • Contributor
  • Posts: 38
Re: Basic simulation epic fail
« Reply #3 on: December 24, 2013, 10:28:34 pm »
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.
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Basic simulation epic fail
« Reply #4 on: December 24, 2013, 10:39:36 pm »
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.
« Last Edit: December 24, 2013, 10:43:16 pm by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline calexanian

  • Super Contributor
  • ***
  • Posts: 1881
  • Country: us
    • Alex-Tronix
Re: Basic simulation epic fail
« Reply #5 on: December 24, 2013, 11:44:38 pm »
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. 
Charles Alexanian
Alex-Tronix Control Systems
 

Offline krish2487

  • Frequent Contributor
  • **
  • Posts: 508
  • Country: dk
Re: Basic simulation epic fail
« Reply #6 on: December 25, 2013, 07:15:05 am »
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

If god made us in his image,
and we are this stupid
then....
 

Offline Jon86

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: Basic simulation epic fail
« Reply #7 on: December 25, 2013, 08:04:19 am »
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

Ah there you go, that's probably what it'll be.
I've never understood why anyone would want to use multisim  |O
Death, taxes and diode losses.
 

Offline hans

  • Super Contributor
  • ***
  • Posts: 1660
  • Country: nl
Re: Basic simulation epic fail
« Reply #8 on: December 25, 2013, 09:56:51 am »
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.
 

Offline mcinqueTopic starter

  • Supporter
  • ****
  • Posts: 1129
  • Country: it
  • I know that I know nothing
Re: Basic simulation epic fail
« Reply #9 on: December 25, 2013, 10:08:13 am »
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.
Thank 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.

I'm thinking computational errors due to the switch and capacitor.
That should be kept in mind by the software, don't you?

Or its just garbage data, or garbage software. Perhaps all of the above.
So 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$??

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.
;D

Thank you all for your replies. Could anyone suggest a better engine for simulation?
 

Offline mcinqueTopic starter

  • Supporter
  • ****
  • Posts: 1129
  • Country: it
  • I know that I know nothing
Re: Basic simulation epic fail
« Reply #10 on: December 25, 2013, 10:09:37 am »
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

The same behavior happens with the other multisim DSO with properly grounded G.  :-//
 

Offline penfold

  • Frequent Contributor
  • **
  • Posts: 675
  • Country: gb
Re: Basic simulation epic fail
« Reply #11 on: December 25, 2013, 06:39:54 pm »
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.
 

Offline Neilm

  • Super Contributor
  • ***
  • Posts: 1551
  • Country: gb
Re: Basic simulation epic fail
« Reply #12 on: December 25, 2013, 07:06:07 pm »
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.
Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe. - Albert Einstein
Tesla referral code https://ts.la/neil53539
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Basic simulation epic fail
« Reply #13 on: December 25, 2013, 07:56:04 pm »
I'm thinking computational errors due to the switch and capacitor.
That should be kept in mind by the software, don't you?

Even the good ones, for the most part, are blindly doing computations. Every component is "ideal", with all the nastiness implied thereby.
No longer active here - try the IRC channel if you just can't be without me :)
 

Online free_electron

  • Super Contributor
  • ***
  • Posts: 8520
  • Country: us
    • SiliconValleyGarage
Re: Basic simulation epic fail
« Reply #14 on: December 26, 2013, 04:35:07 am »
I'm thinking computational errors due to the switch and capacitor.
That should be kept in mind by the software, don't you?

Even the good ones, for the most part, are blindly doing computations. Every component is "ideal", with all the nastiness implied thereby.
Get Eldo. i can tell from experience that that simulator is 100% accurate. it knowns how real world stuff behaves.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline jesuscf

  • Frequent Contributor
  • **
  • Posts: 503
  • Country: ca
Re: Basic simulation epic fail
« Reply #15 on: December 31, 2013, 06:19:36 am »
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?

This 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->Transient

and 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.
Homer: Kids, there's three ways to do things; the right way, the wrong way and the Max Power way!
Bart: Isn't that the wrong way?
Homer: Yeah, but faster!
 

Offline mcinqueTopic starter

  • Supporter
  • ****
  • Posts: 1129
  • Country: it
  • I know that I know nothing
Re: Basic simulation epic fail
« Reply #16 on: December 31, 2013, 07:47:19 am »
Very interesting, thank you jesusc!  :-+
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf