app: stacked_cores: try varying the number of control loops separately from the coupling loops
doesn't make a huge difference, apparently.
This commit is contained in:
@@ -125,6 +125,13 @@ class Piecewise:
|
||||
def slope_df(self, from_: float = 0.0, to: float = 1.0, points: int = 101) -> DataFrame:
|
||||
return self.df_for(from_, to, points, self.get_slope)
|
||||
|
||||
def min_max_slope(self):
|
||||
slope = [self.get_slope(0.01*x) for x in range(101)]
|
||||
return min(slope), max(slope)
|
||||
|
||||
def max_abs_slope(self) -> float:
|
||||
return max(abs(s) for s in self.min_max_slope())
|
||||
|
||||
def plot_for(self, from_: float, to: float, title: str, f):
|
||||
df = self.df_for(from_, to, points=101, f=f)
|
||||
fig = px.line(df, x="x", y="y", title=title)
|
||||
|
@@ -118,12 +118,14 @@ of_interest += [(p, get_meas(p)) for p in
|
||||
|
||||
|
||||
# plot all viable inverters
|
||||
# of_interest += filter_meas(run="41", rad_um=400, viable_inverter=True)
|
||||
of_interest += filter_meas(run="41", viable_inverter=True)
|
||||
# of_interest += filter_meas(run="42", rad_um=400, couplings=4)
|
||||
# of_interest += filter_meas(run="42", rad_um=400, couplings=9)
|
||||
# of_interest += filter_meas(run="42", rad_um=400, couplings=2)
|
||||
# of_interest += filter_meas(run="42", rad_um=400, couplings=6)
|
||||
of_interest += filter_meas(run="43")
|
||||
# of_interest += filter_meas(run="43")
|
||||
|
||||
of_interest.sort(key=lambda i: -i[1].max_abs_slope())
|
||||
|
||||
for (params, curve) in of_interest:
|
||||
if not params.is_inverter:
|
||||
|
@@ -72,6 +72,11 @@ class SimParams:
|
||||
)
|
||||
return self.tuple == match_tuple
|
||||
|
||||
def ensure_inverter(self, curve):
|
||||
if not self.is_inverter:
|
||||
return curve.logically_inverted()
|
||||
return curve
|
||||
|
||||
class SimParams40(SimParams):
|
||||
@property
|
||||
def run(self) -> str:
|
||||
@@ -260,7 +265,7 @@ def filter_meas(run: str = None, rad_um: int = None, drive: float = None, coupli
|
||||
if p.matches(run, rad_um, drive, couplings, wrappings) \
|
||||
and get_meas(p) \
|
||||
and get_meas(p).num_pieces > 0 \
|
||||
and matches(get_meas(p).logically_inverted().is_viable_inverter(), viable_inverter)
|
||||
and matches(p.ensure_inverter(get_meas(p)).is_viable_inverter(), viable_inverter)
|
||||
],
|
||||
key = lambda v: v[0].tuple
|
||||
)
|
||||
|
Reference in New Issue
Block a user