app: stacked_cores: more asymmetric-winding parameterizations

This commit is contained in:
colin 2022-09-25 16:20:04 -07:00
parent ebbaf4c697
commit cbd741c6df
3 changed files with 130 additions and 13 deletions

View File

@ -586,6 +586,8 @@ inv_39_2_0_15e10 = Piecewise(
fwd_40_12_3_1_5e10 = Piecewise(
[
[ -16453, -5877 ],
[ -16171, -5444 ],
[ -15617, -4900 ],
[ -15086, -4405 ],
[ -14357, -3941 ],
@ -605,6 +607,8 @@ fwd_40_12_3_1_5e10 = Piecewise(
[ 11605, 16367 ],
[ 12054, 16387 ],
[ 12411, 16402 ],
[ 13301, 16442 ],
[ 14146, 16474 ],
]
).normalized(17000)
@ -634,6 +638,8 @@ fwd_40_6_3_1_5e10 = Piecewise(
fwd_40_6_7_1_5e10 = Piecewise(
[
[ -16244, -8159 ],
[ -15756, -7835 ],
[ -14687, -7326 ],
[ -14108, -7030 ],
[ -13435, -6690 ],
@ -653,11 +659,15 @@ fwd_40_6_7_1_5e10 = Piecewise(
[ 9764, 10342 ],
[ 10753, 10874 ],
[ 11283, 11147 ],
[ 12329, 11657 ],
[ 13223, 12045 ],
]
).normalized(15000)
fwd_40_600um_20_3_1_5e10 = Piecewise(
[
[ -11623, -2886 ],
[ -10847, -2125 ],
[ -9878, -1348 ],
[ -9392, -985 ],
[ -8694, -508 ],
@ -677,11 +687,15 @@ fwd_40_600um_20_3_1_5e10 = Piecewise(
[ 7658, 12407 ],
[ 8037, 12562 ],
[ 8272, 12695 ],
[ 8790, 13075 ],
[ 9248, 13503 ],
]
).normalized(19000)
fwd_40_600um_20_3_1_1e11 = Piecewise(
[
[ -14284, -3414 ],
[ -13332, -2406 ],
[ -12167, -1233 ],
[ -11552, -655 ],
[ -10820, -93 ],
@ -694,17 +708,50 @@ fwd_40_600um_20_3_1_1e11 = Piecewise(
[ 1886, 9344 ],
[ 5011, 11888 ],
[ 6604, 12899 ],
[ 7358, 13302 ],
[ 7932, 13602 ],
[ 8423, 13730 ],
[ 8645, 13888 ],
[ 8942, 13962 ],
[ 9318, 14166 ],
[ 9554, 14252 ],
[ 10166, 14547 ],
[ 10774, 14789 ],
]
).normalized(15000)
fwd_40_600um_20_3_1_2e11 = Piecewise(
[
[ -17130, -2396 ],
[ -16555, -1969 ],
[ -15189, -1044 ],
[ -14486, -584 ],
[ -13641, -20 ],
[ -13147, 302 ],
[ -12539, 723 ],
[ -11816, 1218 ],
[ -11388, 1501 ],
[ -10882, 1826 ],
[ -10095, 2383 ],
[ -8747, 3406 ],
[ 747, 8265 ],
[ 6051, 9708 ],
[ 8022, 10412 ],
[ 8421, 10382 ],
[ 8817, 10592 ],
[ 9116, 10658 ],
[ 9620, 10803 ],
[ 10324, 11056 ],
[ 10785, 11303 ],
[ 11938, 11738 ],
[ 13090, 12062 ],
]
).normalized(15000)
fwd_40_600um_12_5_1_1e11 = Piecewise(
[
[ -14026, -4901 ],
[ -13014, -4368 ],
[ -11814, -3658 ],
[ -11192, -3265 ],
[ -10456, -2801 ],
@ -713,19 +760,54 @@ fwd_40_600um_12_5_1_1e11 = Piecewise(
[ -8805, -1836 ],
[ -8362, -1556 ],
[ -7702, -1105 ],
[ -4268, 1258 ],
[ 315, 4617 ],
[ 2810, 7246 ],
[ 4359, 9016 ],
[ 5225, 9707 ],
[ 5981, 10366 ],
[ 6782, 10836 ],
[ 7084, 11037 ],
[ 7501, 11328 ],
[ 8045, 11716 ],
[ 8395, 12070 ],
[ 9248, 12388 ],
[ 10140, 13087 ],
]
).normalized(13000)
).normalized(14000)
fwd_40_600um_12_5_1_2e11 = Piecewise(
[
[ -17015, -1518 ],
[ -16471, -1243 ],
[ -15036, -499 ],
[ -14316, -134 ],
[ -13477, 290 ],
[ -12998, 524 ],
[ -12426, 801 ],
[ -11761, 1134 ],
[ -11372, 1315 ],
[ -10905, 1547 ],
[ -10172, 1926 ],
[ -8733, 2765 ],
[ -1335, 6369 ],
[ 3759, 8707 ],
[ 6392, 9509 ],
[ 7090, 9733 ],
[ 7637, 9681 ],
[ 8041, 9839 ],
[ 8724, 9855 ],
[ 9635, 10142 ],
[ 10214, 10435 ],
[ 11594, 10686 ],
[ 12900, 10836 ],
]
).normalized(14000)
fwd_40_600um_6_11_1_5e10 = Piecewise(
[
[ -10841, -10684 ],
[ -10118, -10416 ],
[ -9209, -10033 ],
[ -8755, -9809 ],
[ -8113, -9520 ],
@ -745,6 +827,8 @@ fwd_40_600um_6_11_1_5e10 = Piecewise(
[ 4496, -4826 ],
[ 4942, -4641 ],
[ 5175, -4562 ],
[ 5884, -4342 ],
[ 6611, -4071 ],
]
).normalized(11000)
@ -758,9 +842,9 @@ for (name, curve) in [
# ("fake slope-change (delayed, flipped)", fwd_fake_slope_change_after_0_5.logically_inverted_x().logically_inverted()),
# ("fake hill", fwd_fake_hill.logically_inverted()),
# ("fake asymmetric hill", fwd_fake_asymmetric_hill.logically_inverted()),
("fake asymmetric flats", fwd_fake_asymmetric_flats.logically_inverted()),
("fake asymmetric overdrive", fwd_fake_asymmetric_overdrive.logically_inverted()),
("fake asymmetric bottom out", fwd_fake_asymmetric_bottom_out.logically_inverted()),
# ("fake asymmetric flats", fwd_fake_asymmetric_flats.logically_inverted()),
# ("fake asymmetric overdrive", fwd_fake_asymmetric_overdrive.logically_inverted()),
# ("fake asymmetric bottom out", fwd_fake_asymmetric_bottom_out.logically_inverted()),
# ("18", fwd_18.logically_inverted()),
# ("24 5:1 (2e10 I)", fwd_24_5_1_2e10.logically_inverted()),
@ -785,11 +869,13 @@ for (name, curve) in [
# ("40 6x 3:1 (400um, 5e10 I)", fwd_40_6_3_1_5e10.logically_inverted()),
# ("40 6x 7:1 (400um, 5e10 I)", fwd_40_6_7_1_5e10.logically_inverted()),
# ("40 20x 3:1 (600um, 5e10 I)", fwd_40_600um_20_3_1_5e10.logically_inverted()),
# ("40 20x 3:1 (600um, 5e10 I)-flipped-xy", fwd_40_600um_20_3_1_5e10.logically_inverted_x()),
# # ("40 20x 3:1 (600um, 5e10 I)-flipped-xy", fwd_40_600um_20_3_1_5e10.logically_inverted_x()),
# # ("40 20x 3:1 (600um, 5e10 I)-flipped", fwd_40_600um_20_3_1_5e10.logically_inverted_x()),
# # ("40 20x 3:1 (600um, 5e10 I)-shifted", fwd_40_600um_20_3_1_5e10.shifted_x(-0.10).logically_inverted()),
# ("40 20x 3:1 (600um, 1e11 I)", fwd_40_600um_20_3_1_1e11.logically_inverted()),
# ("40 12x 5:1 (600um, 1e11 I)", fwd_40_600um_12_5_1_1e11.logically_inverted()),
# ("40 20x 3:1 (600um, 2e11 I)", fwd_40_600um_20_3_1_2e11.logically_inverted()),
("40 12x 5:1 (600um, 1e11 I)", fwd_40_600um_12_5_1_1e11.logically_inverted()),
("40 12x 5:1 (600um, 2e11 I)", fwd_40_600um_12_5_1_2e11.logically_inverted()),
# ("40 6x 11:1 (600um, 5e10 I)", fwd_40_600um_6_11_1_5e10.logically_inverted()),
]:
curve.plot(title = f"{name} mapping")

View File

@ -5,6 +5,7 @@ to extract higher-level info from them.
"""
import os
import sys
import re
from stacked_cores import load_csv, labeled_rows, last_row_before_t, extract_m
@ -19,18 +20,35 @@ def extract_one(path: str, t_first: float, t_last: float):
return m_init[0], m_fini[-1]
def extract_polarity(stem: str) -> float:
s = None
if re.search("-p\d\d\d", stem):
s = re.search("-p\d\d\d", stem).group(0)
if re.search("-n\d\d\d", stem):
s = re.search("-n\d\d\d", stem).group(0)
if s:
sign = {'n': -1, 'p': 1}[s[1]]
mag = int(s[2:])
return sign * mag * 0.01
if "-000" in stem:
return 0.00
def extract_39xx(base_path: str, t_first: str = "2e-9", t_last: str = "3e-9"):
base_dir, prefix = os.path.split(base_path)
mappings = {}
for entry in os.listdir(base_dir):
if entry.startswith(prefix):
(input_, output) = extract_one(os.path.join(base_dir, entry, "meas.csv"), float(t_first), float(t_last))
mappings[int(round(input_))] = int(round(output))
polarity = extract_polarity(entry)
mappings[int(round(input_))] = (int(round(output)), polarity)
print("Piecewise(")
print(" [")
for i, o in sorted(mappings.items()):
print(f" [ {i:6}, {o:6} ],")
for i, (o, polarity) in sorted(mappings.items()):
comment = f" # {polarity:.2}" if polarity is not None else ""
print(f" [ {i:6}, {o:6} ],{comment}")
print(" ]")
print(")")

View File

@ -3794,8 +3794,8 @@ fn main() {
("n050", -0.50),
("p020", 0.20),
("n020", -0.20),
][..],
&[
// ][..],
// &[
("n080", -0.80),
("n030", -0.30),
("n010", -0.10),
@ -3812,14 +3812,27 @@ fn main() {
("p005", 0.05),
("p200", 2.00),
("n200", -2.00),
("p150", 1.50),
("n150", -1.50),
("n007", -0.07),
("n017", -0.17),
("n013", -0.13),
][..],
] {
for (coupling_loops, s0_loops, s_major, cur_str, cur_flt) in [
(12, 2, um(600), "5e10", 5e10),
(8, 3, um(600), "5e10", 5e10),
(6, 4, um(600), "5e10", 5e10),
(20, 1, um(600), "3e10", 3e10),
(8, 3, um(600), "1e11", 1e11),
(6, 4, um(600), "1e11", 1e11),
(12, 2, um(600), "1e11", 1e11),
(20, 1, um(600), "5e10", 5e10),
(20, 1, um(600), "1e11", 1e11),
// (12, 2, um(600), "2e11", 2e11), // higher current actually weakens transfer (why?)
// (20, 1, um(600), "2e11", 2e11),
(20, 1, um(600), "2e11", 2e11),
(12, 2, um(600), "2e11", 2e11), // higher current actually weakens transfer (why?)
(12, 1, um(400), "5e10", 5e10),
// (4, 5, um(400), "5e10", 5e10), // doesn't transition enough on p100