Git Product home page Git Product logo

elektrotickle's Introduction

Elektrotickle

Linear circuit simulation in Matlab

This program calculates the transfer functions and noise of linear circuits composed of passive components and opamps. It is essentially a re-implementation in MATLAB of the circuit simulation portions of LISO.

Motivations:

  • Learn how LISO works
  • Simulate circuits in a 100% pure Matlab environment without the need to call an external executable
  • Embed the simulation in a higher-level numerical computing environment with scripting, plotting, and optimization routines.
  • Idea for future: Can we also use the symbolic computing toolbox to get symbolic transfer functions for simple circuits?

Features that currently work:

  • Parses LISO input file
  • Parses LISO opamp library
  • Currently understands resistors, capacitors, and opamps.
  • Produces resulting transfer functions and noises, agrees with LISO for test cases applied so far.

Not yet implemented:

  • Only does voltage-to-voltage transfer functions (no 'current' inputs or outputs)
  • None of LISO's other fancy features (fitting, etc)

elektrotickle's People

Contributors

tobin avatar

Stargazers

 avatar Jeff Trull avatar Sean Leavey avatar  avatar Nic Smith avatar

Watchers

Nic Smith avatar  avatar James Cloos avatar Sean Leavey avatar

Forkers

robinfit01

elektrotickle's Issues

Accept commands in uppercase as LISO does

This little patch fixes it for me:

diff --git a/load_liso.m b/load_liso.m
index b323f69..71420fa 100644
--- a/load_liso.m
+++ b/load_liso.m
@@ -36,7 +36,7 @@ while true
     args = regexp(s, '\s+', 'split');


-    switch args{1}
+    switch lower(args{1})
         case 'r'     % r name value node1 node2 (resistor)
             name = args{2};
             value = circuit.parse_value(args{3});
@@ -80,7 +80,7 @@ while true
             startfreq = circuit.parse_value(args{3});
             stopfreq = circuit.parse_value(args{4});
             steps = circuit.parse_value(args{5});
-            switch args{2}
+            switch lower(args{2})
                 case 'lin'
                     f = linspace(startfreq, stopfreq, steps);
                 case 'log'

disagreement with LISO

Here's a little test case where Elektrotickle seems not to reproduce LISO's output. Am I doing something wrong?

------- test.fil --------
op u1 ad829 u1plus u1minus u1out
r r1 120 u1minus gnd
r r2 2.2k u1minus u1out
r r3 50 u1out gnd
uinput u1plus 0
uoutput u1out:db:deg
freq log 1e2 10e6 1000
------- cut here -------

------- opamp.lib -------
name = ad829 # fast lownoise voltage-feedback, No ext. comp., measured at gain 1
a0 = 1e5 # 100V/mV
gbw = 85M
un = 1.7e-9
uc = 30 
in = 1.5e-12
ic = 100 # not given in datasheet
umax=12
imax=0.05
sr=260e6
zero = 19.3M # fitted from measurement
pole = 53.4M 5.1 # fitted from measurement
zero = 76.5M 4.7 # fitted from measurement
pole = 13M # fitted from measurement
delay = 1.9n # fitted from measurement
------- cut here -------

------- Elektrotickle input -------
>> test=load_liso(load_opamps('opamp.lib'), 'test.fil');
>> [f, sigAC, noiseAC] = test.tickle();
>> semilogx(f, db(sigAC(test.getVariableIndex('node', 'u1out'), :)))
------- cut here -------

LISO says:
liso

Elektrotickle says:
elektro

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.