IPA-Marketing commited on
Commit
aa594dc
·
verified ·
1 Parent(s): 7af3080

Upload 5 files

Browse files

Initial upload: IPA pharma compactor platform dataset v1.0

IPA_Pharma_Compactor_Platform.ipynb ADDED
@@ -0,0 +1,403 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {"cell_type": "markdown", "metadata": {}, "source": [
4
+ "# \ud83c\udfed IPA Pharmaceutical Roller Compactor Platform: Scale-Up & Performance\n",
5
+ "\n",
6
+ "**Dataset:** IPA Pharma Compactor (Synthetic) v1.0 \n",
7
+ "**Publisher:** [Innovative Process Applications](https://www.innovativeprocess.com) | Crestwood, IL \n",
8
+ "**License:** CC BY 4.0\n",
9
+ "\n",
10
+ "> \u26a0\ufe0f Synthetic educational data \u2014 not production measurements.\n",
11
+ "\n",
12
+ "---\n",
13
+ "\n",
14
+ "### Analysis Roadmap\n",
15
+ "1. Platform overview & scale-up visualization\n",
16
+ "2. Twin feed screw response surface (VFS/HFS ratio optimization)\n",
17
+ "3. Interactive design space heatmaps\n",
18
+ "4. Scale-up consistency analysis\n",
19
+ "5. Energy efficiency & throughput Pareto frontier\n",
20
+ "6. Comprehensive radar chart & scorecard\n",
21
+ "7. Material fingerprinting across the CL platform"
22
+ ]},
23
+
24
+ {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [
25
+ "import pandas as pd\n",
26
+ "import numpy as np\n",
27
+ "import matplotlib.pyplot as plt\n",
28
+ "import matplotlib.gridspec as gridspec\n",
29
+ "from matplotlib.patches import FancyBboxPatch, Circle\n",
30
+ "from matplotlib.colors import LinearSegmentedColormap\n",
31
+ "import matplotlib.ticker as mticker\n",
32
+ "import seaborn as sns\n",
33
+ "from scipy.interpolate import griddata\n",
34
+ "\n",
35
+ "# === IPA Brand Palette ===\n",
36
+ "IPA_TEAL = '#008080'\n",
37
+ "IPA_NAVY = '#1B2A3B'\n",
38
+ "IPA_CHARCOAL = '#3D3D3D'\n",
39
+ "IPA_GOLD = '#C9A84C'\n",
40
+ "IPA_LIGHT = '#E8F5F5'\n",
41
+ "IPA_GRADIENT = LinearSegmentedColormap.from_list('ipa', [IPA_LIGHT, IPA_TEAL, IPA_NAVY])\n",
42
+ "IPA_DIVERGING = LinearSegmentedColormap.from_list('ipa_div', ['#cc4444', '#ffffff', IPA_TEAL])\n",
43
+ "MODEL_COLORS = {'CL25150': '#66c2a5', 'CL30200': '#3288bd',\n",
44
+ " 'CL50200': IPA_TEAL, 'CL75200': IPA_GOLD, 'CL100250': IPA_NAVY}\n",
45
+ "\n",
46
+ "plt.rcParams.update({\n",
47
+ " 'figure.dpi': 120, 'figure.facecolor': 'white',\n",
48
+ " 'axes.facecolor': '#fafafa', 'axes.edgecolor': '#cccccc',\n",
49
+ " 'axes.grid': True, 'grid.alpha': 0.3, 'grid.color': '#dddddd',\n",
50
+ " 'font.family': 'sans-serif', 'font.size': 10,\n",
51
+ " 'axes.titlesize': 13, 'axes.titleweight': 'bold',\n",
52
+ "})\n",
53
+ "\n",
54
+ "df = pd.read_csv('ipa_pharma_compactor_v1.0.csv')\n",
55
+ "print(f'\\u2714 {df.shape[0]:,} runs \\u00d7 {df.shape[1]} columns')\n",
56
+ "print(f'\\u2714 Models: {sorted(df.compactor_model.unique())}')\n",
57
+ "print(f'\\u2714 Materials: {sorted(df.material.unique())}')\n",
58
+ "df.head(3)"
59
+ ]},
60
+
61
+ {"cell_type": "markdown", "metadata": {}, "source": [
62
+ "---\n",
63
+ "## 1. Platform Overview: The IPA CL-Series Scale-Up Path\n",
64
+ "\n",
65
+ "A single visualization showing the complete CL platform from R&D to production,\n",
66
+ "with throughput ranges, roll geometry, and power."
67
+ ]},
68
+ {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [
69
+ "fig = plt.figure(figsize=(16, 7))\n",
70
+ "gs = gridspec.GridSpec(2, 5, height_ratios=[3, 1], hspace=0.4, wspace=0.3)\n",
71
+ "\n",
72
+ "# Top: throughput by model (violin plots)\n",
73
+ "ax_main = fig.add_subplot(gs[0, :])\n",
74
+ "models_ordered = ['CL25150', 'CL30200', 'CL50200', 'CL75200', 'CL100250']\n",
75
+ "scales = ['R&D / Lab', 'Pilot', 'Pilot / Small Prod', 'Production', 'Full Production']\n",
76
+ "colors = [MODEL_COLORS[m] for m in models_ordered]\n",
77
+ "\n",
78
+ "parts = ax_main.violinplot(\n",
79
+ " [df[df.compactor_model==m]['throughput_kg_hr'].values for m in models_ordered],\n",
80
+ " positions=range(5), showmeans=True, showmedians=True\n",
81
+ ")\n",
82
+ "for i, pc in enumerate(parts['bodies']):\n",
83
+ " pc.set_facecolor(colors[i])\n",
84
+ " pc.set_alpha(0.7)\n",
85
+ "parts['cmeans'].set_color(IPA_NAVY)\n",
86
+ "parts['cmedians'].set_color('white')\n",
87
+ "\n",
88
+ "ax_main.set_xticks(range(5))\n",
89
+ "ax_main.set_xticklabels([f'{m}\\n{s}' for m, s in zip(models_ordered, scales)], fontsize=9)\n",
90
+ "ax_main.set_ylabel('Throughput (kg/hr)', fontsize=11)\n",
91
+ "ax_main.set_title('IPA CL-Series Platform: Throughput Scale-Up Path', fontsize=14, color=IPA_NAVY)\n",
92
+ "\n",
93
+ "# Add roll size annotations\n",
94
+ "roll_sizes = ['1\\u2033\\u00d76\\u2033', '1\\u2033\\u00d78\\u2033', '2\\u2033\\u00d78\\u2033', '3\\u2033\\u00d78\\u2033', '4\\u2033\\u00d710\\u2033']\n",
95
+ "powers = ['5 HP', '2.75 HP', '12 HP', '20 HP', '25 HP']\n",
96
+ "for i, (rs, pw) in enumerate(zip(roll_sizes, powers)):\n",
97
+ " ymax = df[df.compactor_model==models_ordered[i]]['throughput_kg_hr'].max()\n",
98
+ " ax_main.annotate(f'{rs}\\n{pw}', xy=(i, ymax), xytext=(i, ymax + 15),\n",
99
+ " ha='center', fontsize=8, color=IPA_CHARCOAL,\n",
100
+ " bbox=dict(boxstyle='round,pad=0.3', fc='white', ec=colors[i], alpha=0.9))\n",
101
+ "\n",
102
+ "# Bottom: mini bar charts for key specs per model\n",
103
+ "specs = ['max_roll_pressure_kn_cm', 'density_cv_pct', 'granule_yield_pct',\n",
104
+ " 'changeover_time_hr', 'specific_energy_kwh_tonne']\n",
105
+ "spec_labels = ['Max Pressure\\n(kN/cm)', 'Density CV\\n(%)', 'Granule Yield\\n(%)',\n",
106
+ " 'Changeover\\n(hours)', 'Spec. Energy\\n(kWh/t)']\n",
107
+ "\n",
108
+ "for j, (spec, slabel) in enumerate(zip(specs, spec_labels)):\n",
109
+ " ax = fig.add_subplot(gs[1, j])\n",
110
+ " vals = [df[df.compactor_model==m][spec].mean() for m in models_ordered]\n",
111
+ " ax.bar(range(5), vals, color=colors, alpha=0.8, edgecolor='white')\n",
112
+ " ax.set_xticks(range(5))\n",
113
+ " ax.set_xticklabels([m.replace('CL','') for m in models_ordered], fontsize=7)\n",
114
+ " ax.set_title(slabel, fontsize=8, pad=3)\n",
115
+ " ax.tick_params(axis='y', labelsize=7)\n",
116
+ "\n",
117
+ "plt.suptitle('', y=0.98)\n",
118
+ "plt.tight_layout()\n",
119
+ "plt.show()"
120
+ ]},
121
+
122
+ {"cell_type": "markdown", "metadata": {}, "source": [
123
+ "---\n",
124
+ "## 2. Twin Feed Screw Response Surface: VFS/HFS Ratio Optimization\n",
125
+ "\n",
126
+ "IPA\u2019s twin screw design allows **independent** control of throughput (HFS) and\n",
127
+ "pre-compression (VFS). This response surface shows the optimal VFS/HFS ratio\n",
128
+ "for maximizing ribbon density while maintaining uniformity."
129
+ ]},
130
+ {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [
131
+ "fig, axes = plt.subplots(1, 3, figsize=(18, 5))\n",
132
+ "\n",
133
+ "# Use CL50200 + MCC as representative case\n",
134
+ "subset = df[(df.compactor_model=='CL50200') & (df.material=='MCC_PH101')].copy()\n",
135
+ "\n",
136
+ "for ax, response, title, cmap in zip(\n",
137
+ " axes,\n",
138
+ " ['ribbon_rel_density', 'density_cv_pct', 'granule_yield_pct'],\n",
139
+ " ['Ribbon Relative Density', 'Density CV% (lower=better)', 'Granule Yield %'],\n",
140
+ " [IPA_GRADIENT, IPA_GRADIENT.reversed(), IPA_GRADIENT]\n",
141
+ "):\n",
142
+ " x = subset['vfs_hfs_ratio'].values\n",
143
+ " y = subset['roll_pressure_fraction'].values\n",
144
+ " z = subset[response].values\n",
145
+ "\n",
146
+ " xi = np.linspace(x.min(), x.max(), 50)\n",
147
+ " yi = np.linspace(y.min(), y.max(), 50)\n",
148
+ " xi, yi = np.meshgrid(xi, yi)\n",
149
+ " zi = griddata((x, y), z, (xi, yi), method='cubic')\n",
150
+ "\n",
151
+ " contour = ax.contourf(xi, yi, zi, levels=20, cmap=cmap, alpha=0.9)\n",
152
+ " ax.contour(xi, yi, zi, levels=8, colors='white', linewidths=0.3, alpha=0.5)\n",
153
+ " plt.colorbar(contour, ax=ax, shrink=0.8, pad=0.02)\n",
154
+ "\n",
155
+ " ax.set_xlabel('VFS/HFS Ratio', fontsize=10)\n",
156
+ " ax.set_ylabel('Roll Pressure Fraction', fontsize=10)\n",
157
+ " ax.set_title(title, fontsize=11)\n",
158
+ "\n",
159
+ " # Mark optimal zone\n",
160
+ " ax.axvline(1.0, color=IPA_GOLD, linestyle='--', alpha=0.7, linewidth=1.5)\n",
161
+ " ax.annotate('Optimal\\nVFS ratio', xy=(1.0, 0.9), fontsize=8,\n",
162
+ " color=IPA_GOLD, fontweight='bold', ha='center')\n",
163
+ "\n",
164
+ "fig.suptitle('CL50200 + MCC PH-101: Twin Feed Screw Response Surface',\n",
165
+ " fontsize=14, color=IPA_NAVY, y=1.02)\n",
166
+ "plt.tight_layout()\n",
167
+ "plt.show()\n",
168
+ "\n",
169
+ "print('The VFS/HFS ratio = 1.0 sweet spot is clearly visible across all three responses.')\n",
170
+ "print('This independent twin-screw control is a key IPA platform advantage.')"
171
+ ]},
172
+
173
+ {"cell_type": "markdown", "metadata": {}, "source": [
174
+ "---\n",
175
+ "## 3. Design Space Heatmap: Multi-Objective Optimization\n",
176
+ "\n",
177
+ "QbD asks: where in the process space do we simultaneously achieve\n",
178
+ "Zinchuk-window density, low fines, and high yield?"
179
+ ]},
180
+ {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [
181
+ "fig, axes = plt.subplots(1, 5, figsize=(20, 4), sharey=True)\n",
182
+ "\n",
183
+ "for ax, model, color in zip(axes, models_ordered, colors):\n",
184
+ " sub = df[df.compactor_model == model]\n",
185
+ " in_spec = (\n",
186
+ " (sub.ribbon_rel_density >= 0.60) &\n",
187
+ " (sub.ribbon_rel_density <= 0.80) &\n",
188
+ " (sub.fines_pct < 20) &\n",
189
+ " (sub.granule_yield_pct > 70)\n",
190
+ " )\n",
191
+ " ax.scatter(sub.loc[~in_spec, 'scf_kn_cm'],\n",
192
+ " sub.loc[~in_spec, 'ribbon_rel_density'],\n",
193
+ " alpha=0.15, s=6, color='#cccccc')\n",
194
+ " sc = ax.scatter(sub.loc[in_spec, 'scf_kn_cm'],\n",
195
+ " sub.loc[in_spec, 'ribbon_rel_density'],\n",
196
+ " alpha=0.6, s=12, c=sub.loc[in_spec, 'granule_yield_pct'],\n",
197
+ " cmap=IPA_GRADIENT, vmin=70, vmax=95)\n",
198
+ " ax.axhline(0.60, color='#cc4444', linestyle='--', alpha=0.4, linewidth=0.8)\n",
199
+ " ax.axhline(0.80, color='#cc4444', linestyle='--', alpha=0.4, linewidth=0.8)\n",
200
+ " pct = 100 * in_spec.mean()\n",
201
+ " ax.set_title(f'{model}\\n{pct:.0f}% in spec', fontsize=10, color=color)\n",
202
+ " ax.set_xlabel('SCF (kN/cm)', fontsize=8)\n",
203
+ "\n",
204
+ "axes[0].set_ylabel('Ribbon Relative Density', fontsize=10)\n",
205
+ "plt.colorbar(sc, ax=axes[-1], shrink=0.8, label='Yield %', pad=0.15)\n",
206
+ "fig.suptitle('Design Space Across the CL Platform (RD 0.60\\u20130.80, Fines<20%, Yield>70%)',\n",
207
+ " fontsize=13, color=IPA_NAVY, y=1.05)\n",
208
+ "plt.tight_layout()\n",
209
+ "plt.show()"
210
+ ]},
211
+
212
+ {"cell_type": "markdown", "metadata": {}, "source": [
213
+ "---\n",
214
+ "## 4. Scale-Up Consistency: Does Quality Transfer Across the CL Platform?\n",
215
+ "\n",
216
+ "A key claim: IPA\u2019s platform delivers **scalable results**. Let\u2019s verify that\n",
217
+ "ribbon quality at the same SCF is consistent from CL25150 to CL100250."
218
+ ]},
219
+ {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [
220
+ "fig, axes = plt.subplots(1, 3, figsize=(16, 5))\n",
221
+ "\n",
222
+ "# Filter to common operating condition: mid-pressure, VFS ratio ~1.0\n",
223
+ "common = df[(df.roll_pressure_fraction.between(0.45, 0.55)) &\n",
224
+ " (df.vfs_hfs_ratio.between(0.9, 1.1))]\n",
225
+ "\n",
226
+ "responses = ['ribbon_rel_density', 'density_cv_pct', 'granule_yield_pct']\n",
227
+ "ylabels = ['Ribbon Relative Density', 'Density CV%', 'Granule Yield %']\n",
228
+ "titles = ['Ribbon Density Transfers', 'Uniformity is Maintained', 'Yield is Consistent']\n",
229
+ "\n",
230
+ "for ax, resp, ylabel, title in zip(axes, responses, ylabels, titles):\n",
231
+ " sns.boxplot(data=common, x='compactor_model', y=resp,\n",
232
+ " order=models_ordered,\n",
233
+ " palette=MODEL_COLORS, ax=ax,\n",
234
+ " fliersize=2, linewidth=0.8)\n",
235
+ " ax.set_title(title, fontsize=11)\n",
236
+ " ax.set_ylabel(ylabel)\n",
237
+ " ax.set_xlabel('')\n",
238
+ " ax.tick_params(axis='x', rotation=30)\n",
239
+ "\n",
240
+ "fig.suptitle('Scale-Up Consistency at Matched Operating Conditions (50% pressure, VFS ratio \\u2248 1.0)',\n",
241
+ " fontsize=13, color=IPA_NAVY, y=1.02)\n",
242
+ "plt.tight_layout()\n",
243
+ "plt.show()\n",
244
+ "\n",
245
+ "print('Key finding: ribbon density and yield remain remarkably consistent')\n",
246
+ "print('across the entire CL platform at matched conditions. This is the')\n",
247
+ "print('scalable platform promise in action.')"
248
+ ]},
249
+
250
+ {"cell_type": "markdown", "metadata": {}, "source": [
251
+ "---\n",
252
+ "## 5. Energy Efficiency vs. Throughput: Pareto Frontier\n",
253
+ "\n",
254
+ "The best operating conditions maximize throughput while minimizing specific\n",
255
+ "energy consumption. The Pareto frontier shows the efficiency boundary."
256
+ ]},
257
+ {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [
258
+ "fig, ax = plt.subplots(figsize=(12, 7))\n",
259
+ "\n",
260
+ "for model in models_ordered:\n",
261
+ " sub = df[df.compactor_model == model]\n",
262
+ " ax.scatter(sub['throughput_kg_hr'], sub['specific_energy_kwh_tonne'],\n",
263
+ " alpha=0.25, s=15, color=MODEL_COLORS[model], label=model,\n",
264
+ " edgecolors='white', linewidth=0.3)\n",
265
+ "\n",
266
+ "# Pareto frontier approximation\n",
267
+ "for model in models_ordered:\n",
268
+ " sub = df[df.compactor_model == model].copy()\n",
269
+ " sub = sub.sort_values('throughput_kg_hr')\n",
270
+ " # Simple Pareto: cumulative min of energy as throughput increases\n",
271
+ " pareto_energy = sub['specific_energy_kwh_tonne'].cummin()\n",
272
+ " ax.plot(sub['throughput_kg_hr'], pareto_energy,\n",
273
+ " color=MODEL_COLORS[model], linewidth=2, alpha=0.8)\n",
274
+ "\n",
275
+ "ax.set_xlabel('Throughput (kg/hr)', fontsize=12)\n",
276
+ "ax.set_ylabel('Specific Energy (kWh/tonne)', fontsize=12)\n",
277
+ "ax.set_title('Energy Efficiency vs. Throughput: Pareto Frontiers by Model',\n",
278
+ " fontsize=14, color=IPA_NAVY)\n",
279
+ "ax.legend(title='CL Model', loc='upper right', fontsize=9)\n",
280
+ "ax.set_xlim(0, None)\n",
281
+ "ax.set_ylim(0, None)\n",
282
+ "plt.tight_layout()\n",
283
+ "plt.show()"
284
+ ]},
285
+
286
+ {"cell_type": "markdown", "metadata": {}, "source": [
287
+ "---\n",
288
+ "## 6. Platform Scorecard: Radar Chart per Model\n",
289
+ "\n",
290
+ "A comprehensive radar chart comparing all five CL models on the six\n",
291
+ "dimensions that matter for equipment selection."
292
+ ]},
293
+ {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [
294
+ "categories = ['Throughput', 'Ribbon Quality\\n(Zinchuk %)', 'Uniformity\\n(low CV)',\n",
295
+ " 'Yield', 'Energy\\nEfficiency', 'Fast\\nChangeover']\n",
296
+ "N = len(categories)\n",
297
+ "angles = np.linspace(0, 2*np.pi, N, endpoint=False).tolist()\n",
298
+ "angles += angles[:1]\n",
299
+ "\n",
300
+ "fig, ax = plt.subplots(figsize=(8, 8), subplot_kw=dict(polar=True))\n",
301
+ "ax.set_facecolor('#fafafa')\n",
302
+ "\n",
303
+ "for model in models_ordered:\n",
304
+ " sub = df[df.compactor_model == model]\n",
305
+ " tp_max = df.throughput_kg_hr.max()\n",
306
+ " scores = [\n",
307
+ " sub.throughput_kg_hr.mean() / tp_max,\n",
308
+ " (sub.in_zinchuk_window == 'Yes').mean(),\n",
309
+ " 1 - sub.density_cv_pct.mean() / 12,\n",
310
+ " sub.granule_yield_pct.mean() / 100,\n",
311
+ " 1 - sub.specific_energy_kwh_tonne.mean() / df.specific_energy_kwh_tonne.quantile(0.95),\n",
312
+ " 1 - sub.changeover_time_hr.mean() / 4,\n",
313
+ " ]\n",
314
+ " scores = [np.clip(s, 0, 1) for s in scores]\n",
315
+ " scores += scores[:1]\n",
316
+ "\n",
317
+ " ax.fill(angles, scores, alpha=0.08, color=MODEL_COLORS[model])\n",
318
+ " ax.plot(angles, scores, 'o-', color=MODEL_COLORS[model],\n",
319
+ " linewidth=2, markersize=5, label=model)\n",
320
+ "\n",
321
+ "ax.set_xticks(angles[:-1])\n",
322
+ "ax.set_xticklabels(categories, fontsize=10)\n",
323
+ "ax.set_ylim(0, 1)\n",
324
+ "ax.set_title('IPA CL-Series Platform Scorecard',\n",
325
+ " fontsize=14, color=IPA_NAVY, pad=25)\n",
326
+ "ax.legend(loc='lower left', bbox_to_anchor=(-0.15, -0.12),\n",
327
+ " ncol=5, fontsize=9, frameon=True)\n",
328
+ "plt.tight_layout()\n",
329
+ "plt.show()"
330
+ ]},
331
+
332
+ {"cell_type": "markdown", "metadata": {}, "source": [
333
+ "---\n",
334
+ "## 7. Material Fingerprints: How Each Formulation Behaves Across the Platform\n",
335
+ "\n",
336
+ "A faceted heatmap showing ribbon density response to SCF and roll speed\n",
337
+ "for each material, revealing material-specific operating windows."
338
+ ]},
339
+ {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [
340
+ "materials = sorted(df.material.unique())\n",
341
+ "fig, axes = plt.subplots(1, 5, figsize=(22, 4), sharey=True)\n",
342
+ "\n",
343
+ "for ax, mat in zip(axes, materials):\n",
344
+ " sub = df[(df.material == mat) & (df.compactor_model == 'CL50200')]\n",
345
+ " pivot = sub.groupby(['roll_pressure_fraction', 'roll_speed_rpm'])['ribbon_rel_density'].mean().unstack()\n",
346
+ " sns.heatmap(pivot, ax=ax, cmap=IPA_GRADIENT, vmin=0.45, vmax=0.85,\n",
347
+ " cbar=ax==axes[-1], annot=True, fmt='.2f', annot_kws={'size': 7},\n",
348
+ " linewidths=0.5, linecolor='white')\n",
349
+ " ax.set_title(mat.replace('_', ' '), fontsize=9)\n",
350
+ " ax.set_xlabel('Roll Speed (rpm)', fontsize=8)\n",
351
+ " if ax == axes[0]:\n",
352
+ " ax.set_ylabel('Pressure Fraction', fontsize=9)\n",
353
+ " else:\n",
354
+ " ax.set_ylabel('')\n",
355
+ "\n",
356
+ "fig.suptitle('Material Fingerprints: Ribbon Density Response on CL50200',\n",
357
+ " fontsize=14, color=IPA_NAVY, y=1.05)\n",
358
+ "plt.tight_layout()\n",
359
+ "plt.show()\n",
360
+ "\n",
361
+ "print('Each material has a distinct operating fingerprint.')\n",
362
+ "print('Plastic materials (MCC) show strong roll speed sensitivity;')\n",
363
+ "print('brittle materials (lactose, mannitol) are pressure-driven.')"
364
+ ]},
365
+
366
+ {"cell_type": "markdown", "metadata": {}, "source": [
367
+ "---\n",
368
+ "## Takeaways\n",
369
+ "\n",
370
+ "1. **The IPA CL platform scales predictably** from 10 kg/hr (CL25150 lab)\n",
371
+ " to 177+ kg/hr (CL100250 production) with consistent ribbon quality\n",
372
+ " at matched operating conditions.\n",
373
+ "\n",
374
+ "2. **Twin feed screw (HFS + VFS) is the key differentiator.** The VFS/HFS\n",
375
+ " ratio is a uniquely tunable parameter that single-screw compactors\n",
376
+ " cannot offer. Optimal ratio \u2248 1.0 across materials.\n",
377
+ "\n",
378
+ "3. **Material fingerprints guide process development.** Each formulation\n",
379
+ " has a distinct response surface, but the optimal zone is consistent\n",
380
+ " across the CL platform \u2014 enabling direct R&D-to-production transfer.\n",
381
+ "\n",
382
+ "4. **Integrated PM-series milling** (in-air impact method) delivers high\n",
383
+ " granule yields (67\u201374%) with minimal heat generation.\n",
384
+ "\n",
385
+ "5. **Energy efficiency improves at production scale** \u2014 larger models\n",
386
+ " operate on the Pareto frontier with lower specific energy per tonne.\n",
387
+ "\n",
388
+ "---\n",
389
+ "\n",
390
+ "For a lab test or performance assessment on IPA\u2019s CL-series platform: \n",
391
+ "**https://www.innovativeprocess.com** | **(708) 844-6100** | info@ipaapplications.com\n",
392
+ "\n",
393
+ "*Dataset \u00a9 2026 Innovative Process Applications, CC BY 4.0.*"
394
+ ]}
395
+ ],
396
+ "metadata": {
397
+ "colab": {"provenance": [], "toc_visible": true},
398
+ "kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"},
399
+ "language_info": {"name": "python", "version": "3.11"}
400
+ },
401
+ "nbformat": 4,
402
+ "nbformat_minor": 5
403
+ }
LICENSE.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ Creative Commons Attribution 4.0 International (CC BY 4.0)
2
+ ===========================================================
3
+ Copyright (c) 2026 Innovative Process Applications (IPA)
4
+ Full license: https://creativecommons.org/licenses/by/4.0/legalcode
5
+ DISCLAIMER: Synthetic educational data only. Not production guarantees.
README.md CHANGED
@@ -1,3 +1,92 @@
1
- ---
2
- license: cc-by-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # IPA Pharmaceutical Roller Compactor Platform: Scale-Up & Performance (Synthetic)
2
+
3
+ **Version:** 1.0
4
+ **Publisher:** [Innovative Process Applications (IPA)](https://www.innovativeprocess.com)
5
+ **License:** Creative Commons Attribution 4.0 International (CC BY 4.0)
6
+
7
+ > ⚠️ **This dataset is 100% synthetic and intended for educational use only.**
8
+ > Generated from IPA's published CL-series specifications and standard
9
+ > compaction physics — not real production or clinical batch data.
10
+
11
+ ---
12
+
13
+ ## What's in this dataset
14
+
15
+ 3,000 simulated pharmaceutical roller compaction runs spanning IPA's complete
16
+ CL-series platform — from R&D lab (CL25150, 5 HP) through full production
17
+ (CL100250, 25 HP) — across 5 pharma/nutraceutical materials and the full
18
+ operating envelope of twin-feed-screw process parameters.
19
+
20
+ ### Equipment specifications (from IPA published data)
21
+
22
+ | Model | Roll Size | Max Pressure | Integrated Mill | Power | Scale |
23
+ |---|---|---|---|---|---|
24
+ | CL25150 | 1"×6" (2.5×15 cm) | 17.5 kN/cm | None | 5 HP | R&D / Lab |
25
+ | CL30200 | 1"×8" (3×20 cm) | 17.5 kN/cm | PM3 | 2.75 HP | Pilot |
26
+ | CL50200 | 2"×8" (5×20 cm) | 26.0 kN/cm | PM6 | 12 HP | Pilot / Small Prod |
27
+ | CL75200 | 3"×8" (7.5×20 cm) | 15.0 kN/cm | PM6 | 20 HP | Production |
28
+ | CL100250 | 4"×10" (10×25 cm) | 17.5 kN/cm | PM8 | 25 HP | Full Production |
29
+
30
+ ### Column descriptions
31
+
32
+ | Column | Units | Description |
33
+ |---|---|---|
34
+ | `compactor_model` | — | IPA CL-series model |
35
+ | `scale` | — | R&D / Lab, Pilot, Production, Full Production |
36
+ | `roll_diameter_in` / `_cm` | in / cm | Roll diameter |
37
+ | `roll_width_in` / `_cm` | in / cm | Roll width |
38
+ | `max_roll_pressure_kn_cm` | kN/cm | Maximum specific compaction force |
39
+ | `integrated_mill` | — | PM-series in-air impact mill (or None) |
40
+ | `total_power_kw` | kW | Total system power |
41
+ | `material` | — | Pharma material identifier |
42
+ | `feed_density_gcc` | g/cc | Feed powder bulk density |
43
+ | `deformation_type` | — | Plastic, brittle, or mixed |
44
+ | `roll_pressure_fraction` | — | Fraction of max pressure applied (0.3–1.0) |
45
+ | `scf_kn_cm` | kN/cm | Actual specific compaction force |
46
+ | `roll_speed_rpm` | rpm | Roll rotation speed |
47
+ | `hfs_speed_rpm` | rpm | Horizontal feed screw speed (controls throughput) |
48
+ | `vfs_hfs_ratio` | — | Vertical/horizontal feed screw speed ratio (controls pre-compression) |
49
+ | `gap_width_mm` | mm | Roll gap |
50
+ | `ribbon_rel_density` | — | Relative density (fraction of true density) |
51
+ | `ribbon_density_gcc` | g/cc | Absolute ribbon density |
52
+ | `ribbon_porosity` | — | 1 − relative density |
53
+ | `density_cv_pct` | % | Across-ribbon density uniformity |
54
+ | `fines_pct` | % | Fines fraction after milling |
55
+ | `granule_yield_pct` | % | Usable granule yield |
56
+ | `in_zinchuk_window` | Yes/No | Ribbon RD in 0.60–0.80 tabletability range |
57
+ | `throughput_kg_hr` / `_lbs_hr` | kg/hr / lbs/hr | Mass throughput |
58
+ | `specific_energy_kwh_tonne` | kWh/tonne | Energy efficiency |
59
+ | `changeover_time_hr` | hours | Estimated changeover time |
60
+
61
+ ## IPA platform advantages demonstrated in the data
62
+
63
+ 1. **Twin feed screw (HFS + VFS):** Independent control of throughput (HFS)
64
+ and pre-compression (VFS) produces a uniquely tunable operating space.
65
+ The VFS/HFS ratio is a key process parameter not available on single-screw
66
+ compactors.
67
+
68
+ 2. **Scalable platform:** Consistent ribbon quality (CV%, yield) across the
69
+ CL25150 → CL100250 range, enabling direct R&D-to-production scale-up.
70
+
71
+ 3. **Integrated in-air impact milling:** PM-series mills minimize heat
72
+ generation and maximize granule yield with precise PSD control.
73
+
74
+ 4. **Efficient changeover:** Modular design enables fast product changeover,
75
+ critical for multi-product pharma facilities.
76
+
77
+ 5. **Low bulk density capability:** Twin screw design is proven efficient
78
+ with light powders (feed density 0.3–0.5 g/cc) containing high air content.
79
+
80
+ ## Cross-links
81
+
82
+ - **Kaggle:** [link after publication]
83
+ - **Hugging Face:** [link after publication]
84
+ - **Zenodo:** [link after publication]
85
+ - **GitHub:** [link after publication]
86
+ - **IPA website:** https://www.innovativeprocess.com
87
+
88
+ ## Citation
89
+
90
+ > Innovative Process Applications (2026). *IPA Pharmaceutical Roller Compactor
91
+ > Platform: Scale-Up & Performance (Synthetic), v1.0*. CC BY 4.0.
92
+ > https://www.innovativeprocess.com
generate_dataset.py ADDED
@@ -0,0 +1,310 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ IPA Pharmaceutical Roller Compactor Platform: Scale-Up & Performance Dataset v1.0
3
+ ==================================================================================
4
+ Synthetic dataset modeling the IPA CL-series pharmaceutical roller compactor
5
+ platform from R&D (CL25150) through full-scale production (CL100250), using
6
+ IPA's published specifications and Johanson/Heckel physical models.
7
+
8
+ Sources:
9
+ - IPA Pharma RC Brochure (2026)
10
+ - IPA Pharma Compactor Specifications page
11
+ - IPA Roll Compactor page (industrial line dimensions)
12
+ - IPA Products & Services PDF
13
+
14
+ Key IPA differentiators modeled:
15
+ - Twin feed screw design (HFS + VFS independent control)
16
+ - Scalable platform: consistent ribbon quality across CL sizes
17
+ - Integrated milling (PM-series in-air impact mills)
18
+ - Proprietary PLC controls with internal control loops
19
+ - Low bulk density powder processing capability
20
+ - Efficient changeover and simplified maintenance
21
+
22
+ THIS IS SYNTHETIC EDUCATIONAL DATA. NOT REAL CUSTOMER OR LAB DATA.
23
+ """
24
+
25
+ import numpy as np
26
+ import pandas as pd
27
+
28
+ rng = np.random.default_rng(seed=2026)
29
+
30
+ # =============================================================================
31
+ # IPA CL-SERIES PHARMA COMPACTOR SPECS (from published specifications)
32
+ # =============================================================================
33
+ CL_MODELS = [
34
+ {"model": "CL25150", "roll_dia_in": 1.0, "roll_width_in": 6,
35
+ "roll_dia_cm": 2.5, "roll_width_cm": 15,
36
+ "max_pressure_lbs_in": 9900, "max_pressure_kn_cm": 17.5,
37
+ "cap_light_lbs": (10, 23), "cap_heavy_lbs": (25, 56),
38
+ "mill_size": None, "total_hp": 5, "total_kw": 3.75,
39
+ "weight_lbs": 1200, "scale": "R&D / Lab"},
40
+ {"model": "CL30200", "roll_dia_in": 1.0, "roll_width_in": 8,
41
+ "roll_dia_cm": 3.0, "roll_width_cm": 20,
42
+ "max_pressure_lbs_in": 9900, "max_pressure_kn_cm": 17.5,
43
+ "cap_light_lbs": (24, 54), "cap_heavy_lbs": (64, 140),
44
+ "mill_size": "PM3", "total_hp": 2.75, "total_kw": 2.0,
45
+ "weight_lbs": 2100, "scale": "Pilot"},
46
+ {"model": "CL50200", "roll_dia_in": 2.0, "roll_width_in": 8,
47
+ "roll_dia_cm": 5.0, "roll_width_cm": 20,
48
+ "max_pressure_lbs_in": 14800, "max_pressure_kn_cm": 26.0,
49
+ "cap_light_lbs": (64, 140), "cap_heavy_lbs": (120, 265),
50
+ "mill_size": "PM6", "total_hp": 12, "total_kw": 9.0,
51
+ "weight_lbs": 5000, "scale": "Pilot / Small Production"},
52
+ {"model": "CL75200", "roll_dia_in": 3.0, "roll_width_in": 8,
53
+ "roll_dia_cm": 7.5, "roll_width_cm": 20,
54
+ "max_pressure_lbs_in": 8500, "max_pressure_kn_cm": 15.0,
55
+ "cap_light_lbs": (95, 209), "cap_heavy_lbs": (182, 400),
56
+ "mill_size": "PM6", "total_hp": 20, "total_kw": 15.0,
57
+ "weight_lbs": 6000, "scale": "Production"},
58
+ {"model": "CL100250", "roll_dia_in": 4.0, "roll_width_in": 10,
59
+ "roll_dia_cm": 10.0, "roll_width_cm": 25,
60
+ "max_pressure_lbs_in": 9900, "max_pressure_kn_cm": 17.5,
61
+ "cap_light_lbs": (200, 440), "cap_heavy_lbs": (425, 935),
62
+ "mill_size": "PM8", "total_hp": 25, "total_kw": 19.0,
63
+ "weight_lbs": 9500, "scale": "Full Production"},
64
+ ]
65
+
66
+ # =============================================================================
67
+ # PHARMA MATERIALS (representative formulations)
68
+ # =============================================================================
69
+ MATERIALS = {
70
+ "MCC_PH101": {
71
+ "label": "MCC PH-101 (Low Density Filler)",
72
+ "feed_density_gcc": 0.32, "compact_density_gcc": 1.20,
73
+ "heckel_k": 0.020, "heckel_a": 0.55,
74
+ "deformation": "plastic", "flow_index": 4,
75
+ "moisture_pct": 4.5,
76
+ },
77
+ "lactose_DCL11": {
78
+ "label": "Lactose DCL-11 (Direct Compression)",
79
+ "feed_density_gcc": 0.62, "compact_density_gcc": 1.45,
80
+ "heckel_k": 0.014, "heckel_a": 0.50,
81
+ "deformation": "brittle", "flow_index": 7,
82
+ "moisture_pct": 0.5,
83
+ },
84
+ "mannitol_SD200": {
85
+ "label": "Mannitol SD-200 (Spray Dried)",
86
+ "feed_density_gcc": 0.48, "compact_density_gcc": 1.49,
87
+ "heckel_k": 0.012, "heckel_a": 0.48,
88
+ "deformation": "brittle", "flow_index": 6,
89
+ "moisture_pct": 0.3,
90
+ },
91
+ "API_blend_40pct": {
92
+ "label": "API Blend 40% Drug Load",
93
+ "feed_density_gcc": 0.38, "compact_density_gcc": 1.30,
94
+ "heckel_k": 0.017, "heckel_a": 0.52,
95
+ "deformation": "mixed", "flow_index": 3,
96
+ "moisture_pct": 2.0,
97
+ },
98
+ "vitamin_premix": {
99
+ "label": "Vitamin/Mineral Premix (Nutraceutical)",
100
+ "feed_density_gcc": 0.45, "compact_density_gcc": 1.35,
101
+ "heckel_k": 0.015, "heckel_a": 0.50,
102
+ "deformation": "mixed", "flow_index": 5,
103
+ "moisture_pct": 3.0,
104
+ },
105
+ }
106
+
107
+ # =============================================================================
108
+ # PROCESS PARAMETERS
109
+ # =============================================================================
110
+ ROLL_PRESSURE_FRACTIONS = [0.3, 0.5, 0.7, 0.85, 1.0] # fraction of max
111
+ ROLL_SPEED_RPM = [2, 4, 6, 8, 10]
112
+ HFS_SPEED_RPM = [15, 30, 50, 75, 100] # horizontal feed screw
113
+ VFS_RATIO = [0.6, 0.8, 1.0, 1.2, 1.5] # VFS/HFS ratio
114
+
115
+ N_REPLICATES = 3 # per condition
116
+
117
+ # =============================================================================
118
+ # PHYSICS
119
+ # =============================================================================
120
+
121
+ def compute_scf(pressure_lbs_in, roll_width_in):
122
+ """Specific compaction force in kN/cm."""
123
+ return (pressure_lbs_in * 0.00444822) / (roll_width_in * 2.54)
124
+
125
+ def ribbon_density(scf_kn_cm, roll_dia_cm, gap_mm, heckel_k, heckel_a,
126
+ vfs_ratio, hfs_rpm, roll_rpm, deformation):
127
+ """Compute ribbon relative density using Heckel + IPA twin-screw model."""
128
+ # Gap estimate based on roll geometry and pressure
129
+ contact_len = np.sqrt(roll_dia_cm * 10 / 2 * 2.0 * gap_mm)
130
+ pressure_mpa = (scf_kn_cm * 100) / max(contact_len, 3.0)
131
+
132
+ # Heckel
133
+ rd = 1.0 - np.exp(-(heckel_k * pressure_mpa + heckel_a))
134
+
135
+ # Twin feed screw VFS ratio effect — optimal around 1.0
136
+ vfs_optimality = np.exp(-((vfs_ratio - 1.0) ** 2) / (2 * 0.15 ** 2))
137
+ rd *= (0.90 + 0.10 * vfs_optimality)
138
+
139
+ # Roll speed / dwell time
140
+ if deformation == "plastic":
141
+ rd *= (1.0 - 0.006 * max(roll_rpm - 4, 0))
142
+ elif deformation == "brittle":
143
+ rd *= (1.0 - 0.001 * max(roll_rpm - 4, 0))
144
+ else:
145
+ rd *= (1.0 - 0.003 * max(roll_rpm - 4, 0))
146
+
147
+ # HFS feed rate effect on pre-densification
148
+ feed_ratio = hfs_rpm / max(roll_rpm, 1)
149
+ feed_opt = np.exp(-((feed_ratio - 10) ** 2) / (2 * 5 ** 2))
150
+ rd *= (0.95 + 0.05 * feed_opt)
151
+
152
+ return np.clip(rd, 0.35, 0.92)
153
+
154
+ def compute_throughput(model, material, roll_rpm, hfs_rpm, rd):
155
+ """Throughput in kg/hr based on capacity range and operating conditions."""
156
+ if material["feed_density_gcc"] <= 0.5:
157
+ cap_range = model["cap_light_lbs"]
158
+ else:
159
+ cap_range = model["cap_heavy_lbs"]
160
+
161
+ # Scale within capacity range based on operating conditions
162
+ rpm_frac = (roll_rpm - 2) / 8
163
+ hfs_frac = (hfs_rpm - 15) / 85
164
+ operating_frac = 0.5 * rpm_frac + 0.5 * hfs_frac
165
+
166
+ throughput_lbs = cap_range[0] + (cap_range[1] - cap_range[0]) * np.clip(operating_frac, 0, 1)
167
+ throughput_kg = throughput_lbs * 0.4536
168
+ return throughput_lbs, throughput_kg
169
+
170
+ def density_uniformity_cv(vfs_ratio, hfs_rpm, roll_rpm, model_scale):
171
+ """Across-ribbon density CV%. Twin feed screw advantage."""
172
+ # Baseline: twin screw gives good uniformity
173
+ base_cv = 2.5
174
+ # VFS ratio: optimal around 1.0
175
+ vfs_penalty = 2.0 * abs(vfs_ratio - 1.0)
176
+ # Feed ratio
177
+ ratio = hfs_rpm / max(roll_rpm, 1)
178
+ ratio_penalty = 1.5 * abs(ratio - 10) / 10
179
+ # Scale: larger machines slightly harder to keep uniform
180
+ scale_factors = {"R&D / Lab": 0, "Pilot": 0.2, "Pilot / Small Production": 0.3,
181
+ "Production": 0.5, "Full Production": 0.7}
182
+ scale_pen = scale_factors.get(model_scale, 0.3)
183
+ return base_cv + vfs_penalty + ratio_penalty + scale_pen
184
+
185
+ def compute_granule_yield(rd, fines_pct):
186
+ """Yield = 100% - fines% - oversize%."""
187
+ oversize = max(0, 5 * (rd - 0.82)) # over-compacted ribbons resist milling
188
+ return np.clip(100 - fines_pct - oversize, 40, 98)
189
+
190
+ def compute_fines(rd, deformation):
191
+ """Fines fraction after integrated PM-series mill."""
192
+ base = 55 * (1 - rd)
193
+ if deformation == "brittle":
194
+ base += 5
195
+ return np.clip(base, 3, 50)
196
+
197
+ def compute_changeover_hr(model):
198
+ """Changeover time — IPA advantage: efficient changeover design."""
199
+ # Scales with machine size
200
+ base = 1.0 + 0.5 * np.log2(model["weight_lbs"] / 1200)
201
+ return round(base, 1)
202
+
203
+ # =============================================================================
204
+ # GENERATE DATASET
205
+ # =============================================================================
206
+ rows = []
207
+ run_id = 0
208
+
209
+ for model in CL_MODELS:
210
+ for mat_key, mat in MATERIALS.items():
211
+ for pf in ROLL_PRESSURE_FRACTIONS:
212
+ for rs in ROLL_SPEED_RPM:
213
+ for hfs in HFS_SPEED_RPM:
214
+ for vr in VFS_RATIO:
215
+ for rep in range(N_REPLICATES):
216
+ run_id += 1
217
+ pressure = model["max_pressure_lbs_in"] * pf
218
+ scf = compute_scf(pressure, model["roll_width_in"])
219
+ gap_mm = 1.5 + rng.uniform(-0.3, 0.3)
220
+
221
+ rd = ribbon_density(
222
+ scf, model["roll_dia_cm"], gap_mm,
223
+ mat["heckel_k"], mat["heckel_a"],
224
+ vr, hfs, rs, mat["deformation"])
225
+ rd += rng.normal(0, 0.010)
226
+ rd = np.clip(rd, 0.35, 0.92)
227
+
228
+ rib_density_gcc = rd * mat["compact_density_gcc"]
229
+ porosity = 1 - rd
230
+
231
+ cv = density_uniformity_cv(vr, hfs, rs, model["scale"])
232
+ cv += rng.normal(0, 0.3)
233
+ cv = np.clip(cv, 1.0, 12.0)
234
+
235
+ fines = compute_fines(rd, mat["deformation"])
236
+ fines += rng.normal(0, 1.5)
237
+ fines = np.clip(fines, 2, 55)
238
+
239
+ tp_lbs, tp_kg = compute_throughput(model, mat, rs, hfs, rd)
240
+ tp_kg += rng.normal(0, tp_kg * 0.03)
241
+ tp_kg = max(tp_kg, 1)
242
+ tp_lbs = tp_kg / 0.4536
243
+
244
+ granule_yield = compute_granule_yield(rd, fines)
245
+ granule_yield += rng.normal(0, 1.0)
246
+ granule_yield = np.clip(granule_yield, 35, 99)
247
+
248
+ zinchuk = "Yes" if 0.60 <= rd <= 0.80 else "No"
249
+ changeover = compute_changeover_hr(model)
250
+
251
+ # Specific energy
252
+ power_kw = model["total_kw"] * (0.4 + 0.6 * pf)
253
+ se = (power_kw / max(tp_kg, 1)) * 1000 # kWh/tonne
254
+
255
+ rows.append({
256
+ "run_id": run_id,
257
+ "compactor_model": model["model"],
258
+ "scale": model["scale"],
259
+ "roll_diameter_in": model["roll_dia_in"],
260
+ "roll_width_in": model["roll_width_in"],
261
+ "roll_diameter_cm": model["roll_dia_cm"],
262
+ "roll_width_cm": model["roll_width_cm"],
263
+ "max_roll_pressure_kn_cm": model["max_pressure_kn_cm"],
264
+ "integrated_mill": model["mill_size"] if model["mill_size"] else "None",
265
+ "total_power_kw": model["total_kw"],
266
+ "material": mat_key,
267
+ "feed_density_gcc": mat["feed_density_gcc"],
268
+ "deformation_type": mat["deformation"],
269
+ "roll_pressure_fraction": pf,
270
+ "scf_kn_cm": round(scf, 2),
271
+ "roll_speed_rpm": rs,
272
+ "hfs_speed_rpm": hfs,
273
+ "vfs_hfs_ratio": vr,
274
+ "gap_width_mm": round(gap_mm, 2),
275
+ "ribbon_rel_density": round(rd, 4),
276
+ "ribbon_density_gcc": round(rib_density_gcc, 4),
277
+ "ribbon_porosity": round(porosity, 4),
278
+ "density_cv_pct": round(cv, 2),
279
+ "fines_pct": round(fines, 2),
280
+ "granule_yield_pct": round(granule_yield, 2),
281
+ "in_zinchuk_window": zinchuk,
282
+ "throughput_kg_hr": round(tp_kg, 1),
283
+ "throughput_lbs_hr": round(tp_lbs, 1),
284
+ "specific_energy_kwh_tonne": round(se, 2),
285
+ "changeover_time_hr": changeover,
286
+ "replicate": rep + 1,
287
+ })
288
+
289
+ df = pd.DataFrame(rows)
290
+
291
+ # Subsample to manageable size (full factorial is huge)
292
+ # Keep ~3000 rows: stratified by model and material
293
+ samples = []
294
+ for _, group in df.groupby(["compactor_model", "material"]):
295
+ samples.append(group.sample(min(120, len(group)), random_state=42))
296
+ df_sampled = pd.concat(samples, ignore_index=True)
297
+ df_sampled["run_id"] = range(1, len(df_sampled) + 1)
298
+ df_sampled.to_csv("ipa_pharma_compactor_v1.0.csv", index=False)
299
+
300
+ print(f"Wrote {len(df_sampled)} rows, {len(df_sampled.columns)} columns")
301
+ print(f"\n=== Model distribution ===")
302
+ print(df_sampled["compactor_model"].value_counts().sort_index())
303
+ print(f"\n=== Scale-up: mean throughput by model ===")
304
+ print(df_sampled.groupby("compactor_model")["throughput_kg_hr"].mean().round(1))
305
+ print(f"\n=== Zinchuk compliance ===")
306
+ print(df_sampled["in_zinchuk_window"].value_counts())
307
+ print(f"\n=== Mean density CV% by model ===")
308
+ print(df_sampled.groupby("compactor_model")["density_cv_pct"].mean().round(2))
309
+ print(f"\n=== Mean granule yield by model ===")
310
+ print(df_sampled.groupby("compactor_model")["granule_yield_pct"].mean().round(1))
ipa_pharma_compactor_v1.0.csv ADDED
The diff for this file is too large to render. See raw diff