Giter VIP home page Giter VIP logo

spicemill's Introduction

Spice Mill

License: MIT

I'm working on Spice Mill to aid me in circuit analysis. Spice Mill focuses primarily on post processing ASCII raw files generated Ngspice. This is intended for my personal use, but I'm releasing it for anyone who's interested. Keep in mind that everything here is subject to change.

Generating Test Data with Ngspice

Here's a quick example on how to generate test data with Ngspice for use with Spice Mill. First you'll need to define a test circuit. For this example we'll use a sine signal:

$$v_s(t) = A \cdot sin(2\pi ft) + V_0$$

Where the amplitude $A = 2.5 V$, the offset $V_0 = 2.5 V$ and the frequency $f = 1 kHz$. For this example we'll run a transient analysis over the interval $0 \le t \le 10 ms$ with timesteps of $\Delta t = 10 \mu s$. We get the following netlist:

.title Sine Wave
vs vout 0 sin(2.5, 2.5, 1k)
.tran 10u 10m
.end

We save this to a file named test.cir and run the following command to generate the test data:

SPICE_ASCIIRAWFILE=1 ngspice -b -r test.raw test.cir

Ngspice should now write the simulation data to a file named test.raw.

Plotting Simulation Results

To plot the simulation results provided by an ASCII .raw file, run the following command:

python spicemill.py --raw <raw_file>

If no filename was given with the --raw option, it defaults to data.raw.

plot

To plot specific variables, use the --vars option. The variable names (v(vout) and i(vs) for example) should be separated by a semicolon ;.

python spicemill.py --vars "<var_1>;<var_2>;<var_n>"

spicemill's People

Contributors

diordany avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.