You are not logged in.
Pages: 1
Intended for electrical engineers students/professionals/enthusiasts:
I use both Qucs and ngspice a lot. Qucs' GUI is very easy to use and ngspice is extremely powerful. However, ngspice doesn't have a GUI by default, so I thought of a way to combine Qucs interface with ngspice functionality. I think gEDA schem exports spice netlist; however, I personally don't like its feel - I use it only for manufacturing pcb.
The script
qucs2ng input output
converts Qucs netlist (located in ~/.qucs) to a spice netlist by simply using a bunch of sed instances.
Example:
The following Qucs circuit generates the ~/.qucs/netlist.txt below:
# Qucs 0.0.18 /home/felipe/test/test.sch
R:R2 _net1 vo R="10k" Temp="26.85" Tc1="0.0" Tc2="0.0" Tnom="26.85"
R:R1 _net0 vo R="20k" Temp="26.85" Tc1="0.0" Tc2="0.0" Tnom="26.85"
Vac:V1 _net1 _net0 U="3" f="100k" Phase="0" Theta="0"
After running
qucs2ng ~/.qucs/netlist.txt test.cir
we have the following proper spice netlist:
# Qucs 0.0.18 /home/felipe/test/test.sch
.include /home/felipe/.spicemodels
R2 1 vo 10k
R1 99 vo 20k
V1 1 99 SIN(0 3 100k)
.end
How to use
Design your circuit in Qucs.
Make sure all your elements values are in accordance with spice syntax. For example: '10 Ohm' should be just '10'; '5 MHz' should be '5Meg'.
Run a Qucs simulation by hitting F2.
Run the script:
qucs2ng ~/.qucs/netlist.txt myspice.cir
.
If you have written a .control script in myspice.cir and want to keep it after changing the schematics, run
qucs2ng -a ~/.qucs/netlist.txt myspice.cir
.
Notes:
The current script can handle BJT (npn, pnp), op amp, DC/AC/pulse source, diode, capacitor, resistor and inductor.
Change your spice models file in line 136.
Download here:
https://sites.google.com/site/duquebelf … para-spice
Last edited by felipeduque (2015-03-13 00:09:57)
Offline
Pretty good. Are your sources capable of sweeps? Or are these AC and DC operating point only at this point? Obviously one can edit the script, but.....
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Hi,
the script doesn't handle .control blocks (where sweeps would take place). It simply builds the circuit in a spice format. You can do whatever you want with the sources in a .control block
Offline
Pages: 1