forked from CIDARLAB/DAFD
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTolerance_Report.pmd
More file actions
166 lines (140 loc) · 5.31 KB
/
Copy pathTolerance_Report.pmd
File metadata and controls
166 lines (140 loc) · 5.31 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
% DAFD Design Report
% Please cite (doi number)
% June 4th, 2020
```python echo=False
#This is a script to put all default html templates (such as tables) and functions
top = """
<html>
<head>
<style>
table, th, td {
border: 2px solid black;
border-collapse: collapse;
text-align: center;
font-size: 14px;
padding: 4px;
}
th {
background-color: #c0c0c0;
}
</style>
</head>
<body>"""
bottom = """</body>
</html>"""
def make_list_text(input_dict, num=3):
keynames = list(input_dict.keys())
values = []
for value in input_dict.values():
if type(value) is str:
values.append(value)
else:
values.append(np.around(value,num))
output = ""
for i in range(len(keynames)):
output += "<b>{}:</b> {}  ".format(keynames[i], values[i])
return output
def make_table_rows(input_dict, num=3):
keynames = list(input_dict.keys())
values = []
for value in input_dict.values():
if type(value) is str:
values.append(value)
else:
values.append(np.around(value,num))
headers = "<tr> \n"
vals = "<tr> \n"
for i in range(len(keynames)):
headers += "<th>{}</th> \n".format(keynames[i])
vals += "<td>{}</td> \n".format(values[i])
headers += "</tr> \n"
vals += "</tr> \n"
return headers, vals
```
Thank you for using DAFD, the first machine-learning design automation tool for droplet microfluidics. Below is a summary
of your design, along with helpful information in troubleshooting possible fabrication errors.
### Assembly Information

# Droplet Generator Overview
### Fluid Properties:
```python echo=False
import pickle
from IPython.display import Markdown as md
import numpy as np
run_info = pickle.load(open( "tol.p", "rb" ))
headers, vals = make_table_rows(run_info["Fluids"])
table = "<table style=\"width:60%;margin-left:auto;margin-right:auto;\"> \n"
table += headers + vals + "</table> \n"
md(top + table + bottom)
```
### Droplet Generator Design:
```python echo=False
features = run_info["features"].copy()
microns = ["orifice_size", "depth", "outlet_width", "orifice_length", "water_inlet", "oil_inlet"]
mlhr = ["oil_flow"]
ulmin = ["water_flow"]
for key in list(features.keys()):
if key in microns:
features[str.capitalize(key).replace("_", " ") + " (\u03BCm)"] = features.pop(key)
elif key in mlhr:
features[str.capitalize(key).replace("_", " ") + " (mL/hr)"] = features.pop(key)
else:
features[str.capitalize(key).replace("_", " ") + " (\u03BCL/min)"] = features.pop(key)
headers, vals = make_table_rows(features)
var_types = """
<tr>
<th colspan="6">Geometric Parameters:</th>
<th colspan="2">Flow Parameters:</th>
</tr>
"""
table = "<table style=\"width:100%;margin-left:auto;margin-right:auto;\"> \n"
table += var_types + headers + vals + "</table> \n"
md(table)
```
### Expected Performance:
```python echo=False
outputs = run_info["base_performance"].copy()
del outputs["oil_rate"]
del outputs["water_rate"]
outputs["Generation rate (Hz)"] = outputs.pop("generation_rate")
outputs["Droplet size (\u03BCm)"] = outputs.pop("droplet_size")
outputs["Inferred droplet size (\u03BCm)"] = outputs.pop("inferred_droplet_size")
for key in list(outputs.keys()):
if key == "regime" or key == "Regime":
if int(outputs[key]) == 1:
outputs["Regime"] = "Dripping"
else:
outputs["Regime"] = "Jetting"
del outputs[key]
else:
outputs[key] = float(outputs[key])
headers, vals = make_table_rows(outputs, num=1)
table = "<table style=\"width:60%;margin-left:auto;margin-right:auto;\"> \n"
table += headers + vals + "</table> \n"
md(table)
```
# Tolerances of Design:
Using your input tolerance of **<%run_info["tolerance"]*100%>%**, variance-based sensitivity analysis was performed to identify the principal design features
for droplet size and generation rate to better troubleshoot any issues from device fabrication (top left bar plots).
Large difference between predicted and observed performance could be due to this. These principal features were then
plotted against all other design inputs, to visualize their relative effects on performance output. More information about
the underlying analysis can be found [here](https://en.wikipedia.org/wiki/Variance-based_sensitivity_analysis).
*Note: If you see multiple distinct regions (sharp jumps) within the heatmaps, then your current performance is right
at the regime change boundary. Droplet generation could be unstable, and therefore we recommend re-running DAFD with different
constraints*
### Droplet Size:

### Generation Rate:

# Flow Rate Map:
To troubleshoot your device performance without fabricating a brand new device, below are heatmaps visualizing the performance
changes caused by **only** changing flow rates. This provides a visual guide to understanding how changing these rates
affect both droplet size and generation rate, rather than doing so through trial and error.

### Questions? Contact Us:
Corresponding Authors: Ali Lashkaripour ([lashkari@bu.edu](lashkari@bu.edu)) & Prof. Douglas Densmore ([dougd@bu.edu](dougd@bu.edu))
<html>
<div id="content">
<img src="all_logos.png" class="ribbon"/>
</div>
</html>