Command line interface (CLI)
You can analyze a circuit using the rtds-circuit-analysis command on the terminal. Some basic examples on how to use
this program are found in the quickstart section.
All other relevant information can be found by running the rtds-circuit-analysis -h help command. Below is a copy of
this command’s output. There are some small caveats you should keep in mind when writing the commands.
The rules for writing this are the same ones for writing the
component values.
Finds the equations that describe a circuit written as a netlist
usage: rtds-circuit-analysis [filepath] [options]
Positional Arguments
- filepath
Path for the netlist
Named Arguments
- -i, --currents
Prints the currents for each of the COMPONENTS. If COMPONENTS are not specified, prints the currentsthrough all components.
- -v, --component-voltages
Prints the voltages for each of the COMPONENTS. If COMPONENTS are not specified, prints the voltage dropsacross all components
- -n, --node-voltages
Prints the voltages for each of the NODES. If NODES are not specified, prints the voltages at all nodes
- -s, --states
Prints the continuous state equations for each of the COMPONENTS. If COMPONENTS are not specified, printsthe state equations through all energy storing components.
- -f, --forward
Prints the discrete state equations for each of the COMPONENTS, using the forward method. If COMPONENTSare not specified, prints the state equations through all energy storing components.
- -b, --backward
Prints the discrete state equations for each of the COMPONENTS, using the backward method. If COMPONENTSare not specified, prints the state equations through all energy storing components.
- -t, --trapezoidal
Prints the discrete state equations for each of the COMPONENTS, using the trapezoidal method. IfCOMPONENTS are not specified, prints the state equations through all energy storing components.
- -T, --time-step
Sets the time step for the discrete methods. If not set, the discrete methods will have “Ts” as a literalfor the timestep. Will take precedence over the netlist’s .STEP, if set.
The rules for writing the time step are the same ones for writing the component values.
Caveats
The options must always be written after the netlist file path, never before. So,
rtds-circuit-analysis -v circuit.cirwon’t work, runrtds-circuit-analysis circuit.cir -vinstead.Due to limitations of python’s argparse library, you can’t concatenate flags together in a single dash. So, things like
rtds-circuit-analysis circuit.cir -ivnfor printing all component currents, component voltages and node voltages won’t work. Instead, write the flags separately, likertds-circuit-analysis circuit.cir -i -v -n.If you write multiple flags for the circuit, the information will be printed always in the same order (currents, component voltage, node voltage, continuous states, forward, backward and trapezoidal), regardless of the flags positions. So,
rtds-circuit-analysis circuit.cir -n -iwill print out the current first, even if-nwas written before.