|
11 | 11 | "cell_type": "markdown", |
12 | 12 | "metadata": {}, |
13 | 13 | "source": [ |
14 | | - "This example comes from M.D. Stuber. A Differentiable Model for Optimizing Hybridization of Industrial Process Heat Systems with Concentrating Solar Thermal Power. *Processes*, 6(7), 76 (2018) DOI: [10.3390/pr6070076](https://doi.org/10.3390/pr6070076)\n", |
| 14 | + "This example comes from M.D. Stuber. A Differentiable Model for Optimizing Hybridization of Industrial Process Heat Systems with Concentrating Solar Thermal Power. _Processes_, 6(7), 76 (2018) DOI: [10.3390/pr6070076](https://doi.org/10.3390/pr6070076)\n", |
15 | 15 | "\n", |
16 | 16 | "In this example, we seek to determine the optimal thermal energy storage capacity and parabolic trough solar array aperture area that maximizes the lifecycle savings associated with augmenting a conventional natural gas industrial process heat system. Here, we use user-defined functions, the JuMP modeling language, the EAGO spatial branch-and-bound algorithm with custom upper- and lower-bounding procedures, and the IPOPT algorithm for solving the bounding subproblems.\n", |
17 | 17 | "\n", |
|
42 | 42 | "metadata": {}, |
43 | 43 | "outputs": [], |
44 | 44 | "source": [ |
45 | | - "using CSV;" |
| 45 | + "using CSV, DataFrames;" |
46 | 46 | ] |
47 | 47 | }, |
48 | 48 | { |
|
59 | 59 | }, |
60 | 60 | { |
61 | 61 | "cell_type": "code", |
62 | | - "execution_count": 3, |
| 62 | + "execution_count": 4, |
63 | 63 | "metadata": {}, |
64 | 64 | "outputs": [], |
65 | 65 | "source": [ |
66 | | - "include(\"smoothMinMaxAbs.jl\")\n", |
67 | 66 | "include(\"solarAngles.jl\")\n", |
68 | 67 | "include(\"PTCmodel.jl\")\n", |
69 | 68 | "include(\"iphProcessSmooth.jl\")\n", |
70 | 69 | "include(\"lifecycleCost.jl\")\n", |
71 | | - "\n", |
72 | 70 | "# Step 1: read the data into a table and extract the appropriate data into a vector\n", |
73 | 71 | "input_file = \"FirebaughTMY_Julia.csv\"\n", |
74 | | - "solData = CSV.read(input_file)\n", |
| 72 | + "solData = CSV.File(input_file) |> DataFrame\n", |
75 | 73 | "yData = convert(Array{Float64,1},solData[:,7])\n", |
76 | 74 | "\n", |
77 | 75 | "# Step 2: get the specific thermal power potential for the region [kW/m^2]\n", |
|
90 | 88 | }, |
91 | 89 | { |
92 | 90 | "cell_type": "code", |
93 | | - "execution_count": 4, |
| 91 | + "execution_count": 5, |
94 | 92 | "metadata": {}, |
95 | 93 | "outputs": [], |
96 | 94 | "source": [ |
|
106 | 104 | }, |
107 | 105 | { |
108 | 106 | "cell_type": "code", |
109 | | - "execution_count": 5, |
| 107 | + "execution_count": 6, |
110 | 108 | "metadata": {}, |
111 | 109 | "outputs": [], |
112 | 110 | "source": [ |
|
161 | 159 | }, |
162 | 160 | { |
163 | 161 | "cell_type": "code", |
164 | | - "execution_count": 6, |
| 162 | + "execution_count": 7, |
165 | 163 | "metadata": {}, |
166 | 164 | "outputs": [], |
167 | 165 | "source": [ |
|
215 | 213 | }, |
216 | 214 | { |
217 | 215 | "cell_type": "code", |
218 | | - "execution_count": 7, |
| 216 | + "execution_count": 8, |
219 | 217 | "metadata": {}, |
220 | 218 | "outputs": [], |
221 | 219 | "source": [ |
|
240 | 238 | }, |
241 | 239 | { |
242 | 240 | "cell_type": "code", |
243 | | - "execution_count": 11, |
| 241 | + "execution_count": 13, |
244 | 242 | "metadata": {}, |
245 | 243 | "outputs": [], |
246 | 244 | "source": [ |
|
262 | 260 | }, |
263 | 261 | { |
264 | 262 | "cell_type": "code", |
265 | | - "execution_count": 12, |
| 263 | + "execution_count": 14, |
266 | 264 | "metadata": {}, |
267 | 265 | "outputs": [ |
268 | 266 | { |
269 | 267 | "name": "stdout", |
270 | 268 | "output_type": "stream", |
271 | 269 | "text": [ |
272 | | - "-------------------------------------------------------------------------------------------------------\n", |
273 | | - "| Iteration # | Nodes | Lower Bound | Upper Bound | Gap | Ratio | Time | Time Left |\n", |
274 | | - "-------------------------------------------------------------------------------------------------------\n", |
275 | | - "| 1 | 2 | -7.531E6 | 3.084E2 | 7.531E6 | 1.000E0 | 1.211E0 | 9.988E2 |\n", |
276 | | - "| 2 | 3 | -7.531E6 | 3.084E2 | 7.531E6 | 1.000E0 | 2.007E0 | 9.980E2 |\n", |
277 | | - "| 3 | 2 | -7.492E6 | -7.318E6 | 1.740E5 | 2.322E-2 | 5.518E0 | 9.945E2 |\n", |
278 | | - "| 4 | 1 | -7.492E6 | -7.318E6 | 1.740E5 | 2.322E-2 | 5.787E0 | 9.942E2 |\n", |
279 | | - "| 5 | 2 | -7.344E6 | -7.318E6 | 2.654E4 | 3.614E-3 | 7.950E0 | 9.920E2 |\n", |
280 | | - "First Solution Found at Node 7\n", |
281 | | - "UBD = -7.317666312971923e6\n", |
| 270 | + "-----------------------------------------------------------------------------------------------------------------------------\n", |
| 271 | + "| Iteration # | Nodes | Lower Bound | Upper Bound | Gap | Ratio | Time | Time Left |\n", |
| 272 | + "-----------------------------------------------------------------------------------------------------------------------------\n", |
| 273 | + "| 1 | 2 | --0.753E7 | 0.308E3 | 0.753E7 | 0.100E1 | 0.647E0 | 0.999E3 |\n", |
| 274 | + "| 2 | 3 | --0.753E7 | 0.308E3 | 0.753E7 | 0.100E1 | 0.142E2 | 0.986E3 |\n", |
| 275 | + "| 3 | 4 | --0.749E7 | 0.308E3 | 0.749E7 | 0.100E1 | 0.279E2 | 0.972E3 |\n", |
| 276 | + "| 4 | 5 | --0.749E7 | 0.308E3 | 0.749E7 | 0.100E1 | 0.408E2 | 0.959E3 |\n", |
| 277 | + "| 5 | 2 | --0.734E7 | --0.732E7 | 0.265E5 | 0.361E-2 | 0.420E2 | 0.958E3 |\n", |
| 278 | + " \n", |
| 279 | + "First Solution Found at Node 9\n", |
| 280 | + "LBD = -7.344210617924415e6\n", |
| 281 | + "UBD = -7.3176663129719095e6\n", |
282 | 282 | "Solution is :\n", |
283 | | - " X[1] = 11.722361250304994\n", |
284 | | - " X[2] = 43615.190600813985\n", |
285 | | - " 7.957378 seconds (513.77 k allocations: 5.701 GiB, 9.31% gc time)\n", |
286 | | - "xts* = 11.722361250304994 xa* = 43615.190600813985 f* = 7.317666312971923e6 SF* = 0.6980196901665338\n", |
| 283 | + " X[1] = 11.722361246205823\n", |
| 284 | + " X[2] = 43615.19059009129\n", |
| 285 | + " \n", |
| 286 | + " 41.952241 seconds (5.48 M allocations: 60.761 GiB, 4.64% gc time)\n", |
| 287 | + "xts* = 11.722361246205823 xa* = 43615.19059009129 f* = 7.3176663129719095e6 SF* = 0.6980196900769012\n", |
287 | 288 | "Algorithm terminated with a status of OPTIMAL and a result code of FEASIBLE_POINT\n" |
288 | 289 | ] |
289 | 290 | } |
|
313 | 314 | "lastKernelId": null |
314 | 315 | }, |
315 | 316 | "kernelspec": { |
316 | | - "display_name": "Julia 1.3.1", |
| 317 | + "display_name": "Julia 1.6.1", |
317 | 318 | "language": "julia", |
318 | | - "name": "julia-1.3" |
| 319 | + "name": "julia-1.6" |
319 | 320 | }, |
320 | 321 | "language_info": { |
321 | 322 | "file_extension": ".jl", |
322 | 323 | "mimetype": "application/julia", |
323 | 324 | "name": "julia", |
324 | | - "version": "1.3.1" |
| 325 | + "version": "1.6.1" |
325 | 326 | } |
326 | 327 | }, |
327 | 328 | "nbformat": 4, |
|
0 commit comments