Menu

#19 "MHz" settings for start and stop frequencies in AC analysis are incorrect?

v1.1
closed-fixed
Mike W.
None
5
2015-01-18
2015-01-15
Fred
No

Hi,

I have built rev 216 and tried it out. Everything seems to be working except for setting the start and stop frequencies in the AC analysis to MHz. When I do this, the frequencies are set to xx.xxe-3 instead of xx.xxe+6. Switching to KHz produces the correct values. I am using ngspice26 for analysis.

Cheers,

Fred

Discussion

  • Mike W.

    Mike W. - 2015-01-17

    I've made significant changes to the PnlValue class and the classes it uses. This is caused by one of these mods. and is now fixed.

    The code is in serious flux at present. From now on I'll add a comment to each release indicating how ropey I think it is.

     
  • Mike W.

    Mike W. - 2015-01-17
    • status: open --> closed-fixed
    • assigned_to: Mike W.
     
  • Fred

    Fred - 2015-01-17

    Mike,

    Just built r217. Here is the console output with frequency start and stop set to MHz:


    AC Analysis Sat Jan 17 08:59:28 2015

    Index frequency vdb(output) vp(output)

    0 8.900000e-03 -1.99372e+02 1.570795e+00
    1 8.900020e-03 -1.99372e+02 1.570795e+00
    2 8.900040e-03 -1.99372e+02 1.570795e+00
    3 8.900060e-03 -1.99372e+02 1.570795e+00
    4 8.900080e-03 -1.99372e+02 1.570795e+00
    5 8.900100e-03 -1.99372e+02 1.570795e+00
    6 8.900120e-03 -1.99372e+02 1.570795e+00
    7 8.900140e-03 -1.99372e+02 1.570795e+00
    8 8.900160e-03 -1.99372e+02 1.570795e+00

    Here is the result for KHz with MHz values adjusted to KHz (ie 1.0 MHz is 1000 KHz).


    AC Analysis Sat Jan 17 09:02:03 2015

    Index frequency vdb(output) vp(output)

    0 8.900000e+06 3.099830e-02 1.508669e+00
    1 8.900020e+06 3.276346e-02 1.508666e+00
    2 8.900040e+06 3.452898e-02 1.508663e+00
    3 8.900060e+06 3.629486e-02 1.508660e+00
    4 8.900080e+06 3.806109e-02 1.508657e+00
    5 8.900100e+06 3.982767e-02 1.508655e+00
    6 8.900120e+06 4.159461e-02 1.508652e+00
    7 8.900140e+06 4.336191e-02 1.508649e+00
    8 8.900160e+06 4.512956e-02 1.508646e+00

    As you stated in your last post, things are in flux. Just wondering what is up??

    Cheers,

    Fred

     
  • Fred

    Fred - 2015-01-17

    Mike,

    I looked at the simulation circuit and ran it via command line with the same results as in the previous post. After checking the ngspice manual, I changed the following line:

    .AC LIN 10000 8.90M 9.10M

    to

    .AC LIN 10000 8.90MEG 9.10MEG

    with the following output:


    AC Analysis Sat Jan 17 10:26:15 2015

    Index frequency vdb(output) vp(output)

    0 8.900000e+06 3.099830e-02 1.508669e+00
    1 8.900020e+06 3.276346e-02 1.508666e+00
    2 8.900040e+06 3.452898e-02 1.508663e+00
    3 8.900060e+06 3.629486e-02 1.508660e+00
    4 8.900080e+06 3.806109e-02 1.508657e+00
    5 8.900100e+06 3.982767e-02 1.508655e+00
    6 8.900120e+06 4.159461e-02 1.508652e+00
    7 8.900140e+06 4.336191e-02 1.508649e+00
    8 8.900160e+06 4.512956e-02 1.508646e+00

    Hope this helps!

    Cheers,

    Fred

     
  • Mike W.

    Mike W. - 2015-01-18

    I've just tested gSpiceUI and the AC analysis for NG-Spice produces the command .AC LIN 10 1.00k 100.00MEG for a sweep from 1kHz to 100.0MHz.

    Remember to re-create the simulation file don't just press run (simulation).

    Cheers
    Mike

     
  • Fred

    Fred - 2015-01-18

    Hi Mike,

    Thank you for the reply. I have been re-creating the simulation file each time to avoid what you posted just recently about it (simulation). I thought about it for a bit and removed the preferences file in my home directory (~/.gspiceui.conf), re-imported my schematic and re-created the simulation with the following results (copied from gspiceui. Some text removed):


    • Electronic circuit simulation file generated by gSpiceUI *
    • Version 1.0.69 (2015-01-09) *

    (Circuit here) ...

    • NG-Spice Simulation Commands
      .OPTIONS NOPAGE WIDTH=72 UNITS=RADIANS
      .PRINT AC VDB(OUTPUT) VP(OUTPUT)
      .AC DEC 10000 8.90M 9.10M

    .END

    Not sure what the issue is?? If I need to post this elsewhere, let me know. I realize that there are probably many more pertinent issues that you are working on and don't want to detract you from them.

    Thanks Again,

    Fred

     
  • Fred

    Fred - 2015-01-18

    Mike,

    It's working now. Somehow, I had two versions installed. One in /usr and the other in /usr/local. Oops! Sorry for the trouble. I get the following for simulation paramaters now:

    • NG-Spice Simulation Commands
      .OPTIONS NOPAGE WIDTH=72 UNITS=RADIANS
      .PRINT AC VDB(OUTPUT) VP(OUTPUT)
      .AC DEC 10000 8.90Mega 9.10Mega

    .END

    Thank you for your help and my apologies for the trouble. I should have checked my installation.

    Cheers,

    Fred

     

Log in to post a comment.