diff --git a/crates/applications/stacked_cores/scripts/inverter_characteristics.py b/crates/applications/stacked_cores/scripts/inverter_characteristics.py index 527223a..8c4dd5e 100644 --- a/crates/applications/stacked_cores/scripts/inverter_characteristics.py +++ b/crates/applications/stacked_cores/scripts/inverter_characteristics.py @@ -60,6 +60,16 @@ class Piecewise: (x, y + shift) for (x, y) in self.xy ]) + def scaled_y(self, scale: float) -> 'Piecewise': + return Piecewise([ + (x, y * scale) for (x, y) in self.xy + ]) + + def clipped(self, min_: float = 0.00, max_: float = 1.0) -> 'Piecewise': + return Piecewise([ + (x, min(max_, max(min_, y))) for (x, y) in self.xy + ]) + def line_for(self, x: float) -> Line: for first_lower in self.xy[:-1][::-1]: if first_lower[0] < x: break diff --git a/crates/applications/stacked_cores/scripts/plot_inverters.py b/crates/applications/stacked_cores/scripts/plot_inverters.py index 6847c80..7a4b058 100755 --- a/crates/applications/stacked_cores/scripts/plot_inverters.py +++ b/crates/applications/stacked_cores/scripts/plot_inverters.py @@ -76,12 +76,24 @@ for (name, curve) in [ # ("40 10x 5:1 (600um, 5e10 I)", fwd_40_600um_10_5_1_5e10.logically_inverted()), # ("40 10x 9:1 (800um, 5e10 I)", fwd_40_800um_10_9_1_5e10.logically_inverted()), - ("40 24x 3:1 (800um, 1e11 I)", fwd_40_800um_24_3_1_1e11.logically_inverted()), - ("40 18x 5:1 (800um, 1e11 I)", fwd_40_800um_18_5_1_1e11.logically_inverted()), + # ("40 24x 3:1 (800um, 1e11 I)", fwd_40_800um_24_3_1_1e11.logically_inverted()), + # ("40 18x 5:1 (800um, 1e11 I)", fwd_40_800um_18_5_1_1e11.logically_inverted()), + # ("40 18x 5:1 (800um, 5e10 I)", fwd_40_800um_18_5_1_5e10.logically_inverted()), + # ("40 12x 7:1 (800um, 1e11 I)", fwd_40_800um_12_7_1_1e11.logically_inverted()), + # ("40 12x 7:1 (800um, 5e10 I)", fwd_40_800um_12_7_1_5e10.logically_inverted()), + # ("40 10x 9:1 (800um, 2e11 I)", fwd_40_800um_10_9_1_2e11.logically_inverted()), + # ("40 10x 9:1 (800um, 5e10 I)", fwd_40_800um_10_9_1_5e10.logically_inverted()), + + + # ("40 18x 5:1 (800um, 1e11 I)", fwd_40_800um_18_5_1_1e11.logically_inverted()), + # ("40 18x 5:1 (800um, 1e11 I) + 0.3", fwd_40_800um_18_5_1_1e11.logically_inverted().shifted_y(0.3)), + ("40 12x 7:1 (800um, 1e11 I)", fwd_40_800um_12_7_1_1e11.logically_inverted()), - ("40 12x 7:1 (800um, 5e10 I)", fwd_40_800um_12_7_1_5e10.logically_inverted()), - ("40 10x 9:1 (800um, 2e11 I)", fwd_40_800um_10_9_1_2e11.logically_inverted()), - ("40 10x 9:1 (800um, 5e10 I)", fwd_40_800um_10_9_1_5e10.logically_inverted()), + ("40 12x 7:1 (800um, 1e11 I) x 1.5", fwd_40_800um_12_7_1_1e11.scaled_y(1.5).clipped().logically_inverted()), + ("40 12x 7:1 (800um, 1e11 I) x 2.0", fwd_40_800um_12_7_1_1e11.scaled_y(2.0).clipped().logically_inverted()), + # ("40 12x 7:1 (800um, 5e10 I)", fwd_40_800um_12_7_1_5e10.logically_inverted()), + # ("40 12x 7:1 (800um, 5e10 I)", fwd_40_800um_12_7_1_5e10.scaled_y(1.5).logically_inverted()), + # ("40 12x 7:1 (800um, 5e10 I)", fwd_40_800um_12_7_1_5e10.scaled_y(2.0).logically_inverted()), ]: curve.plot(title = f"{name} mapping") curve.logically_inverted().plot_slope(title = f"{name} slope")