Skip to content

Commit

Permalink
Merge branch 'master' into fixI
Browse files Browse the repository at this point in the history
  • Loading branch information
mph- committed Oct 7, 2024
2 parents 0d1d875 + d19f526 commit 62cad23
Show file tree
Hide file tree
Showing 19 changed files with 250 additions and 46 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: install
install:
#python3 setup.py install
pip3 install .
pip3 install -e .

.PHONY: install-extras
install-extras:
Expand Down
1 change: 1 addition & 0 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ singular matrix.

4. Handle controlled sources for loop and mesh analysis


Infrastructure
==============

Expand Down
Binary file modified doc/examples/schematics/grounds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doc/examples/schematics/grounds.sch
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ W 6 7; right
W 7 07; down=0.2, 0V
A 7; l=0V, anchor=s
; label_nodes=none
; draw_nodes=none
Binary file added doc/examples/schematics/grounds2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions doc/examples/schematics/grounds2.sch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# tailless ground
W 1 01; down=0.2, tlground
A 1; l=tlground, anchor=s
W 1 2; right
# thick tailless ground
W 2 02; down=0.2, tground
A 2; l=tground, anchor=s
W 2 3; right
# European ground
W 3 03; down=0.2, eground
A 3; l=eground, anchor=s
W 3 4; right
# alternative European ground
W 4 04; down=0.2, eground2
A 4; l=eground2, anchor=s
; label_nodes=none
; draw_nodes=none
Binary file modified doc/examples/schematics/transistors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions doc/examples/schematics/transistors.sch
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ M15 40 41 42 M15; up=1.5, kind=nfet, l=nfet/bodydiode, bodydiode
M16 43 44 42 M16; up=1.5, kind=pfet, l=pfet/bodydiode, bodydiode
M17 43 45 46 M17; up=1.5, kind=nmosd, l=nmosd/bulk, bulk
M18 47 48 46 M18; up=1.5, kind=pmosd, l=pmosd/bulk, bulk
M19 47 49 50 M19; up=1.5, kind=nmos, l=nmos/arrowmos, arrowmos
M20 51 52 50 M20; up=1.5, kind=pmos, l=pmos/arrowmos, arrowmos

; label_nodes=none, draw_nodes=connections
Binary file modified doc/examples/schematics/transistors3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 38 additions & 3 deletions doc/netlists.rst
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,20 @@ Circuit methods
referred to when the last switch activated prior to the time
specified for `t`.

- `defs(ignore)` Returns a directory of argname-value pair for all
components except for components with names specified by
`ignore`. For example,

>>> cct = Circuit("""
... R 1 2 3
... C1 2 3 4
... C2 3 4 5 6
... L 4 5 7 8""")
>>> cct.defs()
{'R': '3', 'C1': '4', 'C2': '5', 'C2_v0': '6', 'L': '7', 'L_i0': '8'}

See also `sympify()` and `subs()`.

- `describe()` Prints message describing how netlist is solved

- `evidence_matrix()` Returns the evidence matrix. This has a size
Expand Down Expand Up @@ -541,7 +555,7 @@ Circuit methods
>>> a.initialize({'L1': 7})
L1 1 2 L1 7

See also `convert_IVP`.
See also `convert_IVP()`.

- `open_circuit(cpt)` Applies open circuit in series with the component. The name of the open circuit component is returned.

Expand All @@ -568,7 +582,7 @@ Circuit methods

- `replace_switches(t)` Replaces switches with a short-circuit or
open-circuit circuit by considering whether the specified time `t`
is at or after the switch activation time. See also `convert_IVP`.
is at or after the switch activation time. See also `convert_IVP()`.

>>> cct = Circuit("""
... SW1 1 2 no
Expand All @@ -585,7 +599,7 @@ Circuit methods

- `replace_switches_before(t)` Replaces switches with a short-circuit
or open-circuit circuit by considering whether the specified time
`t` is before the switch activation time. See also `convert_IVP`.
`t` is before the switch activation time. See also `convert_IVP()`.

- `s_model()` Converts sources to the s-domain and represents
reactive components as impedances.
Expand Down Expand Up @@ -632,6 +646,27 @@ Circuit methods
>>> cct.switching_times()
[0.0, 1.0, 2.0]

- `sympify(ignore)` Converts numerical values to symbolic values
except for component names specified by `ignore`. For example,

>>> cct = Circuit("""
... R 1 2 3
... C1 2 3 4
... C2 3 4 5 6
... L 4 5 7 8""")
>>> cct.sympify()
R 1 2
C1 2 3
C2 3 4 C2 v0_C2
L 4 5 L i0_L
>>> cct.sympify().subs(cct.defs())
R 1 2 3
C1 2 3 4
C2 3 4 5 6
L 4 5 7 8

Note how the initial values are named. See also `defs()` and `subs()`.

- `unconnected_nodes` Returns list of names of nodes that are unconnected

- `unreachable_nodes(node)` Returns list of names of nodes that have no path to `node`.
Expand Down
11 changes: 10 additions & 1 deletion doc/schematics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ MOSFET transistors have the following attributes:

- `bodydiode`

- `arrow`
- `arrowmos`

- `ferroel gate` ferroelectric gate

Expand Down Expand Up @@ -978,6 +978,10 @@ connections. They have one of the following attributes:
- `nground` noiseless ground
- `pground` protected ground
- `rground` reference ground
- `tlground` tailless ground
- `tground` thicker tailless ground
- `eground` European style ground
- `eground2` alternative European style ground
- `0V` ground
- `vcc` positive power supply (voltage to collectors)
- `vdd` positive power supply (voltage to drains ;-)
Expand Down Expand Up @@ -1011,6 +1015,11 @@ Here are some ground examples:
.. image:: examples/schematics/grounds.png
:width: 15cm

.. literalinclude:: examples/schematics/grounds2.sch

.. image:: examples/schematics/grounds2.png
:width: 7.5cm


Here are some power supply examples:

Expand Down
Loading

0 comments on commit 62cad23

Please sign in to comment.