updating notebooks
"\n",
"$$\\epsilon = \\exp(-\\frac{V_{added}}{V_{total}})$$\n",
"\n",
- "After intially estimating the cylinder number and inserting a small fraction of the estimated number, the true cylinder volume is calculated, the estimate refined, and a larger fraction of cylinderss inserted. This is repeated a number of times according to the `max_iter` argument, yielding an image with a porosity close to the goal.\n",
+ "After intially estimating the cylinder number and inserting a small fraction of the estimated number, the true cylinder volume is calculated, the estimate refined, and a larger fraction of cylinderss inserted. This is repeated a number of times according to the ``maxiter`` argument, yielding an image with a porosity close to the goal.\n",
"\n",
"This first example shows that the output images are similar to the output of `cylinders` when providing the number of cylinders (for an image with the same number of cylinders), and that the goal porosity is reached."
]
"phi_max = 0\n",
"theta_max = 90\n",
"length = None\n",
- "max_iter = 3\n",
+ "maxiter = 3\n",
"target_porosity = 0.8"
]
},
" \"phi_max\": phi_max,\n",
" \"theta_max\": theta_max,\n",
" \"length\": length,\n",
- " \"max_iter\": max_iter \n",
+ " \"maxiter\": maxiter \n",
"}"
]
},
"source": [
"porosity_target = 0.85\n",
"porosity_actual = []\n",
- "max_iters = range(0, 10)\n",
+ "maxiter = range(0, 10)\n",
"\n",
- "for max_iter in max_iters:\n",
- " # Update max_iters in params_generic\n",
- " params_generic.update({\"max_iter\": max_iter})\n",
+ "for m in maxiter:\n",
+ " # Update maxiter in params_generic\n",
+ " params_generic.update({\"maxiter\": m})\n",
" im = ps.generators.cylinders(**params_generic, porosity=porosity_target)\n",
" porosity_actual.append(ps.metrics.porosity(im))"
]
],
"source": [
"fig, ax = plt.subplots(figsize=(5, 4));\n",
- "ax.plot(max_iters, porosity_actual, \"o-\")\n",
+ "ax.plot(maxiter, porosity_actual, \"o-\")\n",
"ax.set_xlabel(\"Number of iterations\")\n",
"ax.set_ylabel(\"Obtained porosity\")\n",
"ax.set_ylim((0.7, 1));"
