[Pkg-electronics-commits] [gnucap] 02/43: transient-5: testing, bugfix: trsteporder range check
felix salfelder
felix-guest at moszumanska.debian.org
Wed Oct 4 03:21:43 UTC 2017
This is an automated email from the git hooks/post-receive script.
felix-guest pushed a commit to branch master
in repository gnucap.
commit 2c4f8fa128f8d9485c8258c49b397c03f362c7be
Author: al davis <ad211 at freeelectron.net>
Date: Mon Sep 26 22:12:43 2016 -0400
transient-5: testing, bugfix: trsteporder range check
---
apps/s_fo.cc | 4 ++--
apps/s_tr_swp.cc | 6 ++---
include/patchlev.h | 2 +-
lib/e_elemnt.cc | 5 +++--
lib/u_opt2.cc | 4 ++--
tests/==out/c_measure.1s.ckt.out | 46 ++++++++++++++++++++++++++++++++++++++
tests/==out/c_measure.2s.ckt.out | 39 ++++++++++++++++++++++++++++++++
tests/==out/s_tr.6.gc.out | 2 ++
tests/==out/s_tr.6r.gc.out | 22 ++++++++++++++++++
tests/c_measure.1s.ckt | 48 ++++++++++++++++++++++++++++++++++++++++
tests/c_measure.2s.ckt | 12 ++++++++++
tests/s_tr.6r.gc | 9 ++++++++
12 files changed, 189 insertions(+), 10 deletions(-)
diff --git a/apps/s_fo.cc b/apps/s_fo.cc
index e982e8b..b8fe98d 100644
--- a/apps/s_fo.cc
+++ b/apps/s_fo.cc
@@ -1,4 +1,4 @@
-/*$Id: s_fo.cc 2016/09/22 al $ -*- C++ -*-
+/*$Id: s_fo.cc 2016/09/26 al $ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -129,7 +129,7 @@ void FOURIER::store_results(double X)
_fdata[ii][_stepno] = p->value();
++ii;
}
- }else{untested();
+ }else{
}
}
/*--------------------------------------------------------------------------*/
diff --git a/apps/s_tr_swp.cc b/apps/s_tr_swp.cc
index ce81962..e519d38 100644
--- a/apps/s_tr_swp.cc
+++ b/apps/s_tr_swp.cc
@@ -1,4 +1,4 @@
-/*$Id: s_tr_swp.cc 2016/09/22 al $ -*- C++ -*-
+/*$Id: s_tr_swp.cc 2016/09/26 al $ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -135,9 +135,9 @@ void TRANSIENT::sweep()
int outflags = ofNONE;
if (printnow) {
outflags = ofPRINT | ofSTORE | ofKEEP;
- }else if (_accepted) {untested();
+ }else if (_accepted) {
outflags = ofSTORE;
- }else{untested();
+ }else{
}
outdata(_sim->_time0, outflags);
}
diff --git a/include/patchlev.h b/include/patchlev.h
index b557a01..0bfb3c9 100644
--- a/include/patchlev.h
+++ b/include/patchlev.h
@@ -1 +1 @@
-#define PATCHLEVEL "unstable 2016.09.23"
+#define PATCHLEVEL "transient-5 2016.09.26"
diff --git a/lib/e_elemnt.cc b/lib/e_elemnt.cc
index 5c8f3d3..7fce217 100644
--- a/lib/e_elemnt.cc
+++ b/lib/e_elemnt.cc
@@ -1,4 +1,4 @@
-/*$Id: e_elemnt.cc 2016/09/22 al $ -*- C++ -*-
+/*$Id: e_elemnt.cc 2016/09/26 al $ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -426,7 +426,8 @@ double ELEMENT::tr_review_trunc_error(const FPOLY1* q)
// now c[i] is i'th derivative
assert(OPT::_keep_time_steps >= 5);
- trace0(("ts" + long_label()).c_str());
+ trace4(("ts " + long_label()).c_str(), error_deriv, error_factor(),
+ OPT::trsteporder, OPT::trstepcoef[OPT::trsteporder] );
trace5("time", _time[0], _time[1], _time[2], _time[3], _time[4]);
trace5("charge", q[0].f0, q[1].f0, q[2].f0, q[3].f0, q[4].f0);
trace5("deriv", c[0], c[1], c[2], c[3], c[4]);
diff --git a/lib/u_opt2.cc b/lib/u_opt2.cc
index cb43050..ac4434b 100644
--- a/lib/u_opt2.cc
+++ b/lib/u_opt2.cc
@@ -1,4 +1,4 @@
-/*$Id: u_opt2.cc,v 26.137 2010/04/10 02:37:33 al Exp $ -*- C++ -*-
+/*$Id: u_opt2.cc 2016/09/26 $ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -148,7 +148,7 @@ bool OPT::set_values(CS& cmd)
|| Get(cmd, "trstephold", &trstephold, mPOSITIVE)
|| Get(cmd, "trstepshrink", &trstepshrink,mPOSITIVE)
|| Get(cmd, "trreject", &trreject, mPOSITIVE)
- || Get(cmd, "trsteporder", &trsteporder)
+ || (Get(cmd, "trsteporder", &trsteporder) && (trsteporder = to_range(1,trsteporder,3)))
|| Get(cmd, "trstepcoef1", &trstepcoef[1])
|| Get(cmd, "trstepcoef2", &trstepcoef[2])
|| Get(cmd, "trstepcoef3", &trstepcoef[3])
diff --git a/tests/==out/c_measure.1s.ckt.out b/tests/==out/c_measure.1s.ckt.out
new file mode 100644
index 0000000..b949080
--- /dev/null
+++ b/tests/==out/c_measure.1s.ckt.out
@@ -0,0 +1,46 @@
+'''''
+#Time v(1) control(0) eventtime(s1) eventtime(s2) nexttime(C1) eventtime(C1) nexttime(Vv1) eventtime(Vv1) dt(C1)
+ 0. 2. 1. 0. 0. 0. 0. 0. 100.p ??
+ 100.p 200.n 1. 0. 0. 154.4n 0. 28.702n 500.p 41.p
+ 200.p -66.662n 1. 0. 0. 240.46p 0. 0. 500.p 30.p
+ 300.p 46.399n 1. 462.29u 320.05u 389.12p 0. 0. 500.p 35.p
+ 400.p 39.535n 1. 789.17u 546.35u 528.83p 0. 0. 500.p 50.p
+ 500.p -37.985n 1. 0. 0. 677.03p 0. 0. 600.p 100.p
+ 600.p 2. 1. 0. 0. 52.016n 0. 35.009n 1.n 31.p
+ 700.p 2. 1. 0. 0. 756.14p 0. 752.76p 1.n 25.p
+ 800.p 2. 1. 0. 0. 881.51p 0. 0. 1.n 50.p
+ 900.p 2. 1. 0. 0. 1.0061n 0. 0. 1.n 50.p
+ 1.n 2. 1. 367.05u 576.79u 1.1311n 0. 0. 1.1n 100.p
+ 1.1n 200.n 1. 0. 0. 62.791n 0. 26.48n 1.5n 41.p
+ 1.2n -17.117n 1. 0. 0. 1.2741n 0. 0. 1.5n 23.377p
+ 1.3n -14.585n 1. 0. 0. 1.4584n 0. 0. 1.5n 50.p
+ 1.4n 14.013n 1. 0.0045458 0.0031471 1.6468n 0. 0. 1.5n 100.p
+ 1.5n -13.463n 1. 0. 0. 1.8418n 0. 129.78n 1.6n 100.p
+ 1.6n 2. 1. 0. 0. 57.476n 0. 38.625n 2.n 33.p
+ 1.7n 2. 1. 0. 0. 1.7504n 0. 1.7611n 2.n 100.p
+ 1.8n 2. 1. 0. 0. 1.9088n 0. 1.8777n 2.n 50.p
+ 1.9n 2. 1. 0. 0. 1.9941n 0. 0. 2.n 50.p
+ 2.n 2. 1. 0. 0. 2.0992n 0. 214.29n 2.1n 50.p
+vmax= 2.00000018461524
+t1= 565.00001p
+t2= 55.00001p
+vol2= 1.60000014769219
+vol1= 0.400000036923048
+vmax= 2.00000018461524
+midpoint= 1.00000009230762
+t3= 550.000014615381p
+t4= 1.55000001461538n
+t5= 1.55000001461538n
+tmin= 125.p
+vmin=-170.370096n
+slew=(( 1.60000014769219- 0.400000036923048)/( 580.00001738461p- 520.000010639657p))
+slew= 19.9999995978347E+9
+slew=(( 1.60000014769219- 0.400000036923048)/( 1.58000001738461n- 1.52000001045705n))
+slew= 19.9999995369658E+9
+slew= 19.999999597835G
+frequency= 1.E+9
+t4= 550.000014615381p
+t3= 1.55000001461538n
+frequency=-1.E+9
+tvmax= 1.7n
+tvmax= 1.7n
diff --git a/tests/==out/c_measure.2s.ckt.out b/tests/==out/c_measure.2s.ckt.out
new file mode 100644
index 0000000..3a47044
--- /dev/null
+++ b/tests/==out/c_measure.2s.ckt.out
@@ -0,0 +1,39 @@
+'measures
+#Time v(1)
+ 0. 0.
+ 100.u 0.58779
+ 200.u 0.95106
+ 300.u 0.95106
+ 400.u 0.58779
+ 500.u 0.
+ 600.u -0.58779
+ 700.u -0.95106
+ 800.u -0.95106
+ 900.u -0.58779
+ 0.001 0.
+ 0.0011 0.58779
+ 0.0012 0.95106
+ 0.0013 0.95106
+ 0.0014 0.58779
+ 0.0015 0.
+ 0.0016 -0.58779
+ 0.0017 -0.95106
+ 0.0018 -0.95106
+ 0.0019 -0.58779
+ 0.002 0.
+ 0.0021 0.58779
+ 0.0022 0.95106
+ 0.0023 0.95106
+ 0.0024 0.58779
+ 0.0025 0.
+ 0.0026 -0.58779
+ 0.0027 -0.95106
+ 0.0028 -0.95106
+ 0.0029 -0.58779
+ 0.003 0.
+a1= 2.88332060289773u
+m1= 961.106867632578u
+r1= 0.713091276688152
+a2= 313.098848505665u
+m2= 0.208732565670443
+r2= 0.712354678159851
diff --git a/tests/==out/s_tr.6.gc.out b/tests/==out/s_tr.6.gc.out
index 00a69c7..f382168 100644
--- a/tests/==out/s_tr.6.gc.out
+++ b/tests/==out/s_tr.6.gc.out
@@ -4,11 +4,13 @@
#Time v(1)
0. 0.
0.01 1.
+ 0.02 1.
1. 1.
"r1 (2 0) 1 "
".tran "
#Time v(1)
0. 0.
0.01 1.
+ 0.02 1.
1. 1.
".end "
diff --git a/tests/==out/s_tr.6r.gc.out b/tests/==out/s_tr.6r.gc.out
new file mode 100644
index 0000000..b67637f
--- /dev/null
+++ b/tests/==out/s_tr.6r.gc.out
@@ -0,0 +1,22 @@
+"v1 (1 0) pulse (0 1) "
+".print tran v(1) timef(v1) errort(v1) eventt(v1) dtr(v1) "
+".tran 0 1 1 trace rejected "
+#Time v(1) timef(v1) errort(v1) eventt(v1) dtr(v1)
+ 0. 0. Inf 0. 0. Inf
+ 0.01 1. 0.02344 0.02344 0. 0.01344
+ 0.02 1. Inf 0. 0. Inf
+ 1. 1. Inf 0. 0. Inf
+"r1 (2 0) 1 "
+".tran trace rejected "
+#Time v(1) timef(v1) errort(v1) eventt(v1) dtr(v1)
+ 0. 0. Inf 0. 0. Inf
+ 0.01 1. 0.02344 0.02344 0. 0.01344
+ 0.02 1. Inf 0. 0. Inf
+ 1. 1. Inf 0. 0. Inf
+".status notime "
+Gnucap System status
+iterations: op=0, dc=0, tran=11, fourier=0, total=30
+transient timesteps: accepted=8, rejected=0, total=8
+nodes: user=2, subckt=0, model=0, total=2
+dctran density=50.0%, ac density=50.0%
+".end "
diff --git a/tests/c_measure.1s.ckt b/tests/c_measure.1s.ckt
new file mode 100644
index 0000000..906dbb7
--- /dev/null
+++ b/tests/c_measure.1s.ckt
@@ -0,0 +1,48 @@
+'''''
+R1 1 2 1
+C1 2 0 {cap*10}
+Vv1 1 0 dc=0 ac=0 pulse(2 0 0 100p 100p 400p 1n)
+
+s1 0 0 1 0 s01
+.model s01 sw vt="svt*1.3"
+s2 0 0 1 0 s02
+.model s02 sw vt="svt*0.9"
+
+.param cap=100f
+.param svt=1
+
+.store tran v(2) v(1)
+.print tran v(1) control(0) eventtime(s?) nexttime(C*) eventtime(C*) nexttime(V*) eventtime(V*) dt(C1)
+.tran 0 2n 100p
+
+.param vol2=vmax*0.8
+.param vol1=vmax*0.2
+.param midpoint={(vol1+vol2)/2}
+.param frequency={1/(t4-t3)}
+
+.measure vmax=max(probe="v(1)" end=900p begin=0)
+.measure t1=cross(probe="v(1)" end=1n cross=1.3 rise)
+.measure t2=cross(probe="v(1)" end=1n cross=.9 fall)
+.exp vol2
+.exp vol1
+.exp vmax
+.exp midpoint
+.measure t3=cross(probe="v(1)" end=1n cross=midpoint rise)
+.measure t4=cross(probe="v(1)" begin=t3 cross=midpoint rise)
+.measure t5=cross(probe="v(1)" begin=t3 cross={(vol1+vol2)/2} rise)
+.measure tmin=min(probe="v(1)" end=1n arg)
+.measure vmin=min(probe="v(1)" end=1n begin=0)
+.measure slew=slewrate(probe="v(1)" initial={vmax*0.2} final={vmax*0.8} expression)
+.exp slew
+.measure slew=slewrate(probe="v(1)" initial={vmax*0.2} final={vmax*0.8} expression last)
+.exp slew
+.measure slew=slewrate(probe="v(1)" initial={vmax*0.2} final={vmax*0.8})
+.exp frequency
+.measure t4=cross(probe="v(1)" cross=midpoint rise)
+.measure t3=cross(probe="v(1)" cross=midpoint rise last)
+.exp frequency
+.measure tvmax = max(probe="v(1)" arg)
+.measure tvmax = max(probe="v(1)" last arg)
+
+
+.end
diff --git a/tests/c_measure.2s.ckt b/tests/c_measure.2s.ckt
new file mode 100644
index 0000000..11861a6
--- /dev/null
+++ b/tests/c_measure.2s.ckt
@@ -0,0 +1,12 @@
+'measures
+V1 (1 0) sin(freq=1k ampl=1 peak zero)
+.print tran v(1)
+.store tran v(1)
+.tran 0 .003 .0001
+.measure a1=integral("v(1)")
+.measure m1=mean("v(1)")
+.measure r1=rms("v(1)")
+.measure a2=integral("v(1)", begin=0 end=.0015)
+.measure m2=mean("v(1)", begin=0 end=.0015)
+.measure r2=rms("v(1)", begin=0 end=.0015)
+.end
diff --git a/tests/s_tr.6r.gc b/tests/s_tr.6r.gc
new file mode 100644
index 0000000..aa99a1d
--- /dev/null
+++ b/tests/s_tr.6r.gc
@@ -0,0 +1,9 @@
+spice
+.option list trsteporder=9
+v1 (1 0) pulse (0 1)
+.print tran v(1) timef(v1) errort(v1) eventt(v1) dtr(v1)
+.tran 0 1 1 trace rejected
+r1 (2 0) 1
+.tran trace rejected
+.status notime
+.end
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-electronics/gnucap.git
More information about the Pkg-electronics-commits
mailing list