From c50bf9a698c8dc3e99ab6f703fc8bb9d1da41ad6 Mon Sep 17 00:00:00 2001 From: couriersud Date: Mon, 25 Nov 2019 22:28:41 +0100 Subject: netlist: move nl_examples to src/lib/netlist/examples. (nw) One folder less in the top-level. --- src/lib/netlist/examples/cs.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/lib/netlist/examples/cs.cpp (limited to 'src/lib/netlist/examples/cs.cpp') diff --git a/src/lib/netlist/examples/cs.cpp b/src/lib/netlist/examples/cs.cpp new file mode 100644 index 00000000000..8229c5bc032 --- /dev/null +++ b/src/lib/netlist/examples/cs.cpp @@ -0,0 +1,27 @@ +// license:GPL-2.0+ +// copyright-holders:Couriersud +/* + * cs.c + * + */ + + +#include "netlist/devices/net_lib.h" + +NETLIST_START(cs) + + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-12) + PARAM(Solver.METHOD, "MAT_CR") + + /* Positive current flows into pin 1 of the current source + * Thus we observe a negative voltage on R1.1 ! + */ + CS(CS1, 1e-3) + RES(R1, 1000) + + NET_C(CS1.1, R1.1) + NET_C(GND, CS1.2, R1.2) + + LOG(log_P, R1.1) +NETLIST_END() -- cgit v1.2.3-70-g09d2