|
10 | 10 | touch sensation in C. elegans. |
11 | 11 | """ |
12 | 12 |
|
13 | | -from pathlib import Path |
14 | | - |
15 | 13 | import addcopyfighandler # noqa: F401 |
16 | | -import scipy.io |
17 | 14 |
|
18 | 15 | from piezod import CantileverImplantation |
19 | 16 |
|
|
66 | 63 | c.fluid = "air" |
67 | 64 | c.number_of_piezoresistors = 4 # Full bridge for temperature compensation |
68 | 65 |
|
69 | | -# Load the lookup table for electrical calculations |
70 | | -lookup_path = Path(__file__).parent.parent.parent / "matlab" / "PiezoD" / "lookupTable.mat" |
71 | | -if lookup_path.exists(): |
72 | | - mat_data = scipy.io.loadmat(str(lookup_path), squeeze_me=True) |
73 | | - c.load_lookup_table(mat_data) |
74 | | - lookup_loaded = True |
75 | | -else: |
76 | | - print(f"Warning: Lookup table not found at {lookup_path}") |
77 | | - print("Electrical parameters requiring lookup table will not be available.") |
78 | | - lookup_loaded = False |
79 | | - |
80 | 66 | # Print design summary |
81 | 67 | print("=== Ion-Implanted Cantilever Design ===") |
82 | 68 | print("Based on Park et al. JMEMS 2010 (optimized for C. elegans force sensing)") |
@@ -129,35 +115,34 @@ def print_row(name, model_str, paper_val, tol=0.15): |
129 | 115 | print_row("Stiffness (mN/m)", f"{stiffness:.2f}", paper["stiffness_mN_m"]) |
130 | 116 | print_row("Resonant freq (kHz)", f"{freq:.2f}", paper["freq_kHz"]) |
131 | 117 |
|
132 | | -# Electrical properties (require lookup table) |
133 | | -if lookup_loaded: |
134 | | - Rs = c.sheet_resistance() |
135 | | - beta = c.beta() |
136 | | - Xj = c.junction_depth * 1e6 # um |
137 | | - resistance = c.resistance() |
138 | | - power = c.power_dissipation() * 1e3 # mW |
139 | | - sqrt_Dt = c.diffusion_length * 1e4 # um |
140 | | - |
141 | | - print_row("Junction depth t_p (um)", f"{Xj:.2f}", paper["junction_depth_um"], tol=0.25) |
142 | | - print_row("Resistance R_piezo (Ohm)", f"{resistance:.0f}", paper["resistance_ohm"], tol=0.25) |
143 | | - print_row("Beta* (efficiency)", f"{beta:.2f}", paper["beta_star"]) |
144 | | - print_row("sqrt(Dt) (um)", f"{sqrt_Dt:.4f}", paper["sqrt_Dt_um"]) |
145 | | - print_row("Power dissipation (mW)", f"{power:.2f}", paper["power_mW"]) |
146 | | - |
147 | | - # Performance metrics |
148 | | - print("-" * 62) |
149 | | - force_sensitivity = c.force_sensitivity() |
150 | | - force_res = c.force_resolution() * 1e12 # pN |
151 | | - |
152 | | - print_row("Sensitivity S_FV (V/N)", f"{force_sensitivity:.0f}", paper["sensitivity_V_N"]) |
153 | | - print_row("Force resolution (pN)", f"{force_res:.1f}", paper["force_resolution_pN"]) |
154 | | - |
155 | | - # Additional derived parameters |
156 | | - print("-" * 62) |
157 | | - print(" Additional Parameters:") |
158 | | - print(f" Sheet resistance: {Rs:.1f} Ohm/sq") |
159 | | - print(f" Hooge parameter alpha: {c.alpha():.2e}") |
160 | | - print(f" Number of squares: {c.number_of_squares():.1f}") |
161 | | - print(f" Piezoresistor width: {c.w_pr() * 1e6:.1f} um") |
| 118 | +# Electrical properties (from bundled lookup table) |
| 119 | +Rs = c.sheet_resistance() |
| 120 | +beta = c.beta() |
| 121 | +Xj = c.junction_depth * 1e6 # um |
| 122 | +resistance = c.resistance() |
| 123 | +power = c.power_dissipation() * 1e3 # mW |
| 124 | +sqrt_Dt = c.diffusion_length * 1e4 # um |
| 125 | + |
| 126 | +print_row("Junction depth t_p (um)", f"{Xj:.2f}", paper["junction_depth_um"], tol=0.25) |
| 127 | +print_row("Resistance R_piezo (Ohm)", f"{resistance:.0f}", paper["resistance_ohm"], tol=0.25) |
| 128 | +print_row("Beta* (efficiency)", f"{beta:.2f}", paper["beta_star"]) |
| 129 | +print_row("sqrt(Dt) (um)", f"{sqrt_Dt:.4f}", paper["sqrt_Dt_um"]) |
| 130 | +print_row("Power dissipation (mW)", f"{power:.2f}", paper["power_mW"]) |
| 131 | + |
| 132 | +# Performance metrics |
| 133 | +print("-" * 62) |
| 134 | +force_sensitivity = c.force_sensitivity() |
| 135 | +force_res = c.force_resolution() * 1e12 # pN |
| 136 | + |
| 137 | +print_row("Sensitivity S_FV (V/N)", f"{force_sensitivity:.0f}", paper["sensitivity_V_N"]) |
| 138 | +print_row("Force resolution (pN)", f"{force_res:.1f}", paper["force_resolution_pN"]) |
| 139 | + |
| 140 | +# Additional derived parameters |
| 141 | +print("-" * 62) |
| 142 | +print(" Additional Parameters:") |
| 143 | +print(f" Sheet resistance: {Rs:.1f} Ohm/sq") |
| 144 | +print(f" Hooge parameter alpha: {c.alpha():.2e}") |
| 145 | +print(f" Number of squares: {c.number_of_squares():.1f}") |
| 146 | +print(f" Piezoresistor width: {c.w_pr() * 1e6:.1f} um") |
162 | 147 |
|
163 | 148 | print("=" * 62) |
0 commit comments