SlideShare a Scribd company logo
1 of 35
Download to read offline
Circuit Simulation using Python
Fabrice Salvaire
PyParis 2017
R2
150
Q13
2N4236
Q14
2N4239
R1
20 K
i1
+
V1
−
R3
150
−
+
A1
Nexus
SQ-10A
R14
19 K
R13
91 K
R6
15 K −
+
A2
Nexus
SQ-10A
Q3
2N5464
Q4
2N4239
D4
OMC-V
D3
Q1
2N3819
Q2
2N4236
D1
D2
OMC-V
Q7
2N5464
Q8
2N4239
Q5
2N3819
Q6
2N4236
R11
20
D5
1N4729 C4
0.68 µF
C3
0.68 µF
C2
0.1 µF
R5
100 K
C1
1 µF
R9
910
R10
910
R4
100 K
Q11
2N5464
Q10
2N4239
− ECC
D6
1N4728
Q12
2N3819
Q9
2N4236
+ ECC
R12
20
i2
+
V2
−
R15
200
F. Salvaire 1 / 35
http://pyparis.org
https://www.fabrice-salvaire.fr/en/about/contact
https://github.com/FabriceSalvaire/pyparis-2017
CC BY-NC-SA 3.0
https://pyspice.fabrice-salvaire.fr/pyparis-2017-talk.pdf
Outline
1 Why Python is the right language for engineering ?
2 An Introduction to Circuit Simulation
3 SPICE an Industrial Standard
4 PySpice the Bridge between SPICE and Python
5 Modelica a Language for Simulation
F. Salvaire 2 / 35
Let do engineering . . .
As computers cannot boot without an Office Pack
Students and later engineers know
You can do everything with it at work
from R&D to communication, database, accounting, . . .
You will Excel !!!
F. Salvaire 3 / 35
Mouse Algorithm
How to compute the derivative of a data set ?
1 copy the data of the first column
2 past to the second column starting from the second line
3 enter the formulae (A − B)/dt in the third column
Easy and Efficient ! Isn’t it ?
Next exercise compute an histogram . . .
Python answer if you are lazy
for value in values:
hist[int(value // bin_size)] += 1
F. Salvaire 4 / 35
A cabinetworker as a lot of tools : one for each task !
F. Salvaire 5 / 35
Open Source Community has also a lot of tools !
Of course if you have to build this
You need the right tools
You have to look for solutions
And evaluate if it makes the job
But for teaching, learning or DIY
You can find what you are looking for
And maybe discover alternatives
Like to simulate electronic circuit
or even complex systems
You can get it
even if you live in a ghetto
It’s free and open !
F. Salvaire 6 / 35
Simulation Workflow
Steer Process Analyse
−→ −→
F. Salvaire 7 / 35
Thanks to Guido van Rossum, We have Python !
• Indentation is syntax ! So clever !
Look at PhD student C++ code
• Canonical Syntax
• High Level Language
• Object Oriented
• Transparent memory management
• Easy to bind with C or Fortran
• An incredible Scientific Environment
F. Salvaire 8 / 35
Simulation Workflow with Python
Steer Process Analyse
−→ −→
• JSON
• YAML
• Python itself !
• XML
• h5py : HDF5
• subprocess
• CFFI
• SWIG
• Numpy
• SciPy
• Matplotlib
• IPython
We have more than we can buy learn !
F. Salvaire 9 / 35
Circuit Simulation : Nodal Analysis
Circuit ≡ Device’s Graph
i1
i4
i2
i7
i3
i5 i6
i8 i9
Roughly . . .
1 Apply Kirchhoff’s circuit laws
• Current Law
Ik = 0 for each node
conservation of the electron flow
• Voltage Law
Vk = 0 for each cycle
think that is a closed path
2 Apply Device Equation f(Vk, Ik) = 0
e.g. Ohm Law for resistor V = RI
Can be Complex e.g. Capacitor, Inductor
and Non-Linear e.g. Diode !
F. Salvaire 10 / 35
Circuit Simulation : Nodal Analysis Example
Is1
1
R1
0
R2
2
R3
−+
Vs1
Let apply the recipes



1
R1
+ 1
R2
− 1
R2
1
− 1
R2
1
R2
+ 1
R3
−1
1 −1 0






V1
V2
IVs1


 =



Is1
0
Vs1



Then solve this System of Linear Equations
There are algorithms to build theses matrices
Usually matrices are sparses
Complex therms for Capacitor, Inductor e.g. V = 1
sC I
Non linear e.g. Shockley Diode Model I = Is e
V
nVT − 1
To go further QUCS Technical Papers or PDF
F. Salvaire 11 / 35
Circuit Simulation : Several kinds of analyses
Principal Analyses
• DC Analysis
Operating Point and DC Sweep
Compute node’s voltages at t = 0 cf. infra
• AC Small-Signal Analysis
Transfer Function
Frequency Analysis V (ω), cf. Laplace Transform
small means Taylor Series
• Transient Analysis
Simulate over time V (t)
Integrator
More specific ones
• Pole-Zero Analysis
• Small-Signal Distortion Analysis
• Sensitivity Analysis
• Noise Analysis
• etc.
F. Salvaire 12 / 35
To go further Ngspice Documentation
SPICE : Simulation Program with Integrated Circuit Emphasis
• Developed by Dr. Laurence Nagel in 1973 at Berkeley
• First software to combine
DC, AC and transient analog circuit analysis capabilities
• An early open source software initiative (Public Domain)
• Used in undergraduate courses
• Evolved to a worldwide standard
• IEEE Milestone on 2011
• Berkeley released spice3f5 at last on 1993
• Superseded by commercial and open source forks
To go further SPICE2 : A Computer Program to Simulate Semiconductor Circuits ; Nagel, Laurence W. ; 1975
The Origins of SPICE by Nagel
F. Salvaire 13 / 35
SPICE : Netlist as Input
0
Vin
1
C1
2
R2
R1
6
Q1
3
RE
4
C2
5
RL
RC
−
+
Vpwr
AC-coupled amplifier
Vpwr 6 0 DC 15V
Vin 1 0 AC 1V SIN(0V .5V 1KHz)
C1 1 2 10u
R1 6 2 100k
R2 2 0 20k
RC 6 4 10k
Q1 4 2 3 bjt
RE 3 0 2k
C2 4 5 10u
RL 5 0 1Meg
.model bjt npn(bf=80 cjc=5p rb=100)
.ac dec 5 10m 1G
*.tran .02ms 2ms 0 .01ms
.control
run
plot V(1) V(5)
.end
F. Salvaire 14 / 35
SPICE : A Worldwide Standard for integrated circuit simulation
Device manufacturers use SPICE language to provide models as sub-circuit
1N5913B - 1N5957B SILICON ZENER DIODES
VZ : 3.3 - 240 Volts
PD : 3 Watts
FEATURES :
* Complete Voltage Range 3.3 to 200 Volts
* High peak reverse power dissipation
* High reliability
* Low leakage current
* Pb / RoHS Free
MECHANICAL DATA
* Case : DO-41 Molded plastic
* Epoxy : UL94V-O rate flame retardant
* Lead : Axial lead solderable per MIL-STD-202,
method 208 guaranteed
* Polarity : Color band denotes cathode end
* Mounting position : Any
* Weight : 0.335 gram
MAXIMUM RATINGS
Rating at 25°C ambient temperature unless otherwise specified
Rating Symbol Value Unit
Maximum Steady state Power Dissipation 3.0 W
@ TL = 75 ºC, Lead Length = 3/8"
Derate above 75 ºC
Steady State Power Dissipation 1.0 W
@ TL = 50 ºC, Lead Length = 3/8"
Derate above 50 ºC
Operating and Storage Temperature Range TJ,TSTG - 65 to + 200 °C
Page 1 of 4 Rev. 07 : June 7, 2006
6.67 mW/ºC
PD
PD
24 mW/ºC
DO - 41
Dimensions in inches and ( millimeters )
1.00 (25.4)
MIN.
0.108 (2.74)
0.079 (1.99)
0.205 (5.20)
0.161 (4.10)
1.00 (25.4)
MIN.0.034 (0.86)
0.028 (0.71)
Certificate TH97/10561QM Certificate TW00/17276EM
* http://www.onsemi.com/pub_link/Collateral/1N5919BRL.SP3
.SUBCKT d1n5919brl 2 1
**************************************
* Model Generated by MODPEX *
*Copyright(c) Symmetry Design Systems*
* All Rights Reserved *
* UNPUBLISHED LICENSED SOFTWARE *
* Contains Proprietary Information *
* Which is The Property of *
* SYMMETRY OR ITS LICENSORS *
* Modeling services provided by *
* Interface Technologies www.i-t.com *
**************************************
* Model generated on Jun 22, 2004
* MODEL FORMAT: SPICE3
* anode cathode
*node: 2 1
* Forward Section
D1 2 1 MD1
.MODEL MD1 D IS=1.33275e-21 N=1 XTI=1 RS=0.1
+ CJO=1e-11 TT=1e-08
* Leakage Current
R 1 2 600000 MDR
.MODEL MDR R TC1=0 TC2=0
* Breakdown
RZ 2 3 0.520393
IZG 4 3 0.3204
R4 4 3 100
D3 3 4 MD3
.MODEL MD3 D IS=2.5e-12 N=2.40102 XTI=0 EG=0.1
D2 5 4 MD2
.MODEL MD2 D IS=2.5e-12 N=3.19856 XTI=0 EG=0.1
EV1 1 5 6 0 1
IBV 0 6 0.001
RBV 6 0 5153.19 MDRBV
.MODEL MDRBV R TC1=1.79e-08
*-- SPICE3 DIODE MODEL DEFAULT PARAMETER
* VALUES ARE ASSUMED
*IS=1E-14 RS=0 N=1 TT=0 CJO=0
*VJ=1 M=0.5 EG=1.11 XTI=3 FC=0.5
*KF=0 AF=1 BV=inf IBV=1e-3 TNOM=27
.ENDS d1n5919brl
F. Salvaire 15 / 35
SPICE Open Source Clones : Many initiatives . . . !
1 Berkeley spice3f5 1993
• A Research Project
• Was not developed with industrial concerns
2 Ngspice : New Generation Spice 1999
• Fork of Berkeley spice3f5
• Features mixed-level and mixed-signal simulation
XSpice (mixed signal), Cider1b1 and GENIUS TCAD (mixed level)
• Still maintained (?) but not actively ! last release Jan. 2014
3 GnuCap : GNU Circuit Analysis Package 1993
• Attempt to rewrite SPICE from scratch by Albert Davis
• Davis’s Thesis "Implicit Mixed-Mode Simulation of VLSI Circuits"
• No longer maintained since 2006 2013 ?
4 QUCS : Quite Universal Circuit Simulator 2003
5 Akhab 2006
Open Source means Free Software, GPL . . .
F. Salvaire 16 / 35
QUCS : When Open Source fails !
QUCS : Quite Universal Circuit Simulator
• Founded by Michael Margraf in 2003 (?)
• Complete Toolchain
Schematic Editor, Simulation and Plot
• IDE based on Qt3
• Interesting simulation features
• Margraf moved later to proprietary software ???
• Slowly maintained
port to Qt4 is ongoing since . . . many years
F. Salvaire 17 / 35
QUCS : What is wrong ?
To develop an electronic CAD software,
we need these skills
• Circuit Simulation
• Solid State Device Modelling
• State of Art Numerical Analysis
• Software Architecture, Core Design
• GUI Design
• XML Format Design
• Schematic Editor Design
• Plot Library
• . . .
Later, we have to maintain
• A very large code base
• A GUI Qt3 → Qt4 → Qt5 → . . .
Don’t do that until you have a zillion $
(industrial market)
Develop Software Components !
And plug them together
F. Salvaire 18 / 35
LtSpice : Well known free but proprietary clone
Just a (quite old) marketing tool of Linear Technology (device manufacturer)
F. Salvaire 19 / 35
PySpice : The Bridge between SPICE and Python
How it is born ?
• Come back to electronic learning
• Use the most maintained SPICE flavour : NgSpice
• But analysis tools are outdated : e.g. TCL Spice
• I want Python !!!
=⇒ Plug NgSpice to Python
How to get it ?
• https://pyspice.fabrice-salvaire.fr
• https://github.com/FabriceSalvaire/PySpice
• Available on PyPi
• Licensed under GPLv3
F. Salvaire 20 / 35
PySpice : Workflow
Python Netlist NgSpice Python Analysis
1 Define circuit in Python
Cin 1 2 470n −→ circuit.C(’in’, 1, 2, nano(470))
or include netlist as is
2 Define simulation parameters
3 Generate netlist code
4 Execute NgSpice (server mode)
5 Get output as Numpy array
6 Analyse, plot . . .
Why Python Netlist ?
• More verbose, But
• Can use Python to configure netlist
example
• keyword argument
resistance=kilo(100)
• cf. Modelica see later
F. Salvaire 21 / 35
PySpice : I hate Netlist, I want a Schematic Editor !!!
No Problem, Use KiCad !
• Implement a minimal Netlist parser
• But a full parser would be difficult to implement
NgSpice syntax is very complex
due to many extensions
• Tips : Use subcircuit to hide complexity
Leading Open Source
Electronics Design Automation Suite
CERN is a contributor
KiCad example
F. Salvaire 22 / 35
PySpice : NgSpice as a Shared Library
• NgSpice can be used as a shared library instead of an executable
• Not a big improvement, But
• We can use the NgSpice Shared API
• To define external independent voltage/current sources (Input)
• To get the simulation output at each step (Output)
Python / C NgSpice
sources
output
We can thus extend NgSpice easily with C or Python code
• API also features a step by step simulation mode
• PySpice as a CFFI Binding
NgSpice API example
F. Salvaire 23 / 35
PySpice : Some features
Implemented
• Devices handled by a powerfull
meta-class mechanism
• Units
• Netlist Library Manager
• Oriented Object API for Netlist
• Oriented Object API for Waveforms
• Current Probe
• Bode diagrams
Must to have
• More examples
• Improved API
• more Analysis Tools
• Additional Plots e.g. eye-diagram etc.
• Full featured shared API example
• KiCad integration ?
F. Salvaire 24 / 35
PySpice : Example’s Documentation Generator
PySpice has some learning materials
• Kind of Jupyter Notebook . . .
but for peoples that want a True Editor
• reStrucuredText and Sphinx
• Circuit_macros for diagrams
• Concept : Use directive comments
to add text and figure blocks
However Notebook could be an option as well
# A source code comment
#?# A comment that must not appear in the documentation
#!# ==========================
#!# A Restructuredtext Title
#!# ==========================
python code ...
#!#
#!# Some reStructuredText contents
#!#
python code ...
# Insert the output of the following python code
python code ...
#o#
# Add the file content as literal block
#itxt# kicad-pyspice-example/kicad-pyspice-example.cir
# Add a Python file as a literal block
#i# RingModulator.py
# Insert an image
#lfig# kicad-pyspice-example/kicad-pyspice-example.sch.svg
# Insert Circuit_macros diagram
#cm# circuit.m4
# Insert a Matplotlib figure
#fig# save_figure(figure, ’my-figure.png’)
F. Salvaire 25 / 35
Diagrams with Circuit_macros . . . or Algorithms versus GUI
.PS
cct_init
elen = 0.75
epsilon = 1e-3
G: ground; dot; "0" rjust
source(up_ elen, AC); llabel(,V_in,); dot; "in" rjust
capacitor(right_ elen); llabel(,C_1,); dot; "2" rjust above
{ resistor(down_ to (Here,G)); rlabel(,R_2) }
{ R1: resistor(up_ elen_*1.5); llabel(,R_1); dot; "5" above }
line right_ elen_/2; up_
Q1: bi_tr(,,,E) with .B at Here; llabel(,,Q_1)
Q1E: Q1.E - (0,elen_/8)
line down from Q1.E to Q1E; dot; "3" ljust
resistor(down_ to (Q1.E,G)); rlabel(,R_E)
Q1C: Q1.C + (0,elen_/8)
dot(at Q1C); "4" ljust above
capacitor(right_ elen from Q1C); llabel(,C_2)
dot; "out" ljust
resistor(down_ to (Here,G)); rlabel(,R_L)
line down epsilon then to G
resistor(up_ from Q1.C to (Q1.C,R1.end)); llabel(,R_C)
line up epsilon then left to (G,R1.end) then down epsilon
reversed(‘source’, down_ elen, V); llabel(,V_pwr,)
ground
.PE
Also circuitikz
With M4 macros inside !
m4 → dpic → tikz → LATEX
0
Vin
1
C1
2
R2
R1
6
Q1
3
RE
4
C2
5
RL
RC
−
+
Vpwr
F. Salvaire 26 / 35
Related Project : Akhab pronounced "uh, cab"
• Goal : Implement a SPICE- like in Python
using Numpy, SciPy, and SymPy
• Started by Giuseppe Venturini in 2006
† sadly deceased at the end of 2015 †
• https://ahkab.github.io/ahkab
• v0.18 released on July 2015
• Interesting initiative to learn circuit simulation
F. Salvaire 27 / 35
Modelica : A Language for Modelling of Complex Physical Systems
Modelica in few words
• Language + Standard Library
• Object-Oriented and Equation based
• Multi-domains Modelling
• Non-proprietary
• Developed by the non-profit Modelica Association
• initiated in September 1996 by Hilding Elmqvist
• First version on Sept. 1997 → 3.4 on April 2017
• Commercial front-ends : e.g. Dymola
• Open Source front-ends : OpenModelica and JModelica
To go further https://www.modelica.org
Introduction to Object-Oriented Modeling and Simulation with OpenModelica - Peter Fritzson
F. Salvaire 28 / 35
Modelica : Bouncing-ball Example
model BouncingBall
parameter Real e=0.7 "coefficient of restitution";
parameter Real g=9.81 "gravity acceleration";
Real h(start=1) "height of ball";
Real v "velocity of ball";
Boolean flying(start=true) "true, if ball is flying";
Boolean impact;
Real v_new;
equation
impact = h <= 0;
der(v) = if flying then -g else 0;
der(h) = v;
// Triggered when one of theses conditions are true
when {h <= 0 and v <= 0, impact} then
v_new = if edge(impact) then -e*pre(v) else 0;
flying = v_new > 0;
reinit(v, v_new);
end when;
end BouncingBall;
Netwton’s Law
dh
dt
= v
dv
dt
=
d2
h
dt2
= −g
At impact, lost some energy
v = −ev
and go upwards
F. Salvaire 29 / 35
Modelica : Circuit with Annotations (Schema)
model SimpleRectifierWithTransformer
Modelica.Electrical.Analog.Sources.SineVoltage ac_line(V = 230, freqHz = 50);
Modelica.Electrical.Analog.Basic.Capacitor capacitor(C = 0.00005);
Modelica.Electrical.Analog.Basic.Ground ground;
Modelica.Electrical.Analog.Ideal.IdealDiode diode(Vknee = 0.5);
Modelica.Electrical.Analog.Basic.Resistor load_resistor(R = 1000.0);
Modelica.Electrical.Analog.Ideal.IdealTransformer transformer(n = 10, Lm1 = 1);
Modelica.Electrical.Analog.Sources.SineVoltage sinevoltage1
annotation(Placement(visible = true, transformation(origin = -78.7769,-10.3538, extent = -10,-10,10,10, rotation = -90)));
Modelica.Electrical.Analog.Basic.Transformer transformer1 annotation(...);
Modelica.Electrical.Analog.Semiconductors.Diode diode1 annotation(...);
Modelica.Electrical.Analog.Basic.Resistor resistor1 annotation(...);
Modelica.Electrical.Analog.Basic.Capacitor capacitor1 annotation(...);
Modelica.Electrical.Analog.Basic.Ground ground1 annotation(...);
equation
connect(resistor1.n, ground1.p)
annotation(Line(points = 22.286, -18.6196, 22.286, -25.0637, 22.5062, -25.0637, 22.5062, -25.0637));
connect(capacitor1.n, transformer1.n2) annotation(...);
connect(resistor1.n, capacitor1.n) annotation(...);
connect(capacitor1.p, resistor1.p) annotation(...);
connect(diode1.n, capacitor1.p) annotation(...);
connect(transformer1.p2, diode1.p) annotation(...);
connect(sinevoltage1.n, transformer1.n1) annotation(...);
connect(sinevoltage1.p, transformer1.p1) annotation(...);
connect(ac_line.p, transformer.p1);
connect(ac_line.n, transformer.n1);
connect(ac_line.n, ground.p);
connect(transformer.p2, diode.p);
connect(transformer.n2, ground.p);
connect(diode.n, capacitor.p);
connect(diode.n, load_resistor.p);
connect(capacitor.n, ground.p);
connect(load_resistor.n, ground.p);
annotation(Diagram(coordinateSystem(extent = -100, -100, 100, 100, preserveAspectRatio = true, initialScale = 0.1, grid = 2, 2)));
end SimpleRectifierWithTransformer;
To go further SPICE3 Modelica Library
F. Salvaire 30 / 35
1 Define devices
2 connect(resistor1.n, ground1.p)
! Modelica performs Transient Analysis
Modelica : Open Source Front-Ends
1 OpenModelica https://www.openmodelica.org
• Supported by a non-profit organization : Open Source Modelica Consortium (OSMC)
• OSMC Public License ≈ GPLv3
• Provide an IDE : OMEdit
• Based on C++ and Corba
• V1.12 released on May 2017
• Packages available on some Linux Distributions
2 JModelica http://jmodelica.org
• Started at Department of Automatic Control, Lund University
• Supported by Modelon AB
• GPLv3
• Based on C, Java and Python
• V2.0 released on May 2017
! Packages are welcome since compilation can be tricky . . .
F. Salvaire 31 / 35
OpenModelica : OMEdit Screenshots
F. Salvaire 32 / 35
Using OpenModelica with Python
from OMPython import ModelicaSystem
mod = ModelicaSystem(’bouncing-ball.mo’,
’BouncingBall’)
mod.setSimulationOptions(stopTime=3)
mod.simulate()
mod.getSolutions()
t = mod.getSolutions(’time’)
h = mod.getSolutions(’h’)
import pylab
pylab.grid()
pylab.plot(t, h)
pylab.xlabel(’time [s]’)
pylab.ylabel(’[height]’) 0.0 0.5 1.0 1.5 2.0 2.5 3.0
time [s]
0.2
0.0
0.2
0.4
0.6
0.8
1.0
[height]
Model is compiled to C
F. Salvaire 33 / 35
To go further OpenModelica Python Interface
Jmodelica doc
PyCpuSimulator : Simulate CPU using micro-code
https://github.com/FabriceSalvaire/PyCpuSimulator
CPU Datasheet
Extractor
YAML
Instruction Set
Micro-Code
Interpreter
Features
• Micro-Code Language to describe instruction
• Opcode Decoder using Decision Tree
• Read HEX firmware format
• AVR Core CPU simulation is ongoing
If you want to play with Core . . .
F. Salvaire 34 / 35
Conclusion
Target : Learning, DIY, Hackerspace Courses . . .
I need your help
• To add examples
• To comment, fill issues
Why it is hard to promote ?
• User are not computer scientist
• Many use Windows : installation issue
• Very limited interest for Industry
F. Salvaire 35 / 35

More Related Content

What's hot

Mosfet Operation and Charecteristics.
Mosfet Operation and Charecteristics.Mosfet Operation and Charecteristics.
Mosfet Operation and Charecteristics.Rafsan Rafin Khan
 
Analysis of CE Amplifier
Analysis of CE AmplifierAnalysis of CE Amplifier
Analysis of CE AmplifierYong Heui Cho
 
Low Pass Filter - Classification
Low Pass Filter - ClassificationLow Pass Filter - Classification
Low Pass Filter - ClassificationAtharva Karnik
 
CMOS Operational Amplifier Design
CMOS Operational Amplifier DesignCMOS Operational Amplifier Design
CMOS Operational Amplifier DesignRashad Alsaffar
 
BUilt-In-Self-Test for VLSI Design
BUilt-In-Self-Test for VLSI DesignBUilt-In-Self-Test for VLSI Design
BUilt-In-Self-Test for VLSI DesignUsha Mehta
 
Sigma-Delta Analog to Digital Converters
Sigma-Delta Analog to Digital ConvertersSigma-Delta Analog to Digital Converters
Sigma-Delta Analog to Digital ConvertersSatish Patil
 
Automatic Test Pattern Generation (Testing of VLSI Design)
Automatic Test Pattern Generation (Testing of VLSI Design)Automatic Test Pattern Generation (Testing of VLSI Design)
Automatic Test Pattern Generation (Testing of VLSI Design)Usha Mehta
 
IC Design of Power Management Circuits (II)
IC Design of Power Management Circuits (II)IC Design of Power Management Circuits (II)
IC Design of Power Management Circuits (II)Claudia Sin
 
MOS-Nonideal charecteristics
MOS-Nonideal charecteristicsMOS-Nonideal charecteristics
MOS-Nonideal charecteristicsShanmuga Raju
 
Switched capacitor
Switched capacitorSwitched capacitor
Switched capacitorGur Kan
 
Study of inter and intra chip variations
Study of inter and intra chip variationsStudy of inter and intra chip variations
Study of inter and intra chip variationsRajesh M
 
Low power vlsi design ppt
Low power vlsi design pptLow power vlsi design ppt
Low power vlsi design pptAnil Yadav
 
Design for testability and automatic test pattern generation
Design for testability and automatic test pattern generationDesign for testability and automatic test pattern generation
Design for testability and automatic test pattern generationDilip Mathuria
 

What's hot (20)

Mosfet Operation and Charecteristics.
Mosfet Operation and Charecteristics.Mosfet Operation and Charecteristics.
Mosfet Operation and Charecteristics.
 
Analysis of CE Amplifier
Analysis of CE AmplifierAnalysis of CE Amplifier
Analysis of CE Amplifier
 
Introduction to Genetic algorithm and its significance in VLSI design and aut...
Introduction to Genetic algorithm and its significance in VLSI design and aut...Introduction to Genetic algorithm and its significance in VLSI design and aut...
Introduction to Genetic algorithm and its significance in VLSI design and aut...
 
Low Pass Filter - Classification
Low Pass Filter - ClassificationLow Pass Filter - Classification
Low Pass Filter - Classification
 
CMOS Operational Amplifier Design
CMOS Operational Amplifier DesignCMOS Operational Amplifier Design
CMOS Operational Amplifier Design
 
BUilt-In-Self-Test for VLSI Design
BUilt-In-Self-Test for VLSI DesignBUilt-In-Self-Test for VLSI Design
BUilt-In-Self-Test for VLSI Design
 
Matching concept in Microelectronics
Matching concept in MicroelectronicsMatching concept in Microelectronics
Matching concept in Microelectronics
 
Sigma-Delta Analog to Digital Converters
Sigma-Delta Analog to Digital ConvertersSigma-Delta Analog to Digital Converters
Sigma-Delta Analog to Digital Converters
 
Automatic Test Pattern Generation (Testing of VLSI Design)
Automatic Test Pattern Generation (Testing of VLSI Design)Automatic Test Pattern Generation (Testing of VLSI Design)
Automatic Test Pattern Generation (Testing of VLSI Design)
 
Junctionless transistors
Junctionless transistorsJunctionless transistors
Junctionless transistors
 
IC Design of Power Management Circuits (II)
IC Design of Power Management Circuits (II)IC Design of Power Management Circuits (II)
IC Design of Power Management Circuits (II)
 
Pll ppt
Pll pptPll ppt
Pll ppt
 
BGR
BGRBGR
BGR
 
MOS-Nonideal charecteristics
MOS-Nonideal charecteristicsMOS-Nonideal charecteristics
MOS-Nonideal charecteristics
 
Switched capacitor
Switched capacitorSwitched capacitor
Switched capacitor
 
Study of inter and intra chip variations
Study of inter and intra chip variationsStudy of inter and intra chip variations
Study of inter and intra chip variations
 
Mosfet
MosfetMosfet
Mosfet
 
Low power vlsi design ppt
Low power vlsi design pptLow power vlsi design ppt
Low power vlsi design ppt
 
Design for testability and automatic test pattern generation
Design for testability and automatic test pattern generationDesign for testability and automatic test pattern generation
Design for testability and automatic test pattern generation
 
Analog VLSI Design
Analog VLSI DesignAnalog VLSI Design
Analog VLSI Design
 

Similar to PyParis2017 / Circuit simulation using Python, by Fabrice Salvaire

lab_1 This Lab is used for conducting th
lab_1 This Lab is used for conducting thlab_1 This Lab is used for conducting th
lab_1 This Lab is used for conducting thssuser6feece1
 
Layout design on MICROWIND
Layout design on MICROWINDLayout design on MICROWIND
Layout design on MICROWINDvaibhav jindal
 
Master Serial Killer - DEF CON 22 - ICS Village
Master Serial Killer - DEF CON 22 - ICS VillageMaster Serial Killer - DEF CON 22 - ICS Village
Master Serial Killer - DEF CON 22 - ICS VillageChris Sistrunk
 
ST tech tour - sigfox presentation & hands-on demp
ST tech tour - sigfox presentation & hands-on dempST tech tour - sigfox presentation & hands-on demp
ST tech tour - sigfox presentation & hands-on dempFrançois Oudot
 
DIY Home Weather Station (Devoxx Poland 2023)
DIY Home Weather Station (Devoxx Poland 2023)DIY Home Weather Station (Devoxx Poland 2023)
DIY Home Weather Station (Devoxx Poland 2023)Ryan Cuprak
 
Tools for Practical Attacks on Analog-to-Digital Conversion
Tools for Practical Attacks on Analog-to-Digital ConversionTools for Practical Attacks on Analog-to-Digital Conversion
Tools for Practical Attacks on Analog-to-Digital ConversionAlexander Bolshev
 
Physics of Failure Electronics Reliability Assurance Software
Physics of Failure Electronics Reliability Assurance SoftwarePhysics of Failure Electronics Reliability Assurance Software
Physics of Failure Electronics Reliability Assurance SoftwareCheryl Tulkoff
 
Single instruction multiple data
Single instruction multiple dataSingle instruction multiple data
Single instruction multiple dataSyed Zaid Irshad
 
Xilinx vs Intel (Altera) FPGA performance comparison
Xilinx vs Intel (Altera) FPGA performance comparison Xilinx vs Intel (Altera) FPGA performance comparison
Xilinx vs Intel (Altera) FPGA performance comparison Roy Messinger
 
Digital clock workshop
Digital clock workshopDigital clock workshop
Digital clock workshopKedarv
 
Embedded systems basics 8051 - project approach
Embedded systems basics 8051 - project approach Embedded systems basics 8051 - project approach
Embedded systems basics 8051 - project approach hybrald industries
 
Embedded Systems,Embedded Systems Project,Winter training,
Embedded Systems,Embedded Systems Project,Winter training,Embedded Systems,Embedded Systems Project,Winter training,
Embedded Systems,Embedded Systems Project,Winter training,Technogroovy
 
Klessydra t - designing vector coprocessors for multi-threaded edge-computing...
Klessydra t - designing vector coprocessors for multi-threaded edge-computing...Klessydra t - designing vector coprocessors for multi-threaded edge-computing...
Klessydra t - designing vector coprocessors for multi-threaded edge-computing...RISC-V International
 
.NET Fest 2019. Łukasz Pyrzyk. Daily Performance Fuckups
.NET Fest 2019. Łukasz Pyrzyk. Daily Performance Fuckups.NET Fest 2019. Łukasz Pyrzyk. Daily Performance Fuckups
.NET Fest 2019. Łukasz Pyrzyk. Daily Performance FuckupsNETFest
 
microcontrollersstm32wlseriesproductwebinarpresentation1625231766205.pdf
microcontrollersstm32wlseriesproductwebinarpresentation1625231766205.pdfmicrocontrollersstm32wlseriesproductwebinarpresentation1625231766205.pdf
microcontrollersstm32wlseriesproductwebinarpresentation1625231766205.pdfadfadfadf
 

Similar to PyParis2017 / Circuit simulation using Python, by Fabrice Salvaire (20)

lab_1 This Lab is used for conducting th
lab_1 This Lab is used for conducting thlab_1 This Lab is used for conducting th
lab_1 This Lab is used for conducting th
 
Layout design on MICROWIND
Layout design on MICROWINDLayout design on MICROWIND
Layout design on MICROWIND
 
Master Serial Killer - DEF CON 22 - ICS Village
Master Serial Killer - DEF CON 22 - ICS VillageMaster Serial Killer - DEF CON 22 - ICS Village
Master Serial Killer - DEF CON 22 - ICS Village
 
ST tech tour - sigfox presentation & hands-on demp
ST tech tour - sigfox presentation & hands-on dempST tech tour - sigfox presentation & hands-on demp
ST tech tour - sigfox presentation & hands-on demp
 
DIY Home Weather Station (Devoxx Poland 2023)
DIY Home Weather Station (Devoxx Poland 2023)DIY Home Weather Station (Devoxx Poland 2023)
DIY Home Weather Station (Devoxx Poland 2023)
 
Iot 101
Iot 101Iot 101
Iot 101
 
Tools for Practical Attacks on Analog-to-Digital Conversion
Tools for Practical Attacks on Analog-to-Digital ConversionTools for Practical Attacks on Analog-to-Digital Conversion
Tools for Practical Attacks on Analog-to-Digital Conversion
 
Physics of Failure Electronics Reliability Assurance Software
Physics of Failure Electronics Reliability Assurance SoftwarePhysics of Failure Electronics Reliability Assurance Software
Physics of Failure Electronics Reliability Assurance Software
 
Single instruction multiple data
Single instruction multiple dataSingle instruction multiple data
Single instruction multiple data
 
Xilinx vs Intel (Altera) FPGA performance comparison
Xilinx vs Intel (Altera) FPGA performance comparison Xilinx vs Intel (Altera) FPGA performance comparison
Xilinx vs Intel (Altera) FPGA performance comparison
 
presentation
presentationpresentation
presentation
 
9.atmel
9.atmel9.atmel
9.atmel
 
67WS Event FIO Primer
67WS Event FIO Primer67WS Event FIO Primer
67WS Event FIO Primer
 
Digital clock workshop
Digital clock workshopDigital clock workshop
Digital clock workshop
 
TRANSISTORES
TRANSISTORESTRANSISTORES
TRANSISTORES
 
Embedded systems basics 8051 - project approach
Embedded systems basics 8051 - project approach Embedded systems basics 8051 - project approach
Embedded systems basics 8051 - project approach
 
Embedded Systems,Embedded Systems Project,Winter training,
Embedded Systems,Embedded Systems Project,Winter training,Embedded Systems,Embedded Systems Project,Winter training,
Embedded Systems,Embedded Systems Project,Winter training,
 
Klessydra t - designing vector coprocessors for multi-threaded edge-computing...
Klessydra t - designing vector coprocessors for multi-threaded edge-computing...Klessydra t - designing vector coprocessors for multi-threaded edge-computing...
Klessydra t - designing vector coprocessors for multi-threaded edge-computing...
 
.NET Fest 2019. Łukasz Pyrzyk. Daily Performance Fuckups
.NET Fest 2019. Łukasz Pyrzyk. Daily Performance Fuckups.NET Fest 2019. Łukasz Pyrzyk. Daily Performance Fuckups
.NET Fest 2019. Łukasz Pyrzyk. Daily Performance Fuckups
 
microcontrollersstm32wlseriesproductwebinarpresentation1625231766205.pdf
microcontrollersstm32wlseriesproductwebinarpresentation1625231766205.pdfmicrocontrollersstm32wlseriesproductwebinarpresentation1625231766205.pdf
microcontrollersstm32wlseriesproductwebinarpresentation1625231766205.pdf
 

More from Pôle Systematic Paris-Region

OSIS19_IoT :Transparent remote connectivity to short-range IoT devices, by Na...
OSIS19_IoT :Transparent remote connectivity to short-range IoT devices, by Na...OSIS19_IoT :Transparent remote connectivity to short-range IoT devices, by Na...
OSIS19_IoT :Transparent remote connectivity to short-range IoT devices, by Na...Pôle Systematic Paris-Region
 
OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...
OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...
OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...Pôle Systematic Paris-Region
 
OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...
OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...
OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...Pôle Systematic Paris-Region
 
OSIS19_Cloud : Performance and power management in virtualized data centers, ...
OSIS19_Cloud : Performance and power management in virtualized data centers, ...OSIS19_Cloud : Performance and power management in virtualized data centers, ...
OSIS19_Cloud : Performance and power management in virtualized data centers, ...Pôle Systematic Paris-Region
 
OSIS19_Cloud : Des objets dans le cloud, et qui y restent -- L'expérience du ...
OSIS19_Cloud : Des objets dans le cloud, et qui y restent -- L'expérience du ...OSIS19_Cloud : Des objets dans le cloud, et qui y restent -- L'expérience du ...
OSIS19_Cloud : Des objets dans le cloud, et qui y restent -- L'expérience du ...Pôle Systematic Paris-Region
 
OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...
OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...
OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...Pôle Systematic Paris-Region
 
OSIS19_IoT : State of the art in security for embedded systems and IoT, by Pi...
OSIS19_IoT : State of the art in security for embedded systems and IoT, by Pi...OSIS19_IoT : State of the art in security for embedded systems and IoT, by Pi...
OSIS19_IoT : State of the art in security for embedded systems and IoT, by Pi...Pôle Systematic Paris-Region
 
Osis19_IoT: Proof of Pointer Programs with Ownership in SPARK, by Yannick Moy
Osis19_IoT: Proof of Pointer Programs with Ownership in SPARK, by Yannick MoyOsis19_IoT: Proof of Pointer Programs with Ownership in SPARK, by Yannick Moy
Osis19_IoT: Proof of Pointer Programs with Ownership in SPARK, by Yannick MoyPôle Systematic Paris-Region
 
Osis18_Cloud : Virtualisation efficace d’architectures NUMA
Osis18_Cloud : Virtualisation efficace d’architectures NUMAOsis18_Cloud : Virtualisation efficace d’architectures NUMA
Osis18_Cloud : Virtualisation efficace d’architectures NUMAPôle Systematic Paris-Region
 
Osis18_Cloud : DeepTorrent Stockage distribué perenne basé sur Bittorrent
Osis18_Cloud : DeepTorrent Stockage distribué perenne basé sur BittorrentOsis18_Cloud : DeepTorrent Stockage distribué perenne basé sur Bittorrent
Osis18_Cloud : DeepTorrent Stockage distribué perenne basé sur BittorrentPôle Systematic Paris-Region
 
OSIS18_IoT: L'approche machine virtuelle pour les microcontrôleurs, le projet...
OSIS18_IoT: L'approche machine virtuelle pour les microcontrôleurs, le projet...OSIS18_IoT: L'approche machine virtuelle pour les microcontrôleurs, le projet...
OSIS18_IoT: L'approche machine virtuelle pour les microcontrôleurs, le projet...Pôle Systematic Paris-Region
 
OSIS18_IoT: La securite des objets connectes a bas cout avec l'os et riot
OSIS18_IoT: La securite des objets connectes a bas cout avec l'os et riotOSIS18_IoT: La securite des objets connectes a bas cout avec l'os et riot
OSIS18_IoT: La securite des objets connectes a bas cout avec l'os et riotPôle Systematic Paris-Region
 
OSIS18_IoT : Solution de mise au point pour les systemes embarques, par Julio...
OSIS18_IoT : Solution de mise au point pour les systemes embarques, par Julio...OSIS18_IoT : Solution de mise au point pour les systemes embarques, par Julio...
OSIS18_IoT : Solution de mise au point pour les systemes embarques, par Julio...Pôle Systematic Paris-Region
 
OSIS18_IoT : Securisation du reseau des objets connectes, par Nicolas LE SAUZ...
OSIS18_IoT : Securisation du reseau des objets connectes, par Nicolas LE SAUZ...OSIS18_IoT : Securisation du reseau des objets connectes, par Nicolas LE SAUZ...
OSIS18_IoT : Securisation du reseau des objets connectes, par Nicolas LE SAUZ...Pôle Systematic Paris-Region
 
OSIS18_IoT : Ada and SPARK - Defense in Depth for Safe Micro-controller Progr...
OSIS18_IoT : Ada and SPARK - Defense in Depth for Safe Micro-controller Progr...OSIS18_IoT : Ada and SPARK - Defense in Depth for Safe Micro-controller Progr...
OSIS18_IoT : Ada and SPARK - Defense in Depth for Safe Micro-controller Progr...Pôle Systematic Paris-Region
 
OSIS18_IoT : RTEMS pour l'IoT professionnel, par Pierre Ficheux (Smile ECS)
OSIS18_IoT : RTEMS pour l'IoT professionnel, par Pierre Ficheux (Smile ECS)OSIS18_IoT : RTEMS pour l'IoT professionnel, par Pierre Ficheux (Smile ECS)
OSIS18_IoT : RTEMS pour l'IoT professionnel, par Pierre Ficheux (Smile ECS)Pôle Systematic Paris-Region
 
PyParis 2017 / Un mooc python, by thierry parmentelat
PyParis 2017 / Un mooc python, by thierry parmentelatPyParis 2017 / Un mooc python, by thierry parmentelat
PyParis 2017 / Un mooc python, by thierry parmentelatPôle Systematic Paris-Region
 

More from Pôle Systematic Paris-Region (20)

OSIS19_IoT :Transparent remote connectivity to short-range IoT devices, by Na...
OSIS19_IoT :Transparent remote connectivity to short-range IoT devices, by Na...OSIS19_IoT :Transparent remote connectivity to short-range IoT devices, by Na...
OSIS19_IoT :Transparent remote connectivity to short-range IoT devices, by Na...
 
OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...
OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...
OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...
 
OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...
OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...
OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...
 
OSIS19_Cloud : Performance and power management in virtualized data centers, ...
OSIS19_Cloud : Performance and power management in virtualized data centers, ...OSIS19_Cloud : Performance and power management in virtualized data centers, ...
OSIS19_Cloud : Performance and power management in virtualized data centers, ...
 
OSIS19_Cloud : Des objets dans le cloud, et qui y restent -- L'expérience du ...
OSIS19_Cloud : Des objets dans le cloud, et qui y restent -- L'expérience du ...OSIS19_Cloud : Des objets dans le cloud, et qui y restent -- L'expérience du ...
OSIS19_Cloud : Des objets dans le cloud, et qui y restent -- L'expérience du ...
 
OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...
OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...
OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...
 
OSIS19_IoT : State of the art in security for embedded systems and IoT, by Pi...
OSIS19_IoT : State of the art in security for embedded systems and IoT, by Pi...OSIS19_IoT : State of the art in security for embedded systems and IoT, by Pi...
OSIS19_IoT : State of the art in security for embedded systems and IoT, by Pi...
 
Osis19_IoT: Proof of Pointer Programs with Ownership in SPARK, by Yannick Moy
Osis19_IoT: Proof of Pointer Programs with Ownership in SPARK, by Yannick MoyOsis19_IoT: Proof of Pointer Programs with Ownership in SPARK, by Yannick Moy
Osis19_IoT: Proof of Pointer Programs with Ownership in SPARK, by Yannick Moy
 
Osis18_Cloud : Pas de commun sans communauté ?
Osis18_Cloud : Pas de commun sans communauté ?Osis18_Cloud : Pas de commun sans communauté ?
Osis18_Cloud : Pas de commun sans communauté ?
 
Osis18_Cloud : Projet Wolphin
Osis18_Cloud : Projet Wolphin Osis18_Cloud : Projet Wolphin
Osis18_Cloud : Projet Wolphin
 
Osis18_Cloud : Virtualisation efficace d’architectures NUMA
Osis18_Cloud : Virtualisation efficace d’architectures NUMAOsis18_Cloud : Virtualisation efficace d’architectures NUMA
Osis18_Cloud : Virtualisation efficace d’architectures NUMA
 
Osis18_Cloud : DeepTorrent Stockage distribué perenne basé sur Bittorrent
Osis18_Cloud : DeepTorrent Stockage distribué perenne basé sur BittorrentOsis18_Cloud : DeepTorrent Stockage distribué perenne basé sur Bittorrent
Osis18_Cloud : DeepTorrent Stockage distribué perenne basé sur Bittorrent
 
Osis18_Cloud : Software-heritage
Osis18_Cloud : Software-heritageOsis18_Cloud : Software-heritage
Osis18_Cloud : Software-heritage
 
OSIS18_IoT: L'approche machine virtuelle pour les microcontrôleurs, le projet...
OSIS18_IoT: L'approche machine virtuelle pour les microcontrôleurs, le projet...OSIS18_IoT: L'approche machine virtuelle pour les microcontrôleurs, le projet...
OSIS18_IoT: L'approche machine virtuelle pour les microcontrôleurs, le projet...
 
OSIS18_IoT: La securite des objets connectes a bas cout avec l'os et riot
OSIS18_IoT: La securite des objets connectes a bas cout avec l'os et riotOSIS18_IoT: La securite des objets connectes a bas cout avec l'os et riot
OSIS18_IoT: La securite des objets connectes a bas cout avec l'os et riot
 
OSIS18_IoT : Solution de mise au point pour les systemes embarques, par Julio...
OSIS18_IoT : Solution de mise au point pour les systemes embarques, par Julio...OSIS18_IoT : Solution de mise au point pour les systemes embarques, par Julio...
OSIS18_IoT : Solution de mise au point pour les systemes embarques, par Julio...
 
OSIS18_IoT : Securisation du reseau des objets connectes, par Nicolas LE SAUZ...
OSIS18_IoT : Securisation du reseau des objets connectes, par Nicolas LE SAUZ...OSIS18_IoT : Securisation du reseau des objets connectes, par Nicolas LE SAUZ...
OSIS18_IoT : Securisation du reseau des objets connectes, par Nicolas LE SAUZ...
 
OSIS18_IoT : Ada and SPARK - Defense in Depth for Safe Micro-controller Progr...
OSIS18_IoT : Ada and SPARK - Defense in Depth for Safe Micro-controller Progr...OSIS18_IoT : Ada and SPARK - Defense in Depth for Safe Micro-controller Progr...
OSIS18_IoT : Ada and SPARK - Defense in Depth for Safe Micro-controller Progr...
 
OSIS18_IoT : RTEMS pour l'IoT professionnel, par Pierre Ficheux (Smile ECS)
OSIS18_IoT : RTEMS pour l'IoT professionnel, par Pierre Ficheux (Smile ECS)OSIS18_IoT : RTEMS pour l'IoT professionnel, par Pierre Ficheux (Smile ECS)
OSIS18_IoT : RTEMS pour l'IoT professionnel, par Pierre Ficheux (Smile ECS)
 
PyParis 2017 / Un mooc python, by thierry parmentelat
PyParis 2017 / Un mooc python, by thierry parmentelatPyParis 2017 / Un mooc python, by thierry parmentelat
PyParis 2017 / Un mooc python, by thierry parmentelat
 

Recently uploaded

Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentMahmoud Rabie
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Which standard is best for your content?
Which standard is best for your content?Which standard is best for your content?
Which standard is best for your content?Rustici Software
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Bitdefender-CSG-Report-creat7534-interactive
Bitdefender-CSG-Report-creat7534-interactiveBitdefender-CSG-Report-creat7534-interactive
Bitdefender-CSG-Report-creat7534-interactivestartupro
 
Introduction-to-Wazuh-and-its-integration.pptx
Introduction-to-Wazuh-and-its-integration.pptxIntroduction-to-Wazuh-and-its-integration.pptx
Introduction-to-Wazuh-and-its-integration.pptxmprakaash5
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 

Recently uploaded (20)

Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career Development
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Which standard is best for your content?
Which standard is best for your content?Which standard is best for your content?
Which standard is best for your content?
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Bitdefender-CSG-Report-creat7534-interactive
Bitdefender-CSG-Report-creat7534-interactiveBitdefender-CSG-Report-creat7534-interactive
Bitdefender-CSG-Report-creat7534-interactive
 
Introduction-to-Wazuh-and-its-integration.pptx
Introduction-to-Wazuh-and-its-integration.pptxIntroduction-to-Wazuh-and-its-integration.pptx
Introduction-to-Wazuh-and-its-integration.pptx
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 

PyParis2017 / Circuit simulation using Python, by Fabrice Salvaire

  • 1. Circuit Simulation using Python Fabrice Salvaire PyParis 2017 R2 150 Q13 2N4236 Q14 2N4239 R1 20 K i1 + V1 − R3 150 − + A1 Nexus SQ-10A R14 19 K R13 91 K R6 15 K − + A2 Nexus SQ-10A Q3 2N5464 Q4 2N4239 D4 OMC-V D3 Q1 2N3819 Q2 2N4236 D1 D2 OMC-V Q7 2N5464 Q8 2N4239 Q5 2N3819 Q6 2N4236 R11 20 D5 1N4729 C4 0.68 µF C3 0.68 µF C2 0.1 µF R5 100 K C1 1 µF R9 910 R10 910 R4 100 K Q11 2N5464 Q10 2N4239 − ECC D6 1N4728 Q12 2N3819 Q9 2N4236 + ECC R12 20 i2 + V2 − R15 200 F. Salvaire 1 / 35 http://pyparis.org https://www.fabrice-salvaire.fr/en/about/contact https://github.com/FabriceSalvaire/pyparis-2017 CC BY-NC-SA 3.0 https://pyspice.fabrice-salvaire.fr/pyparis-2017-talk.pdf
  • 2. Outline 1 Why Python is the right language for engineering ? 2 An Introduction to Circuit Simulation 3 SPICE an Industrial Standard 4 PySpice the Bridge between SPICE and Python 5 Modelica a Language for Simulation F. Salvaire 2 / 35
  • 3. Let do engineering . . . As computers cannot boot without an Office Pack Students and later engineers know You can do everything with it at work from R&D to communication, database, accounting, . . . You will Excel !!! F. Salvaire 3 / 35
  • 4. Mouse Algorithm How to compute the derivative of a data set ? 1 copy the data of the first column 2 past to the second column starting from the second line 3 enter the formulae (A − B)/dt in the third column Easy and Efficient ! Isn’t it ? Next exercise compute an histogram . . . Python answer if you are lazy for value in values: hist[int(value // bin_size)] += 1 F. Salvaire 4 / 35
  • 5. A cabinetworker as a lot of tools : one for each task ! F. Salvaire 5 / 35
  • 6. Open Source Community has also a lot of tools ! Of course if you have to build this You need the right tools You have to look for solutions And evaluate if it makes the job But for teaching, learning or DIY You can find what you are looking for And maybe discover alternatives Like to simulate electronic circuit or even complex systems You can get it even if you live in a ghetto It’s free and open ! F. Salvaire 6 / 35
  • 7. Simulation Workflow Steer Process Analyse −→ −→ F. Salvaire 7 / 35
  • 8. Thanks to Guido van Rossum, We have Python ! • Indentation is syntax ! So clever ! Look at PhD student C++ code • Canonical Syntax • High Level Language • Object Oriented • Transparent memory management • Easy to bind with C or Fortran • An incredible Scientific Environment F. Salvaire 8 / 35
  • 9. Simulation Workflow with Python Steer Process Analyse −→ −→ • JSON • YAML • Python itself ! • XML • h5py : HDF5 • subprocess • CFFI • SWIG • Numpy • SciPy • Matplotlib • IPython We have more than we can buy learn ! F. Salvaire 9 / 35
  • 10. Circuit Simulation : Nodal Analysis Circuit ≡ Device’s Graph i1 i4 i2 i7 i3 i5 i6 i8 i9 Roughly . . . 1 Apply Kirchhoff’s circuit laws • Current Law Ik = 0 for each node conservation of the electron flow • Voltage Law Vk = 0 for each cycle think that is a closed path 2 Apply Device Equation f(Vk, Ik) = 0 e.g. Ohm Law for resistor V = RI Can be Complex e.g. Capacitor, Inductor and Non-Linear e.g. Diode ! F. Salvaire 10 / 35
  • 11. Circuit Simulation : Nodal Analysis Example Is1 1 R1 0 R2 2 R3 −+ Vs1 Let apply the recipes    1 R1 + 1 R2 − 1 R2 1 − 1 R2 1 R2 + 1 R3 −1 1 −1 0       V1 V2 IVs1    =    Is1 0 Vs1    Then solve this System of Linear Equations There are algorithms to build theses matrices Usually matrices are sparses Complex therms for Capacitor, Inductor e.g. V = 1 sC I Non linear e.g. Shockley Diode Model I = Is e V nVT − 1 To go further QUCS Technical Papers or PDF F. Salvaire 11 / 35
  • 12. Circuit Simulation : Several kinds of analyses Principal Analyses • DC Analysis Operating Point and DC Sweep Compute node’s voltages at t = 0 cf. infra • AC Small-Signal Analysis Transfer Function Frequency Analysis V (ω), cf. Laplace Transform small means Taylor Series • Transient Analysis Simulate over time V (t) Integrator More specific ones • Pole-Zero Analysis • Small-Signal Distortion Analysis • Sensitivity Analysis • Noise Analysis • etc. F. Salvaire 12 / 35 To go further Ngspice Documentation
  • 13. SPICE : Simulation Program with Integrated Circuit Emphasis • Developed by Dr. Laurence Nagel in 1973 at Berkeley • First software to combine DC, AC and transient analog circuit analysis capabilities • An early open source software initiative (Public Domain) • Used in undergraduate courses • Evolved to a worldwide standard • IEEE Milestone on 2011 • Berkeley released spice3f5 at last on 1993 • Superseded by commercial and open source forks To go further SPICE2 : A Computer Program to Simulate Semiconductor Circuits ; Nagel, Laurence W. ; 1975 The Origins of SPICE by Nagel F. Salvaire 13 / 35
  • 14. SPICE : Netlist as Input 0 Vin 1 C1 2 R2 R1 6 Q1 3 RE 4 C2 5 RL RC − + Vpwr AC-coupled amplifier Vpwr 6 0 DC 15V Vin 1 0 AC 1V SIN(0V .5V 1KHz) C1 1 2 10u R1 6 2 100k R2 2 0 20k RC 6 4 10k Q1 4 2 3 bjt RE 3 0 2k C2 4 5 10u RL 5 0 1Meg .model bjt npn(bf=80 cjc=5p rb=100) .ac dec 5 10m 1G *.tran .02ms 2ms 0 .01ms .control run plot V(1) V(5) .end F. Salvaire 14 / 35
  • 15. SPICE : A Worldwide Standard for integrated circuit simulation Device manufacturers use SPICE language to provide models as sub-circuit 1N5913B - 1N5957B SILICON ZENER DIODES VZ : 3.3 - 240 Volts PD : 3 Watts FEATURES : * Complete Voltage Range 3.3 to 200 Volts * High peak reverse power dissipation * High reliability * Low leakage current * Pb / RoHS Free MECHANICAL DATA * Case : DO-41 Molded plastic * Epoxy : UL94V-O rate flame retardant * Lead : Axial lead solderable per MIL-STD-202, method 208 guaranteed * Polarity : Color band denotes cathode end * Mounting position : Any * Weight : 0.335 gram MAXIMUM RATINGS Rating at 25°C ambient temperature unless otherwise specified Rating Symbol Value Unit Maximum Steady state Power Dissipation 3.0 W @ TL = 75 ºC, Lead Length = 3/8" Derate above 75 ºC Steady State Power Dissipation 1.0 W @ TL = 50 ºC, Lead Length = 3/8" Derate above 50 ºC Operating and Storage Temperature Range TJ,TSTG - 65 to + 200 °C Page 1 of 4 Rev. 07 : June 7, 2006 6.67 mW/ºC PD PD 24 mW/ºC DO - 41 Dimensions in inches and ( millimeters ) 1.00 (25.4) MIN. 0.108 (2.74) 0.079 (1.99) 0.205 (5.20) 0.161 (4.10) 1.00 (25.4) MIN.0.034 (0.86) 0.028 (0.71) Certificate TH97/10561QM Certificate TW00/17276EM * http://www.onsemi.com/pub_link/Collateral/1N5919BRL.SP3 .SUBCKT d1n5919brl 2 1 ************************************** * Model Generated by MODPEX * *Copyright(c) Symmetry Design Systems* * All Rights Reserved * * UNPUBLISHED LICENSED SOFTWARE * * Contains Proprietary Information * * Which is The Property of * * SYMMETRY OR ITS LICENSORS * * Modeling services provided by * * Interface Technologies www.i-t.com * ************************************** * Model generated on Jun 22, 2004 * MODEL FORMAT: SPICE3 * anode cathode *node: 2 1 * Forward Section D1 2 1 MD1 .MODEL MD1 D IS=1.33275e-21 N=1 XTI=1 RS=0.1 + CJO=1e-11 TT=1e-08 * Leakage Current R 1 2 600000 MDR .MODEL MDR R TC1=0 TC2=0 * Breakdown RZ 2 3 0.520393 IZG 4 3 0.3204 R4 4 3 100 D3 3 4 MD3 .MODEL MD3 D IS=2.5e-12 N=2.40102 XTI=0 EG=0.1 D2 5 4 MD2 .MODEL MD2 D IS=2.5e-12 N=3.19856 XTI=0 EG=0.1 EV1 1 5 6 0 1 IBV 0 6 0.001 RBV 6 0 5153.19 MDRBV .MODEL MDRBV R TC1=1.79e-08 *-- SPICE3 DIODE MODEL DEFAULT PARAMETER * VALUES ARE ASSUMED *IS=1E-14 RS=0 N=1 TT=0 CJO=0 *VJ=1 M=0.5 EG=1.11 XTI=3 FC=0.5 *KF=0 AF=1 BV=inf IBV=1e-3 TNOM=27 .ENDS d1n5919brl F. Salvaire 15 / 35
  • 16. SPICE Open Source Clones : Many initiatives . . . ! 1 Berkeley spice3f5 1993 • A Research Project • Was not developed with industrial concerns 2 Ngspice : New Generation Spice 1999 • Fork of Berkeley spice3f5 • Features mixed-level and mixed-signal simulation XSpice (mixed signal), Cider1b1 and GENIUS TCAD (mixed level) • Still maintained (?) but not actively ! last release Jan. 2014 3 GnuCap : GNU Circuit Analysis Package 1993 • Attempt to rewrite SPICE from scratch by Albert Davis • Davis’s Thesis "Implicit Mixed-Mode Simulation of VLSI Circuits" • No longer maintained since 2006 2013 ? 4 QUCS : Quite Universal Circuit Simulator 2003 5 Akhab 2006 Open Source means Free Software, GPL . . . F. Salvaire 16 / 35
  • 17. QUCS : When Open Source fails ! QUCS : Quite Universal Circuit Simulator • Founded by Michael Margraf in 2003 (?) • Complete Toolchain Schematic Editor, Simulation and Plot • IDE based on Qt3 • Interesting simulation features • Margraf moved later to proprietary software ??? • Slowly maintained port to Qt4 is ongoing since . . . many years F. Salvaire 17 / 35
  • 18. QUCS : What is wrong ? To develop an electronic CAD software, we need these skills • Circuit Simulation • Solid State Device Modelling • State of Art Numerical Analysis • Software Architecture, Core Design • GUI Design • XML Format Design • Schematic Editor Design • Plot Library • . . . Later, we have to maintain • A very large code base • A GUI Qt3 → Qt4 → Qt5 → . . . Don’t do that until you have a zillion $ (industrial market) Develop Software Components ! And plug them together F. Salvaire 18 / 35
  • 19. LtSpice : Well known free but proprietary clone Just a (quite old) marketing tool of Linear Technology (device manufacturer) F. Salvaire 19 / 35
  • 20. PySpice : The Bridge between SPICE and Python How it is born ? • Come back to electronic learning • Use the most maintained SPICE flavour : NgSpice • But analysis tools are outdated : e.g. TCL Spice • I want Python !!! =⇒ Plug NgSpice to Python How to get it ? • https://pyspice.fabrice-salvaire.fr • https://github.com/FabriceSalvaire/PySpice • Available on PyPi • Licensed under GPLv3 F. Salvaire 20 / 35
  • 21. PySpice : Workflow Python Netlist NgSpice Python Analysis 1 Define circuit in Python Cin 1 2 470n −→ circuit.C(’in’, 1, 2, nano(470)) or include netlist as is 2 Define simulation parameters 3 Generate netlist code 4 Execute NgSpice (server mode) 5 Get output as Numpy array 6 Analyse, plot . . . Why Python Netlist ? • More verbose, But • Can use Python to configure netlist example • keyword argument resistance=kilo(100) • cf. Modelica see later F. Salvaire 21 / 35
  • 22. PySpice : I hate Netlist, I want a Schematic Editor !!! No Problem, Use KiCad ! • Implement a minimal Netlist parser • But a full parser would be difficult to implement NgSpice syntax is very complex due to many extensions • Tips : Use subcircuit to hide complexity Leading Open Source Electronics Design Automation Suite CERN is a contributor KiCad example F. Salvaire 22 / 35
  • 23. PySpice : NgSpice as a Shared Library • NgSpice can be used as a shared library instead of an executable • Not a big improvement, But • We can use the NgSpice Shared API • To define external independent voltage/current sources (Input) • To get the simulation output at each step (Output) Python / C NgSpice sources output We can thus extend NgSpice easily with C or Python code • API also features a step by step simulation mode • PySpice as a CFFI Binding NgSpice API example F. Salvaire 23 / 35
  • 24. PySpice : Some features Implemented • Devices handled by a powerfull meta-class mechanism • Units • Netlist Library Manager • Oriented Object API for Netlist • Oriented Object API for Waveforms • Current Probe • Bode diagrams Must to have • More examples • Improved API • more Analysis Tools • Additional Plots e.g. eye-diagram etc. • Full featured shared API example • KiCad integration ? F. Salvaire 24 / 35
  • 25. PySpice : Example’s Documentation Generator PySpice has some learning materials • Kind of Jupyter Notebook . . . but for peoples that want a True Editor • reStrucuredText and Sphinx • Circuit_macros for diagrams • Concept : Use directive comments to add text and figure blocks However Notebook could be an option as well # A source code comment #?# A comment that must not appear in the documentation #!# ========================== #!# A Restructuredtext Title #!# ========================== python code ... #!# #!# Some reStructuredText contents #!# python code ... # Insert the output of the following python code python code ... #o# # Add the file content as literal block #itxt# kicad-pyspice-example/kicad-pyspice-example.cir # Add a Python file as a literal block #i# RingModulator.py # Insert an image #lfig# kicad-pyspice-example/kicad-pyspice-example.sch.svg # Insert Circuit_macros diagram #cm# circuit.m4 # Insert a Matplotlib figure #fig# save_figure(figure, ’my-figure.png’) F. Salvaire 25 / 35
  • 26. Diagrams with Circuit_macros . . . or Algorithms versus GUI .PS cct_init elen = 0.75 epsilon = 1e-3 G: ground; dot; "0" rjust source(up_ elen, AC); llabel(,V_in,); dot; "in" rjust capacitor(right_ elen); llabel(,C_1,); dot; "2" rjust above { resistor(down_ to (Here,G)); rlabel(,R_2) } { R1: resistor(up_ elen_*1.5); llabel(,R_1); dot; "5" above } line right_ elen_/2; up_ Q1: bi_tr(,,,E) with .B at Here; llabel(,,Q_1) Q1E: Q1.E - (0,elen_/8) line down from Q1.E to Q1E; dot; "3" ljust resistor(down_ to (Q1.E,G)); rlabel(,R_E) Q1C: Q1.C + (0,elen_/8) dot(at Q1C); "4" ljust above capacitor(right_ elen from Q1C); llabel(,C_2) dot; "out" ljust resistor(down_ to (Here,G)); rlabel(,R_L) line down epsilon then to G resistor(up_ from Q1.C to (Q1.C,R1.end)); llabel(,R_C) line up epsilon then left to (G,R1.end) then down epsilon reversed(‘source’, down_ elen, V); llabel(,V_pwr,) ground .PE Also circuitikz With M4 macros inside ! m4 → dpic → tikz → LATEX 0 Vin 1 C1 2 R2 R1 6 Q1 3 RE 4 C2 5 RL RC − + Vpwr F. Salvaire 26 / 35
  • 27. Related Project : Akhab pronounced "uh, cab" • Goal : Implement a SPICE- like in Python using Numpy, SciPy, and SymPy • Started by Giuseppe Venturini in 2006 † sadly deceased at the end of 2015 † • https://ahkab.github.io/ahkab • v0.18 released on July 2015 • Interesting initiative to learn circuit simulation F. Salvaire 27 / 35
  • 28. Modelica : A Language for Modelling of Complex Physical Systems Modelica in few words • Language + Standard Library • Object-Oriented and Equation based • Multi-domains Modelling • Non-proprietary • Developed by the non-profit Modelica Association • initiated in September 1996 by Hilding Elmqvist • First version on Sept. 1997 → 3.4 on April 2017 • Commercial front-ends : e.g. Dymola • Open Source front-ends : OpenModelica and JModelica To go further https://www.modelica.org Introduction to Object-Oriented Modeling and Simulation with OpenModelica - Peter Fritzson F. Salvaire 28 / 35
  • 29. Modelica : Bouncing-ball Example model BouncingBall parameter Real e=0.7 "coefficient of restitution"; parameter Real g=9.81 "gravity acceleration"; Real h(start=1) "height of ball"; Real v "velocity of ball"; Boolean flying(start=true) "true, if ball is flying"; Boolean impact; Real v_new; equation impact = h <= 0; der(v) = if flying then -g else 0; der(h) = v; // Triggered when one of theses conditions are true when {h <= 0 and v <= 0, impact} then v_new = if edge(impact) then -e*pre(v) else 0; flying = v_new > 0; reinit(v, v_new); end when; end BouncingBall; Netwton’s Law dh dt = v dv dt = d2 h dt2 = −g At impact, lost some energy v = −ev and go upwards F. Salvaire 29 / 35
  • 30. Modelica : Circuit with Annotations (Schema) model SimpleRectifierWithTransformer Modelica.Electrical.Analog.Sources.SineVoltage ac_line(V = 230, freqHz = 50); Modelica.Electrical.Analog.Basic.Capacitor capacitor(C = 0.00005); Modelica.Electrical.Analog.Basic.Ground ground; Modelica.Electrical.Analog.Ideal.IdealDiode diode(Vknee = 0.5); Modelica.Electrical.Analog.Basic.Resistor load_resistor(R = 1000.0); Modelica.Electrical.Analog.Ideal.IdealTransformer transformer(n = 10, Lm1 = 1); Modelica.Electrical.Analog.Sources.SineVoltage sinevoltage1 annotation(Placement(visible = true, transformation(origin = -78.7769,-10.3538, extent = -10,-10,10,10, rotation = -90))); Modelica.Electrical.Analog.Basic.Transformer transformer1 annotation(...); Modelica.Electrical.Analog.Semiconductors.Diode diode1 annotation(...); Modelica.Electrical.Analog.Basic.Resistor resistor1 annotation(...); Modelica.Electrical.Analog.Basic.Capacitor capacitor1 annotation(...); Modelica.Electrical.Analog.Basic.Ground ground1 annotation(...); equation connect(resistor1.n, ground1.p) annotation(Line(points = 22.286, -18.6196, 22.286, -25.0637, 22.5062, -25.0637, 22.5062, -25.0637)); connect(capacitor1.n, transformer1.n2) annotation(...); connect(resistor1.n, capacitor1.n) annotation(...); connect(capacitor1.p, resistor1.p) annotation(...); connect(diode1.n, capacitor1.p) annotation(...); connect(transformer1.p2, diode1.p) annotation(...); connect(sinevoltage1.n, transformer1.n1) annotation(...); connect(sinevoltage1.p, transformer1.p1) annotation(...); connect(ac_line.p, transformer.p1); connect(ac_line.n, transformer.n1); connect(ac_line.n, ground.p); connect(transformer.p2, diode.p); connect(transformer.n2, ground.p); connect(diode.n, capacitor.p); connect(diode.n, load_resistor.p); connect(capacitor.n, ground.p); connect(load_resistor.n, ground.p); annotation(Diagram(coordinateSystem(extent = -100, -100, 100, 100, preserveAspectRatio = true, initialScale = 0.1, grid = 2, 2))); end SimpleRectifierWithTransformer; To go further SPICE3 Modelica Library F. Salvaire 30 / 35 1 Define devices 2 connect(resistor1.n, ground1.p) ! Modelica performs Transient Analysis
  • 31. Modelica : Open Source Front-Ends 1 OpenModelica https://www.openmodelica.org • Supported by a non-profit organization : Open Source Modelica Consortium (OSMC) • OSMC Public License ≈ GPLv3 • Provide an IDE : OMEdit • Based on C++ and Corba • V1.12 released on May 2017 • Packages available on some Linux Distributions 2 JModelica http://jmodelica.org • Started at Department of Automatic Control, Lund University • Supported by Modelon AB • GPLv3 • Based on C, Java and Python • V2.0 released on May 2017 ! Packages are welcome since compilation can be tricky . . . F. Salvaire 31 / 35
  • 32. OpenModelica : OMEdit Screenshots F. Salvaire 32 / 35
  • 33. Using OpenModelica with Python from OMPython import ModelicaSystem mod = ModelicaSystem(’bouncing-ball.mo’, ’BouncingBall’) mod.setSimulationOptions(stopTime=3) mod.simulate() mod.getSolutions() t = mod.getSolutions(’time’) h = mod.getSolutions(’h’) import pylab pylab.grid() pylab.plot(t, h) pylab.xlabel(’time [s]’) pylab.ylabel(’[height]’) 0.0 0.5 1.0 1.5 2.0 2.5 3.0 time [s] 0.2 0.0 0.2 0.4 0.6 0.8 1.0 [height] Model is compiled to C F. Salvaire 33 / 35 To go further OpenModelica Python Interface Jmodelica doc
  • 34. PyCpuSimulator : Simulate CPU using micro-code https://github.com/FabriceSalvaire/PyCpuSimulator CPU Datasheet Extractor YAML Instruction Set Micro-Code Interpreter Features • Micro-Code Language to describe instruction • Opcode Decoder using Decision Tree • Read HEX firmware format • AVR Core CPU simulation is ongoing If you want to play with Core . . . F. Salvaire 34 / 35
  • 35. Conclusion Target : Learning, DIY, Hackerspace Courses . . . I need your help • To add examples • To comment, fill issues Why it is hard to promote ? • User are not computer scientist • Many use Windows : installation issue • Very limited interest for Industry F. Salvaire 35 / 35