Full listing of all docstrings by module
execute_simulation(inputs)
Run the selected simulation tool with the provided inputs. Returns output data based on the chosen simulation mode.
Source code in lyopronto/high_level.py
generate_visualizations(output_data, inputs, timestamp)
Create and save publication-quality plots based on simulation results.
Source code in lyopronto/high_level.py
read_inputs(filename)
Read inputs from a YAML file.
Source code in lyopronto/high_level.py
save_csv(output_data, inputs, timestamp)
Export simulation results to CSV file with appropriate formatting.
Source code in lyopronto/high_level.py
save_inputs(inputs, timestamp)
Save inputs to a YAML file with timestamped filename.
Source code in lyopronto/high_level.py
save_inputs_legacy(inputs, timestamp)
Save inputs to a CSV file with timestamped filename.
Source code in lyopronto/high_level.py
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 | |
calc_knownRp
dry(vial, product, ht, Pchamber, Tshelf, dt)
Simulate the primary drying process for known condiditions and parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vial
|
dict
|
see master simulation inputs |
required |
product
|
dict
|
see master simulation inputs |
required |
ht
|
dict
|
see master simulation inputs |
required |
Pchamber
|
dict
|
see master simulation inputs |
required |
Tshelf
|
dict
|
see master simulation inputs |
required |
dt
|
float
|
Fixed time step for output [hours] |
required |
Returns:
| Name | Type | Description |
|---|---|---|
output_table |
ndarray
|
Simulation output table with columns for: 0. Time [hr], 1. Sublimation front temperature [°C], 2. Vial bottom temperature [°C], 3. Shelf temperature [°C], 4. Chamber pressure [mTorr], 5. Sublimation flux [kg/hr/m²], 6. Drying percent [%] |
Source code in lyopronto/calc_knownRp.py
design_space
dry(vial, product, ht, Pchamber, Tshelf, dt, eq_cap, nVial)
Compute quantities necessary for constructing a graphical design space.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vial
|
dict
|
description |
required |
product
|
dict
|
description |
required |
ht
|
dict
|
description |
required |
Pchamber
|
dict
|
description |
required |
Tshelf
|
dict
|
description |
required |
dt
|
float
|
description |
required |
eq_cap
|
dict
|
description |
required |
nVial
|
int
|
description |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ndarray |
table of results for shelf isotherms |
|
ndarray |
table of results for product isotherms |
|
ndarray |
table of results for equipment capability curve |
The first two returns have 5 rows corresponding to
- Maximum product temperature in degC
- Primary drying time in hr
- Average sublimation flux in kg/hr/m^2
- Maximum/minimum sublimation flux in kg/hr/m^2
- Sublimation flux at the end of primary drying in kg/hr/m^2
The third return has 3 rows corresponding to the first three of that list.
With nT setpoints in Tshelf['setpt'] and nP setpoints in Pchamber['setpt'], the returned arrays have the following shapes: - Shelf isotherms: (5, nT, nP) array - Product isotherms: (5, 2) array (for the lowest and highest Pchamber setpoints) - Equipment capability curve: (3, nP) array
Source code in lyopronto/design_space.py
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 | |
functions
File with a bunch of functions in it.
RampInterpolator
Class to handle ramped setpoint interpolation.
Source code in lyopronto/functions.py
Eq_Constraints(Pch, dmdt, Tbot, Tsh, Psub, Tsub, Kv, Lpr0, Lck, Av, Ap, Rp)
Defines the equality constraints for lyophilization. Inputs are chamber pressure in Torr, sublimation rate in kg/hr, vial bottom temperature in degC, shelf temperature in degC, sublimation front pressure in Torr, sublimation front temperature in degC, vial heat transfer coefficient in cal/s/cm^2/C, initial product length in cm, cake length in cm, vial area in cm^2, product area in cm^2, and product resistance in cm^2-Torr-hr/g
Source code in lyopronto/functions.py
Ineq_Constraints(Pch, dm_dt, Tcrit, Tbot, a, b, nVial)
Defines the inequality constraints for lyophilization optimization within safe operation region inside the desgin space. Inputs are chamber pressure in Torr, sublimation rate in kg/hr, critical product temperature in degC, vial bottom temperature in degC, equipment capability parameters a in kg/hr and b in kg/hr/Torr, and number of vials
Source code in lyopronto/functions.py
Kv_FUN(KC, KP, KD, Pch)
Calculates the vial heat transfer coefficient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
KC
|
float
|
Vial heat transfer parameter in cal/s/K/cm^2. |
required |
KP
|
float
|
Vial heat transfer parameter in cal/s/K/cm^2/Torr. |
required |
KD
|
float
|
Vial heat transfer parameter in 1/Torr. |
required |
Pch
|
float
|
Chamber pressure in Torr. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Vial heat transfer coefficient in cal/s/K/cm^2. |
Source code in lyopronto/functions.py
Lpr0_FUN(Vfill, Ap, cSolid)
Calculates the intial fill height of the frozen product in cm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Vfill
|
float
|
fill volume in mL |
required |
Ap
|
float
|
product area in cm^2 |
required |
cSolid
|
float
|
concentration of the solute in solution, g/mL |
required |
Returns:
| Type | Description |
|---|---|
float
|
initial fill height of the frozen product, in cm. |
Source code in lyopronto/functions.py
Rp_FUN(L, R0, A1, A2)
Calculates product resistance in cm^2-hr-Torr/g.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
L
|
float
|
cake length in cm |
required |
R0
|
float
|
base product resistance in cm^2-hr-Torr/g |
required |
A1
|
float
|
product resistance parameter in cm-hr-Torr/g |
required |
A2
|
float
|
product resistance parameter in 1/cm |
required |
Returns:
| Type | Description |
|---|---|
float
|
product resistance in cm^2-hr-Torr/g |
Source code in lyopronto/functions.py
Rp_finder(T_sub, Lpr0, Lck, Pch, Tbot)
Calculates product resistance in cm^2-hr-Torr/g. Inputs are sublimation temperature in degC, initial product length in cm, cake length in cm, chamber pressure in Torr, and vial bottom temperature in degC
Source code in lyopronto/functions.py
T_bot_FUN(T_sub, Lpr0, Lck, Pch, Rp)
Calculates the temperature at the bottom of the vial in degC. Inputs are sublimation front temperature in degC, initial product length in cm, cake length in cm, chamber pressure in Torr, and product resistance in cm^2-Torr-hr/g
Source code in lyopronto/functions.py
T_sub_Rp_finder(T_sub, *data)
Tsub is found from solving for T_unknown. Determines the function to calculate the sublimation temperature represented as T_unknown. Other inputs are chamber pressure in Torr, vial area in cm^2, product area in cm^2, vial heat transfer coefficient in cal/s/K/cm^2, initial product length in cm, cake length in cm, vial bottom temperature in degC, and shelf temperature in degC
Source code in lyopronto/functions.py
T_sub_fromTpr(T_unknown, *data)
Tsub is found from solving for T_unknown. # Determines the function to calculate the sublimation temperature represented as T_unknown. Other inputs are vial bottom temperature in degC, initial product length in cm, cake length in cm, chamber pressure in Torr, and product resistance in cm^2-Torr-hr/g
Source code in lyopronto/functions.py
T_sub_solver_FUN(T_sub_guess, *data)
Tsub is found from solving for T_unknown. Determines the function to calculate the sublimation temperature represented as T_unknown. Other inputs are chamber pressure in Torr, vial area in cm^2, product area in cm^2, vial heat transfer coefficient in cal/s/K/cm^2, initial product length in cm, cake length in cm, product resistance in cm^2-Torr-hr/g, and shelf temperature in degC
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
T_sub_guess
|
float
|
Initial guess for the sublimation temperature in degC. |
required |
data
|
tuple
|
Pch, Av, Ap, Kv, Lpr0, Lck, Rp, Tsh |
()
|
Returns:
| Type | Description |
|---|---|
float
|
residual for the pseudosteady heat balance |
Source code in lyopronto/functions.py
Tbot_max_eq_cap(Pch, dm_dt, Lpr0, Lck, Rp, Ap)
Calculates the maximum product temperature (occus at vial bottom) in degC. Inputs are chamber pressure in Torr, sublimation rate based on equipment capability in kg/hr, initial product length in cm, cake length in cm, product resistance in cm^2-Torr-hr/g, and product area in cm^2
Source code in lyopronto/functions.py
Vapor_pressure(T_sub)
Calculates the vapor pressure in Torr. Input is sublimation front temperature in degC
calc_step(t, Lck, inputs)
Calculate the full set of system states at a given time step from ODE solution states.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
float
|
The current time in hours. |
required |
Lck
|
float
|
The cake thickness in cm. |
required |
inputs
|
tuple
|
A tuple containing the inputs parameters. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The full set of system states at the given time step: 0. Time [hr], 1. Sublimation front temperature [°C], 2. Vial bottom temperature [°C], 3. Shelf temperature [°C], 4. Chamber pressure [mTorr], 5. Sublimation flux [kg/hr/m²], 6. Drying percent [%] |
Source code in lyopronto/functions.py
crystallization_time_FUN(V, h, Av, Tf, Tn, Tsh_func, t0)
Calculates the crystallization time in hr. Inputs are fill volume in mL, heat transfer coefficient in W/m^2/K, vial area in cm^2, freezing temperature in degC, nucleation temperature in degC, shelf temperature in degC
Source code in lyopronto/functions.py
fill_output(sol, inputs)
Fill the output array with the results from the ODE solver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sol
|
ODESolution
|
The solution object returned by the ODE solver. |
required |
inputs
|
tuple
|
A tuple containing the input parameters. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The output array filled with the results from the ODE solver. |
Each call to calc_step requires a nonlinear solve for Tsub, so doing this for thousands of points is impractical. Instead, we calculate at the the ODE solver points, and interpolate elsewhere.
Source code in lyopronto/functions.py
lumped_cap_Tpr_abstract(t, Tpr0, V, h, Av, Tsh, Tsh0, Tsh_ramp, rho, Cpi)
Calculates the product temperature in C. Inputs are time in hr, initial product temperature in degC, product density in g/mL, constant pressure specific heat of the product in J/kg/K, product volume in mL, heat transfer coefficient in W/m^2/K, vial area in cm^2, current shelf temperature in degC, initial shelf temperature in degC, shelf temperature ramping rate in degC/min
Source code in lyopronto/functions.py
sub_rate(Ap, Rp, T_sub, Pch)
Calculates the sublimation rate from each vial in kg/hr. Inputs are product area in cm^2, product resistance in cm^2-Torr-hr/g, sublimation front temperature in degC, and chamber pressure in Torr
Source code in lyopronto/functions.py
high_level
execute_simulation(inputs)
Run the selected simulation tool with the provided inputs. Returns output data based on the chosen simulation mode.
Source code in lyopronto/high_level.py
generate_visualizations(output_data, inputs, timestamp)
Create and save publication-quality plots based on simulation results.
Source code in lyopronto/high_level.py
read_inputs(filename)
Read inputs from a YAML file.
Source code in lyopronto/high_level.py
save_csv(output_data, inputs, timestamp)
Export simulation results to CSV file with appropriate formatting.
Source code in lyopronto/high_level.py
save_inputs(inputs, timestamp)
Save inputs to a YAML file with timestamped filename.
Source code in lyopronto/high_level.py
save_inputs_legacy(inputs, timestamp)
Save inputs to a CSV file with timestamped filename.
Source code in lyopronto/high_level.py
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 | |
plot_styling
axis_style_designspace(ax, ylabel, **kwargs)
Function to set styling for axes, with pressure on x and sublimation flux on y. See axis_tick_styling for more usable kwargs.
Source code in lyopronto/plot_styling.py
axis_style_percdried(ax, **kwargs)
Function to set styling for axes, with time on x and percent dried on y. See axis_tick_styling for more usable kwargs.
Source code in lyopronto/plot_styling.py
axis_style_pressure(ax, **kwargs)
Function to set styling for axes, with time on x and pressure on y. See axis_tick_styling for more usable kwargs.
Source code in lyopronto/plot_styling.py
axis_style_rp(ax, **kwargs)
Function to set styling for axes, with dry layer height on x and product resistance on y. See axis_tick_styling for more usable kwargs.
Source code in lyopronto/plot_styling.py
axis_style_subflux(ax, **kwargs)
Function to set styling for axes, with time on x and sublimation flux on y. See axis_tick_styling for more usable kwargs.
Source code in lyopronto/plot_styling.py
axis_style_temperature(ax, **kwargs)
Function to set styling for axes, with time on x and temperature on y. See axis_tick_styling for more usable kwargs.
Source code in lyopronto/plot_styling.py
axis_tick_styling(ax, color='k', gcafontSize=60, majorTickWidth=5, minorTickWidth=3, majorTickLength=30, minorTickLength=20, labelPad=30)
summary
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ax
|
Axes
|
Axes object to style |
required |
color
|
str
|
Axis and tick color. Defaults to 'k'. |
'k'
|
gcafontSize
|
int
|
Font size for tick labels (and axis labels). Defaults to 60. |
60
|
majorTickWidth
|
int
|
Width of major ticks. Defaults to 5. |
5
|
minorTickWidth
|
int
|
Width of minor ticks. Defaults to 3. |
3
|
majorTickLength
|
int
|
Length of major ticks. Defaults to 30. |
30
|
minorTickLength
|
int
|
Length of minor ticks. Defaults to 20. |
20
|
labelPad
|
int
|
padding between axes and axis labels. Defaults to 30. |
30
|