Load a input file in binary format

  • jlu

    jlu - 2014-05-30

    Is it possible to run a file as follows in ngspice?


    .include param.data

    .tran 1ns 10ns uic


    c1 2 3 2p

    ......(other elements in circuits)

    .save v(2) v(3)


    where the param.data file is written in binary form recording the initial state of v(2) and v(3)


  • marcel hendrix

    marcel hendrix - 2014-05-30

    It is not really clear what you want to do. I guess param.data contains
    v(2) and v(3) for time points t1, t2, t3 ... ? (Probably not, as only a single value makes sense here). It is also not clear to me why it should be a binary file. One can always convert to and from text?

    There might be several possibilities. A text file with .ic statements would do it. There is a 'filesource' in XSPICE, but PWL sources might also work. You could build a subcircuit that forces the voltage or charge on the capacitor at any time(s) and then disconnects (using SWs), etc. ...


  • jlu

    jlu - 2014-06-16

    Thanks for your reply.
    The file param.data contains only the initial value for v(2) and v(3). The voltage is calculated from the electrical fields of my electroamagnetic code. The result (the current going through the source) will be loaded back to excite the magnetic fields. Therefore, I want the inputs and outputs in binary form, and without any conversion errors.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks