You need to use EasyEDA editor to create some projects before publishing
Breaking basic rules of mathematics
867 6
Tommy 7 years ago
**BUG** Concise problem statement: Same numbers + same formula = same result This fundamental rule of all mathematics is violated when measuring the average value of a waveform. Where I got as a result 3.468507 A two days ago, I get now 3.492047 A. That's a hell of a lot of a difference. Repeatedly measuring averages with exactly the same parameters in exactly the same schematic brings different results with every new day. There are never two same results. Steps to reproduce bug: 1. Measure averages. 2. Measure again a day later. 3. Results: Expected results: Browser:
Comments
andyfierman 7 years ago
Hi Tommy, Please post a link to a public example that demonstrates this behaviour so I can investigate possible causes. Thanks.
Reply
Tommy 7 years ago
Hi Andy, the schematic is all about the comparison of a **S**erial generator-regulator-battery system in any car/motorbike and my "**P**imped" version. I use a 3-phase-AC source where amplitude is set by parameter a=x.x from 0A to 20A in steps of 0.1A. In the range of 9A to 10A steps are also much smaller. You will find 3 circuits as the feedback processes can't be simulated in just one. Circuit 1 is the unregulated system which is used to control Circuit 2. Circuit 2 is for showing the behaviour when charging current into the battery reaches the limit and already generated current searches another way to ground through load (lights) and rotor. Circuit 3 is for showing the behaviour when voltage D gets >vreg=14V and the regulator starts switching off/on the generator. It took me a painful while to get it all sorted out this way, but now it works perfectly. Apart from the varying results of measuring averages. I use uic to set all node voltages to 0 and exclude this 0 from the averages by measuring from 1us to 1s. You find the results from previous simulations in the frames on the left. They are stored as parameter values for later use when it comes to showing their relation to the rpm of a running motor. In the simulation results appears a strange information line in quantities of 0 to 6: Reference value : 9.50002e-01 The given value varies. This term "Reference value" appears in the ngspice manual only once, on page 245. Chapter 15.3.11 .PSS: Periodic Steady State Analysis (Experimental code, not yet made publicly available!) Do you already use this code somewhere below the surface of EasyEDA ? https://easyeda.com/editor#id=101e3334a2d243479938aca748d5397a Just run the simulation and then zoom in to the range of 465ms to 505ms. There should never be such steps in the avg curves.
Reply
Tommy 7 years ago
Dear Andy, I just repeated yesterdays measuring with parameter a=0.0. In this case only constant currents flow in both versions of the circuit, S and P, from voltage sources (batteries) with identical voltages through an identical network of resistors to ground. Reference value : 9.25320e-01 No. of Data Rows : 1733 **avg**_i_rotor_s = **2.532893e-01** from= 1.000000e-06 to= 1.000000e+00 avg_i_rotor_p = 2.532836e-01 from= 1.000000e-06 to= 1.000000e+00 avg_i_batterie_s = -4.161181e+00 from= 1.000000e-06 to= 1.000000e+00 avg_i_batterie_p = -4.161182e+00 from= 1.000000e-06 to= 1.000000e+00 **max**_i_rotor_s = **2.531472e-01** at= 1.000000e-05 max_i_rotor_p = 2.531374e-01 at= 1.053886e-05 All four avg results are different from those I got yesterday as you can see in the top four frames on the left side of the published copy. And now have a detailled look at the bold printed values above, please. **How can the average value of a constant current ever be greater than the maximum value of this current ?** At least in the real universe this is impossible. I really hope you at EasyEDA get all this fixed or can show me a way to circumvent the problem.
Reply
Tommy 7 years ago
Once again the results of a simulation with parameter a=0.0: Reference value : 8.66320e-01 No. of Data Rows : 1733 avg_i_rotor_s = 2.532893e-01 from= 1.000000e-06 to= 1.000000e+00 avg_i_rotor_p = 2.532836e-01 from= 1.000000e-06 to= 1.000000e+00 avg_i_batterie_s = -4.161181e+00 from= 1.000000e-06 to= 1.000000e+00 avg_i_batterie_p = -4.161182e+00 from= 1.000000e-06 to= 1.000000e+00 max_i_rotor_s = 2.531472e-01 at= 1.000000e-05 max_i_rotor_p = 2.531374e-01 at= 1.053886e-05 What is this "Reference value" ? What software action is hidden behind it ?
Reply
andyfierman 7 years ago
Hi Tommy, Your sim is complex so it is hard to see exactly what is going on. There is something I have noticed that may (or may not!) be contributing to this behaviour. You have several sets of parameters inside green and red boxes. They are all set to be `text type = spice` but there are several parameters that in fact have duplicate definitions. I found this out by trying to run the netlist of your sim in LTspice for a second opinion but it looks like ngspice: 1. does not report this correctly; 2. does not stop the simulation. I suspect that this may be partly what is causing this erratic behaviour. In ngspice (and in LTspice) any parameter can only be defined once. So in you sim you must decide which unique set of parameters you wish to use in the sim and configure that set to `text type = spice`. All other sets of parameters MUST be configured to `text type = comment`, i.e. one and only one unique set of parameters can be configure to be `text type = spice` in a simulation run. It would be really helpful if you could find or create a simplified sim that shows the same behaviour and post that as trying to find other possible causes is very time consuming in your full sim. BTW: EasyEDA uses ngspice as the spice engine so any bugs in that have to be reported to the ngspice bug reports mailing list and not to EasyEDA. That said, once I can get a better idea of what the actual issue is in a simpler example, I can post it to the ngspice community.
Reply
andyfierman 7 years ago
I don't know what the `Reference value` refers to: I will try to find out. :)
Reply
Login or Register to add a comment
goToTop
你现在访问的是EasyEDA海外版,建议访问速度更快的国内版 https://lceda.cn(需要重新注册)
如果需要转移工程请在个人中心 - 工程 - 工程高级设置 - 下载工程,下载后在https://lceda.cn/editor 打开保存即可。
有问题联系QQ 3001956291 不再提醒
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus-@1x -mockplus-

Cookie Notice

Our website uses essential cookies to help us ensure that it is working as expected, and uses optional analytics cookies to offer you a better browsing experience. To find out more, read our Cookie Notice