Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added circuit plotting with SchemDraw #135

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

chaffra
Copy link

@chaffra chaffra commented Nov 26, 2018

Hello,

This PR allows the user to visualize to circuit with SchemDraw while building it. Example

circuit = Circuit('Diode Characteristic Curve')
circuit.include(spice_library['1N4148'])
circuit.schematic.add(schem.elements.GND)
V =circuit.V('input', 'Vin', circuit.gnd, 10@u_V,
            schematic_kwargs={'show_plus': True}
            )
R = circuit.R('1', 'Vin', 'Vout', 1@u_Ω,
              schematic_kwargs={'d':'right', 'show_minus': True}
             ) # not required for simulation
X = circuit.X('D1', '1N4148', 'Vout', circuit.gnd,
             schematic_kwargs={'schematic': schem.elements.DIODE, 'd':'down'},
             )
circuit.schematic.add(schem.elements.GND)
circuit.schematic.draw()

Not all electrical components diagrams are implemented yet but this is a start.

@FabriceSalvaire
Copy link
Collaborator

Thanks I didn't know SchemDraw !

SchemDraw looks cool as an alternative to circuit_macros which is hard to use and require a lot of dependencies ...

Some references on SchemDraw:

I wonder how it compares ? I was thinking to such feature, even for basic circuits.

Now the question is on the API. We could give a look to Modelica annotation.

The approach using an optional kwarg seems interesting. Maybe we could improve a bit the syntax.

Note: I don't have so much time to work on PySpice actually ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants