-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfit_direct_transport_equations.py
More file actions
583 lines (531 loc) · 21.9 KB
/
fit_direct_transport_equations.py
File metadata and controls
583 lines (531 loc) · 21.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
import argparse
import csv
import math
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.lines import Line2D
from scipy.optimize import least_squares
from direct_transport_constraints import (
GLOBAL_PARAMETER_ORDER,
get_constraint_preset,
)
from fit_dciv_experiment import (
diameter_nm_to_area_m2,
display_insulator_name,
infer_segment_slices,
load_experimental_data,
)
SEGMENT_COLORS = {
"0→-V": "#1f77b4",
"-V→0": "#9467bd",
"0→+V": "#ff7f0e",
"+V→0": "#2ca02c",
}
MECHANISM_NAMES = ("thermionic", "pf_fe", "pf_il", "background")
def thermal_ev(temperature_k: float) -> float:
return 8.617333262145e-5 * temperature_k
def direct_transport_base_terms(
voltage_v: np.ndarray,
temperature_k: float,
top_phi_ev: float,
top_gamma_ev_per_sqrt_v: float,
log10_top_prefactor_a: float,
bottom_phi_ev: float,
bottom_gamma_ev_per_sqrt_v: float,
log10_bottom_prefactor_a: float,
trap_depth_ev: float,
pf_fe_beta_ev_per_sqrt_v: float,
log10_pf_fe_prefactor_a_per_v: float,
pf_il_beta_ev_per_sqrt_v: float,
log10_pf_il_prefactor_a_per_v: float,
log10_background_conductance_a_per_v: float,
log10_current_floor_a: float,
):
voltage_v = np.asarray(voltage_v, dtype=float)
vmag = np.abs(voltage_v)
sqrt_v = np.sqrt(np.maximum(vmag, 0.0))
k_t_ev = max(thermal_ev(temperature_k), 1e-12)
top_prefactor_a = 10.0 ** log10_top_prefactor_a
bottom_prefactor_a = 10.0 ** log10_bottom_prefactor_a
pf_fe_prefactor_a_per_v = 10.0 ** log10_pf_fe_prefactor_a_per_v
pf_il_prefactor_a_per_v = 10.0 ** log10_pf_il_prefactor_a_per_v
background_conductance_a_per_v = 10.0 ** log10_background_conductance_a_per_v
current_floor_a = 10.0 ** log10_current_floor_a
top_effective_barrier_ev = np.maximum(
top_phi_ev - top_gamma_ev_per_sqrt_v * sqrt_v,
0.0,
)
bottom_effective_barrier_ev = np.maximum(
bottom_phi_ev - bottom_gamma_ev_per_sqrt_v * sqrt_v,
0.0,
)
top_thermionic_a = top_prefactor_a * np.exp(-top_effective_barrier_ev / k_t_ev)
bottom_thermionic_a = bottom_prefactor_a * np.exp(-bottom_effective_barrier_ev / k_t_ev)
thermionic_a = np.where(voltage_v >= 0.0, top_thermionic_a, bottom_thermionic_a)
pf_fe_activation_ev = np.maximum(
trap_depth_ev - pf_fe_beta_ev_per_sqrt_v * sqrt_v,
0.0,
)
pf_il_activation_ev = np.maximum(
trap_depth_ev - pf_il_beta_ev_per_sqrt_v * sqrt_v,
0.0,
)
pf_fe_a = pf_fe_prefactor_a_per_v * vmag * np.exp(-pf_fe_activation_ev / k_t_ev)
pf_il_a = pf_il_prefactor_a_per_v * vmag * np.exp(-pf_il_activation_ev / k_t_ev)
background_a = background_conductance_a_per_v * vmag
current_floor_array_a = np.full_like(voltage_v, current_floor_a, dtype=float)
return {
"current_floor_a": current_floor_array_a,
"thermionic_a": thermionic_a,
"pf_fe_a": pf_fe_a,
"pf_il_a": pf_il_a,
"background_a": background_a,
"top_effective_barrier_ev": top_effective_barrier_ev,
"bottom_effective_barrier_ev": bottom_effective_barrier_ev,
"pf_fe_activation_ev": pf_fe_activation_ev,
"pf_il_activation_ev": pf_il_activation_ev,
}
def build_output_path(args: argparse.Namespace):
if args.output is not None:
return Path(args.output)
insulator_label = display_insulator_name(args.insulator)
il_label = f"{args.il_nm:g}nm"
return Path(
f"{int(args.fe_thickness_nm)}nm_figures/"
f"Ti_{insulator_label}_AlScN_Al_{il_label}_direct_transport_segmented_fit_5curves.png"
)
def mean_abs_log10_error(measured_a: np.ndarray, model_a: np.ndarray):
errors = [
abs(math.log10(abs(model)) - math.log10(abs(measured)))
for measured, model in zip(measured_a, model_a)
if abs(measured) > 0 and abs(model) > 0
]
return float(sum(errors) / len(errors)) if errors else float("nan")
def build_disjoint_segments(voltage_v: np.ndarray):
coarse_segments = infer_segment_slices(voltage_v)
if len(coarse_segments) < 3:
return [(f"seg{i + 1}", segment) for i, segment in enumerate(coarse_segments)]
first = coarse_segments[0]
middle = slice(coarse_segments[1].start + 1, coarse_segments[1].stop)
last = slice(coarse_segments[2].start + 1, coarse_segments[2].stop)
segments = [("0→-V", first)]
middle_voltage = voltage_v[middle]
zero_matches = np.where(np.isclose(middle_voltage, 0.0, atol=1e-12))[0]
if zero_matches.size > 0:
zero_abs = middle.start + int(zero_matches[0])
if middle.start < zero_abs + 1:
segments.append(("-V→0", slice(middle.start, zero_abs + 1)))
if zero_abs + 1 < middle.stop:
segments.append(("0→+V", slice(zero_abs + 1, middle.stop)))
else:
negative_or_zero = np.where(middle_voltage <= 0.0)[0]
if negative_or_zero.size > 0 and negative_or_zero[-1] + 1 < middle_voltage.size:
split_abs = middle.start + int(negative_or_zero[-1] + 1)
segments.append(("-V→0", slice(middle.start, split_abs)))
segments.append(("0→+V", slice(split_abs, middle.stop)))
else:
segments.append(("-V→+V", middle))
segments.append(("+V→0", last))
return [(label, seg) for label, seg in segments if seg.stop > seg.start]
def build_segment_index_map(voltage_v: np.ndarray):
segment_map = np.full(len(voltage_v), -1, dtype=int)
segment_definitions = build_disjoint_segments(voltage_v)
for segment_index, (_, segment_slice) in enumerate(segment_definitions):
segment_map[segment_slice] = segment_index
if np.any(segment_map < 0):
raise ValueError("Failed to assign every voltage point to a fit segment.")
return segment_definitions, segment_map
def normalized_segment_weights(raw_logs: np.ndarray):
raw_logs = np.asarray(raw_logs, dtype=float)
return 10.0 ** (raw_logs - np.mean(raw_logs))
def unpack_parameters(params, num_segments: int):
global_params = [float(value) for value in params[:13]]
offset = 13
weight_params = {}
for mechanism_name in MECHANISM_NAMES:
mechanism_raw = np.asarray(params[offset : offset + num_segments], dtype=float)
weight_params[mechanism_name] = normalized_segment_weights(mechanism_raw)
offset += num_segments
return global_params, weight_params
def build_weighted_model(base_terms, segment_index_map, weight_params):
total_a = np.asarray(base_terms["current_floor_a"], dtype=float).copy()
weighted_terms = {}
for mechanism_name in MECHANISM_NAMES:
mechanism_values = np.asarray(base_terms[f"{mechanism_name}_a"], dtype=float)
segment_weights = weight_params[mechanism_name][segment_index_map]
weighted = mechanism_values * segment_weights
weighted_terms[mechanism_name] = weighted
total_a += weighted
return total_a, weighted_terms
def main():
parser = argparse.ArgumentParser(
description="Fit direct transport equations to workbook DC I-V traces using shared transport constants and segment-specific mechanism weights."
)
parser.add_argument("--data", default="dciv_experimental.xlsx")
parser.add_argument("--device-diameter-nm", type=float, default=200.0)
parser.add_argument("--temperature-k", type=float, default=300.0)
parser.add_argument("--insulator", default="hfox")
parser.add_argument("--il-nm", type=float, default=4.0)
parser.add_argument("--fe-thickness-nm", type=float, default=10.0)
parser.add_argument(
"--constraint-preset",
default="physics-reasonable",
choices=("broad", "physics-reasonable", "literature-ready"),
)
parser.add_argument("--max-nfev", type=int, default=220)
parser.add_argument("--dpi", type=int, default=220)
parser.add_argument("--output", default=None)
args = parser.parse_args()
sweeps = load_experimental_data(Path(args.data))
if len(sweeps) < 2:
raise ValueError("Expected multiple sweeps in workbook for direct shared-parameter fitting.")
segment_definitions, reference_segment_index_map = build_segment_index_map(
sweeps[0].voltage_v
)
segment_labels = [label for label, _ in segment_definitions]
num_segments = len(segment_definitions)
for sweep in sweeps[1:]:
_, segment_index_map = build_segment_index_map(sweep.voltage_v)
if not np.array_equal(segment_index_map, reference_segment_index_map):
raise ValueError("All sweeps must share the same voltage segmentation.")
all_currents = np.concatenate([np.abs(sweep.current_a) for sweep in sweeps])
current_scale_a = max(np.percentile(all_currents, 10), 1e-12)
area_m2 = diameter_nm_to_area_m2(args.device_diameter_nm)
constraint_preset = get_constraint_preset(args.constraint_preset)
def residuals(params):
global_params, weight_params = unpack_parameters(params, num_segments)
(
top_phi_ev,
top_gamma,
log10_top_pref,
bottom_phi_ev,
bottom_gamma,
log10_bottom_pref,
trap_depth_ev,
pf_fe_beta,
log10_pf_fe_pref,
pf_il_beta,
log10_pf_il_pref,
log10_bg_cond,
log10_i_floor,
) = global_params
residual_parts = []
for sweep in sweeps:
_, segment_index_map = build_segment_index_map(sweep.voltage_v)
base_terms = direct_transport_base_terms(
voltage_v=sweep.voltage_v,
temperature_k=args.temperature_k,
top_phi_ev=top_phi_ev,
top_gamma_ev_per_sqrt_v=top_gamma,
log10_top_prefactor_a=log10_top_pref,
bottom_phi_ev=bottom_phi_ev,
bottom_gamma_ev_per_sqrt_v=bottom_gamma,
log10_bottom_prefactor_a=log10_bottom_pref,
trap_depth_ev=trap_depth_ev,
pf_fe_beta_ev_per_sqrt_v=pf_fe_beta,
log10_pf_fe_prefactor_a_per_v=log10_pf_fe_pref,
pf_il_beta_ev_per_sqrt_v=pf_il_beta,
log10_pf_il_prefactor_a_per_v=log10_pf_il_pref,
log10_background_conductance_a_per_v=log10_bg_cond,
log10_current_floor_a=log10_i_floor,
)
model_total_a, _ = build_weighted_model(
base_terms=base_terms,
segment_index_map=segment_index_map,
weight_params=weight_params,
)
lhs = np.abs(model_total_a)
rhs = np.abs(sweep.current_a)
residual_parts.append(
np.arcsinh(lhs / current_scale_a) - np.arcsinh(rhs / current_scale_a)
)
return np.concatenate(residual_parts)
initial_params = np.concatenate(
[
constraint_preset.initial_guess.copy(),
np.zeros(num_segments * len(MECHANISM_NAMES), dtype=float),
]
)
lower_bounds = np.concatenate(
[
constraint_preset.lower_bounds.copy(),
np.full(num_segments * len(MECHANISM_NAMES), -6.0, dtype=float),
]
)
upper_bounds = np.concatenate(
[
constraint_preset.upper_bounds.copy(),
np.full(num_segments * len(MECHANISM_NAMES), 6.0, dtype=float),
]
)
fit = least_squares(
residuals,
x0=initial_params,
bounds=(lower_bounds, upper_bounds),
max_nfev=args.max_nfev,
)
global_params, weight_params = unpack_parameters(fit.x, num_segments)
(
top_phi_ev,
top_gamma,
log10_top_pref,
bottom_phi_ev,
bottom_gamma,
log10_bottom_pref,
trap_depth_ev,
pf_fe_beta,
log10_pf_fe_pref,
pf_il_beta,
log10_pf_il_pref,
log10_bg_cond,
log10_i_floor,
) = global_params
fitted_results = []
for sweep in sweeps:
segment_definitions, segment_index_map = build_segment_index_map(sweep.voltage_v)
base_terms = direct_transport_base_terms(
voltage_v=sweep.voltage_v,
temperature_k=args.temperature_k,
top_phi_ev=top_phi_ev,
top_gamma_ev_per_sqrt_v=top_gamma,
log10_top_prefactor_a=log10_top_pref,
bottom_phi_ev=bottom_phi_ev,
bottom_gamma_ev_per_sqrt_v=bottom_gamma,
log10_bottom_prefactor_a=log10_bottom_pref,
trap_depth_ev=trap_depth_ev,
pf_fe_beta_ev_per_sqrt_v=pf_fe_beta,
log10_pf_fe_prefactor_a_per_v=log10_pf_fe_pref,
pf_il_beta_ev_per_sqrt_v=pf_il_beta,
log10_pf_il_prefactor_a_per_v=log10_pf_il_pref,
log10_background_conductance_a_per_v=log10_bg_cond,
log10_current_floor_a=log10_i_floor,
)
model_total_a, weighted_terms = build_weighted_model(
base_terms=base_terms,
segment_index_map=segment_index_map,
weight_params=weight_params,
)
fitted_results.append(
(
sweep,
segment_definitions,
segment_index_map,
base_terms,
weighted_terms,
model_total_a,
)
)
output_path = build_output_path(args)
output_path.parent.mkdir(parents=True, exist_ok=True)
csv_path = output_path.with_suffix(".csv")
fig, axes = plt.subplots(3, 2, figsize=(14.5, 13.5), dpi=args.dpi, sharex=True, sharey=True)
fig.suptitle(
f"Segment-Weighted Direct Transport Fit Across {len(fitted_results)} Workbook Sweeps: "
f"Ti | {display_insulator_name(args.insulator)} ({args.il_nm:g} nm) | "
f"AlScN ({args.fe_thickness_nm:g} nm) | Al",
fontsize=15,
y=0.98,
)
plot_axes = list(axes.flat)
sweep_errors = []
for axis, (sweep, segment_defs, _, _, _, model_total_a) in zip(plot_axes, fitted_results):
error = mean_abs_log10_error(sweep.current_a, model_total_a)
sweep_errors.append(error)
for segment_label, segment_slice in segment_defs:
color = SEGMENT_COLORS.get(segment_label, "#444444")
axis.semilogy(
sweep.voltage_v[segment_slice],
np.maximum(np.abs(sweep.current_a[segment_slice]), 1e-20),
"o",
markersize=3.2,
color=color,
alpha=0.72,
)
axis.semilogy(
sweep.voltage_v[segment_slice],
np.maximum(np.abs(model_total_a[segment_slice]), 1e-20),
"-",
linewidth=2.0,
color=color,
)
axis.set_title(f"{sweep.name}\nmean |Δlog10 I| = {error:.3f}", fontsize=10.5)
axis.grid(alpha=0.25)
for axis in plot_axes[:5]:
axis.set_ylabel("|I| (A)")
plot_axes[3].set_xlabel("Applied Voltage (V)")
plot_axes[4].set_xlabel("Applied Voltage (V)")
legend_handles = [
Line2D([0], [0], marker="o", linestyle="None", color="#111111", markersize=5, label="Measured"),
Line2D([0], [0], linestyle="-", color="#111111", linewidth=2, label="Fit"),
]
legend_handles.extend(
[
Line2D([0], [0], linestyle="-", color=SEGMENT_COLORS[label], linewidth=2.2, label=label)
for label in segment_labels
]
)
plot_axes[0].legend(handles=legend_handles, loc="upper left", fontsize=8.2, ncol=2)
summary_axis = plot_axes[5]
summary_axis.axis("off")
fit_lines = [
"Shared direct transport constants",
f"num sweeps = {len(fitted_results)}",
f"diameter = {args.device_diameter_nm:g} nm",
f"area = {area_m2:.3e} m^2",
f"T = {args.temperature_k:g} K",
f"constraint preset = {constraint_preset.name}",
f"top phi = {top_phi_ev:.4f} eV",
f"top gamma = {top_gamma:.4f} eV / sqrt(V)",
f"log10 top prefactor (A) = {log10_top_pref:.4f}",
f"bottom phi = {bottom_phi_ev:.4f} eV",
f"bottom gamma = {bottom_gamma:.4f} eV / sqrt(V)",
f"log10 bottom prefactor (A) = {log10_bottom_pref:.4f}",
f"PF trap depth = {trap_depth_ev:.4f} eV",
f"PF FE beta = {pf_fe_beta:.4f} eV / sqrt(V)",
f"log10 PF FE pref (A/V) = {log10_pf_fe_pref:.4f}",
f"PF IL beta = {pf_il_beta:.4f} eV / sqrt(V)",
f"log10 PF IL pref (A/V) = {log10_pf_il_pref:.4f}",
f"log10 bg cond (A/V) = {log10_bg_cond:.4f}",
f"log10 current floor (A) = {log10_i_floor:.4f}",
"",
"Geometric-mean-normalized segment weights",
]
for segment_index, segment_label in enumerate(segment_labels):
fit_lines.append(
f"{segment_label}: TI={weight_params['thermionic'][segment_index]:.3f}, "
f"PF_FE={weight_params['pf_fe'][segment_index]:.3f}, "
f"PF_IL={weight_params['pf_il'][segment_index]:.3f}, "
f"BG={weight_params['background'][segment_index]:.3f}"
)
fit_lines.extend(
[
"",
f"overall mean |Δlog10 I| = {sum(sweep_errors) / len(sweep_errors):.3f}",
f"cost = {fit.cost:.3e}",
f"nfev = {fit.nfev}",
]
)
summary_axis.text(
0.02,
0.98,
"\n".join(fit_lines),
ha="left",
va="top",
fontsize=8.6,
family="monospace",
bbox=dict(boxstyle="round,pad=0.4", facecolor="white", edgecolor="#d9d9d9", alpha=0.95),
transform=summary_axis.transAxes,
)
fig.tight_layout(rect=(0.0, 0.0, 1.0, 0.965))
fig.savefig(output_path, dpi=args.dpi)
plt.close(fig)
with csv_path.open("w", newline="") as handle:
writer = csv.writer(handle)
writer.writerow(
[
"sweep_name",
"segment_label",
"voltage_v",
"experimental_current_a",
"model_total_a",
"model_thermionic_weighted_a",
"model_pf_fe_weighted_a",
"model_pf_il_weighted_a",
"model_background_weighted_a",
"base_thermionic_a",
"base_pf_fe_a",
"base_pf_il_a",
"base_background_a",
"current_floor_a",
"weight_thermionic",
"weight_pf_fe",
"weight_pf_il",
"weight_background",
"top_effective_barrier_ev",
"bottom_effective_barrier_ev",
"pf_fe_activation_ev",
"pf_il_activation_ev",
]
)
for sweep, segment_defs, segment_index_map, base_terms, weighted_terms, model_total_a in fitted_results:
segment_label_by_point = [segment_labels[index] for index in segment_index_map]
for point_index, values in enumerate(
zip(
sweep.voltage_v,
sweep.current_a,
model_total_a,
weighted_terms["thermionic"],
weighted_terms["pf_fe"],
weighted_terms["pf_il"],
weighted_terms["background"],
base_terms["thermionic_a"],
base_terms["pf_fe_a"],
base_terms["pf_il_a"],
base_terms["background_a"],
base_terms["current_floor_a"],
base_terms["top_effective_barrier_ev"],
base_terms["bottom_effective_barrier_ev"],
base_terms["pf_fe_activation_ev"],
base_terms["pf_il_activation_ev"],
)
):
segment_index = int(segment_index_map[point_index])
writer.writerow(
[
sweep.name,
segment_label_by_point[point_index],
values[0],
values[1],
values[2],
values[3],
values[4],
values[5],
values[6],
values[7],
values[8],
values[9],
values[10],
weight_params["thermionic"][segment_index],
weight_params["pf_fe"][segment_index],
weight_params["pf_il"][segment_index],
weight_params["background"][segment_index],
values[11],
values[12],
values[13],
values[14],
values[15],
]
)
summary_parts = [
f"constraint_preset={constraint_preset.name}",
f"top_phi_ev={top_phi_ev:.6f}",
f"top_gamma={top_gamma:.6f}",
f"log10_top_prefactor_a={log10_top_pref:.6f}",
f"bottom_phi_ev={bottom_phi_ev:.6f}",
f"bottom_gamma={bottom_gamma:.6f}",
f"log10_bottom_prefactor_a={log10_bottom_pref:.6f}",
f"pf_trap_depth_ev={trap_depth_ev:.6f}",
f"pf_fe_beta={pf_fe_beta:.6f}",
f"log10_pf_fe_prefactor_a_per_v={log10_pf_fe_pref:.6f}",
f"pf_il_beta={pf_il_beta:.6f}",
f"log10_pf_il_prefactor_a_per_v={log10_pf_il_pref:.6f}",
f"log10_bg_cond={log10_bg_cond:.6f}",
f"log10_i_floor={log10_i_floor:.6f}",
]
for mechanism_name in MECHANISM_NAMES:
for segment_index, segment_label in enumerate(segment_labels):
safe_label = (
segment_label.replace("→", "_to_")
.replace("+", "plus")
.replace("-", "minus")
)
summary_parts.append(
f"{mechanism_name}_weight_{safe_label}={weight_params[mechanism_name][segment_index]:.6f}"
)
summary_parts.append(f"cost={fit.cost:.6e}")
print("[segmented-direct-fit-summary] " + " ".join(summary_parts))
print("[segmented-direct-fit-parameter-order] " + " ".join(GLOBAL_PARAMETER_ORDER))
print(f"[segmented-direct-fit-output] figure={output_path} csv={csv_path}")
if __name__ == "__main__":
main()