summaryrefslogtreecommitdiffstatshomepage
path: root/nl_examples/cs.cpp
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2019-09-10 21:42:28 +0200
committer couriersud <couriersud@gmx.org>2019-09-12 01:02:01 +0200
commit9ea16d24e26218e505ef2a947ad89c99e19abc78 (patch)
treee7d9bf8c4ba464d87ac626915a4e3e6fceade023 /nl_examples/cs.cpp
parent0c02c8aa076d5be078d811ca5e3d6256ae5f6e7e (diff)
nl_examples: commit some long overdue changes. (nw)
Diffstat (limited to 'nl_examples/cs.cpp')
-rw-r--r--nl_examples/cs.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/nl_examples/cs.cpp b/nl_examples/cs.cpp
new file mode 100644
index 00000000000..8229c5bc032
--- /dev/null
+++ b/nl_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()