diff --git a/bmcs_course/1_1_elastic_stiffness_of_the_composite.ipynb b/bmcs_course/1_1_elastic_stiffness_of_the_composite.ipynb index ba65a6e2b1b17f4ad3449c2799c042d9dce4cb31..03df2eac64db8ab5274b00b9d7788757f4a96199 100644 --- a/bmcs_course/1_1_elastic_stiffness_of_the_composite.ipynb +++ b/bmcs_course/1_1_elastic_stiffness_of_the_composite.ipynb @@ -12,8 +12,10 @@ "# Example: Calculate elastic stiffness of a given composite\n", "\n", "## Task\n", - "What is the initial stiffness of a reinforced concrete cross section shown in the Figure with the thickness of 10~mm and width of 100 mm.\n", - "The cross-section is reinforced with 6 layers of textile fabrics made of CAR-EP3300 specified in the table below " + "Predict the tensile stiffness of a reinforced concrete cross section shown in the Figure with the thickness of 10~mm and width of 100 mm.\n", + "The cross-section is reinforced with 6 layers of textile fabrics made of CAR-EP3300 specified in the table below\n", + "\n", + "" ] }, { @@ -81,9 +83,23 @@ "\\end{array}" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# How to evaluate an expression?" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Calculator:** Let us use Python language as a calculator and evalute the mixture rule for the exemplified cross-section.m" + ] + }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -98,19 +114,134 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "37082.18859138533" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "A_composite = width * thickness\n", "n_rovings = width / spacing\n", "A_layer = n_rovings * A_roving\n", "A_carbon = n_layers * A_layer \n", "A_concrete = A_composite - A_carbon \n", - "E_composite = (E_carbon * A_carbon + E_concrete +A_concrete) / A_composite\n", + "E_composite = (E_carbon * A_carbon + E_concrete * A_concrete) / A_composite\n", "E_composite" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Thus, the composite has an effective stiffness of 37 GPa." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# How to construct a model?" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To explore the multitude of compbinations let us provide a model which can be interactively used to study the available design options" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In contrast to the previously performed numerical evaluation, we now express the derived equations as mathematical symbols. To do this, let us use a Python package `sympy` to do symbolic algebra." + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "import sympy as sp" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The parameters of the model are now introduced as `sympy.symbols`." + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [], + "source": [ + "A_roving = sp.Symbol('A_r')\n", + "n_layers = sp.Symbol('n_l')\n", + "spacing = sp.Symbol('d')\n", + "thickness = sp.Symbol('h')\n", + "width = sp.Symbol('b')\n", + "E_carbon = sp.Symbol('E_car')\n", + "E_concrete = sp.Symbol('E_c')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The above derived equations can be rephrased in the form" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": {}, + "outputs": [ + { + "data": { + "text/latex": [ + "$\\displaystyle \\frac{A_{r} E_{car} n_{l} - E_{c} \\left(A_{r} n_{l} - d h\\right)}{d h}$" + ], + "text/plain": [ + "(A_r*E_car*n_l - E_c*(A_r*n_l - d*h))/(d*h)" + ] + }, + "execution_count": 53, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "A_composite = width * thickness\n", + "n_rovings = width / spacing\n", + "A_layer = n_rovings * A_roving\n", + "A_carbon = n_layers * A_layer \n", + "A_concrete = A_composite - A_carbon \n", + "E_composite = (E_carbon * A_carbon + E_concrete * A_concrete) / A_composite\n", + "sp.simplify(E_composite)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**The first model:**\n", + "Instead of a number, we have now a symbolic expression showing the influence of the individual parameters on a design characteristic, i.e. on the material stiffness. This expression is a model that was constructuted using the conditions of compatibility, equilibrium and constitutive laws.\n", + "Using this model, we can explore the behavior of the composite." + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -122,26 +253,23 @@ "cell_type": "markdown", "metadata": {}, "source": [ - " - Install anaconda environment\n", - " - Download this notebook from the moodle folder Jupyter notebooks\n", - " - Start jupyter\n", - " - Open the notebook\n", - " - Learn the basics of how to interact with Jupyter notebook" + " - Login to jupyter.rwth-aachen.de\n", + " - Navigate to this mixture rule example\n", + " - Evaluate the cells by issueing the [Shift+Return] key combination" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Further readings\n", - " - To get more support in installing the environment you can check this page\n", - " [Quick Start Guide](https://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/index.html)\n", - " - To solve our problems we will use packages that are included in the Python bundle of containing \n", - " packages that efficiently support scientific-computing tasks. To motivate you to dig in deeper in\n", - " Python check this race of programming languages over the last 50 years and wait till the end of it ;-) [Most Popular Programming Languages 1965 - 2019](https://www.youtube.com/watch?v=Og847HVwRSI)\n", - " - Basic features of Jupyter, Python, and of the packages that we will use \n", - " for plotting, linear algebra, algebraic manipulations, and data array manipulations will be shortly\n", - " explained. the that we will use to support our model development will be addressed in a separate notebook." + "# Why Jupyter Lab? Why Python?\n", + " - [Jupyterlab introduction](https://youtu.be/A5YyoCKxEOU) [7 mins] video explaining the basic features of jupyter notebook within jupyter lab \n", + " - Check this race of programming languages over the last 50 years and wait till the end of it ;-) [Most Popular Programming Languages 1965 - 2019](https://www.youtube.com/watch?v=Og847HVwRSI)\n", + " - Useful packages\n", + " - `matplotlib` - plotting \n", + " - `sympy` - algebraic manipulations\n", + " - `numpy` - data array manipulations\n", + " will be shortly explained." ] }, { @@ -168,7 +296,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.2" + "version": "3.9.1" }, "toc": { "base_numbering": 1,