From 5fe7161213b5dfa72c20dc3a247e20a10b11899c Mon Sep 17 00:00:00 2001 From: Ankush Aggarwal Date: Mon, 22 Jul 2024 21:08:08 +0100 Subject: [PATCH] Added an example of three-layered tube representing an artery --- Examples/layered-tube.ipynb | 408 ++++++++++++++++++++++++++++++++++++ 1 file changed, 408 insertions(+) create mode 100644 Examples/layered-tube.ipynb diff --git a/Examples/layered-tube.ipynb b/Examples/layered-tube.ipynb new file mode 100644 index 0000000..d54a053 --- /dev/null +++ b/Examples/layered-tube.ipynb @@ -0,0 +1,408 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "b305492c-cd9d-4d70-a5f4-e191e7d5b826", + "metadata": {}, + "outputs": [], + "source": [ + "import pymecht as pmt\n", + "from matplotlib import pyplot as plt\n", + "import numpy as np" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "a0c947a5-bcb8-4daf-aeb5-ecfcab3a37ab", + "metadata": {}, + "outputs": [], + "source": [ + "intima = pmt.MatModel('nh','goh')\n", + "media = pmt.MatModel('nh','goh')\n", + "adventitia = pmt.MatModel('nh','goh')\n", + "\n", + "theta1 = 42.85 #degrees\n", + "theta2 = 35.01 #degrees\n", + "theta3 = 42.78 #degrees\n", + "\n", + "params = intima.parameters\n", + "params['mu_0'].set(22.57)\n", + "params['k1_1'].set(276.45)\n", + "params['k2_1'].set(42.85)\n", + "params['k3_1'].set(0.246)\n", + "intima.parameters = params\n", + "\n", + "params = media.parameters\n", + "params['mu_0'].set(14.30)\n", + "params['k1_1'].set(290.22)\n", + "params['k2_1'].set(4.87)\n", + "params['k3_1'].set(0.224)\n", + "media.parameters = params\n", + "\n", + "params = adventitia.parameters\n", + "params['mu_0'].set(1.61)\n", + "params['k1_1'].set(278.86)\n", + "params['k2_1'].set(87.62)\n", + "params['k3_1'].set(0.275)\n", + "adventitia.parameters = params\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "d1caae25-0520-4caa-a01e-2615b8f9c6b6", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Fiber directions set to 42.85 degrees ( 0.7478735844795702 radians)\n", + "------------------------------------------------------------------\n", + "Keys Value Fixed? Lower bound Upper bound \n", + "------------------------------------------------------------------\n", + "Ri 1.00 No 0.50 1.50 \n", + "thick 0.10 No 0.00 1.00 \n", + "omega 0.00 No 0.00 0.00 \n", + "L0 1.00 No 1.00 1.00 \n", + "lambdaZ 1.00 No 1.00 1.00 \n", + "mu_0 22.57 No 1.00e-04 1.00e+02 \n", + "k1_1 2.76e+02 No 0.10 30.00 \n", + "k2_1 42.85 No 0.10 30.00 \n", + "k3_1 0.25 No 0.00 0.33 \n", + "------------------------------------------------------------------\n", + "\n" + ] + } + ], + "source": [ + "tube1 = pmt.TubeInflation(intima,disp_measure='radius',force_measure='pressure')\n", + "pmt.specify_two_fibers(tube1,angle=theta1,degrees=True)\n", + "params_tube1 = tube1.parameters\n", + "print(params_tube1)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "468152ac-ab7c-4f20-b946-2f6750c7af97", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([5.95889748, 7.7276288 , 7.89064538])" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ri0 = 6\n", + "omega = np.pi/2.\n", + "params_tube1.set('omega',omega)\n", + "params_tube1.set('Ri',ri0*2*np.pi/(2*np.pi-omega))\n", + "params_tube1.set('thick',0.3)\n", + "tube1.force_controlled(0,params_tube1,x0=6)\n", + "tube1.force_controlled(np.array([0,10,15]),params_tube1,x0=6)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "b8aed386-2765-40b9-b9b0-b077507a1842", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "------------------------------------------------------------------\n", + "Keys Value Fixed? Lower bound Upper bound \n", + "------------------------------------------------------------------\n", + "Ri 8.00 No 0.50 1.50 \n", + "thick 0.30 No 0.00 1.00 \n", + "omega 1.57 No 0.00 0.00 \n", + "L0 1.00 No 1.00 1.00 \n", + "lambdaZ 1.00 No 1.00 1.00 \n", + "mu_0 22.57 No 1.00e-04 1.00e+02 \n", + "k1_1 2.76e+02 No 0.10 30.00 \n", + "k2_1 42.85 No 0.10 30.00 \n", + "k3_1 0.25 No 0.00 0.33 \n", + "------------------------------------------------------------------" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tube1.parameters" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "dba67e9d-d731-49c5-a30a-32e2b51655d2", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Fiber directions set to 35.01 degrees ( 0.6110397711232147 radians)\n" + ] + }, + { + "data": { + "text/plain": [ + "------------------------------------------------------------------\n", + "Keys Value Fixed? Lower bound Upper bound \n", + "------------------------------------------------------------------\n", + "Ri 8.00 No 0.50 1.50 \n", + "thick 0.54 No 0.00 1.00 \n", + "omega 1.57 No 0.00 0.00 \n", + "L0 1.00 No 1.00 1.00 \n", + "lambdaZ 1.00 No 1.00 1.00 \n", + "mu_0 14.30 No 1.00e-04 1.00e+02 \n", + "k1_1 2.90e+02 No 0.10 30.00 \n", + "k2_1 4.87 No 0.10 30.00 \n", + "k3_1 0.22 No 0.00 0.33 \n", + "------------------------------------------------------------------" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tube2 = pmt.TubeInflation(media,disp_measure='radius',force_measure='pressure')\n", + "pmt.specify_two_fibers(tube2,angle=theta2,degrees=True)\n", + "params_tube2 = tube2.parameters\n", + "ri0 = 6\n", + "omega = np.pi/2.\n", + "params_tube2.set('omega',omega)\n", + "params_tube2.set('Ri',ri0*2*np.pi/(2*np.pi-omega))\n", + "params_tube2.set('thick',0.54)\n", + "tube2.parameters" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "2fa313cc-8911-4fc4-a033-108dca63d561", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[array([5.95729122]), array([7.52927162]), array([7.6840413])]" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tube2.force_controlled([0,10,15],params_tube1,x0=6)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "1baec665-03c1-4ae2-a8b8-ed29d942aac2", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Fiber directions set to 42.78 degrees ( 0.7466518540031742 radians)\n" + ] + }, + { + "data": { + "text/plain": [ + "------------------------------------------------------------------\n", + "Keys Value Fixed? Lower bound Upper bound \n", + "------------------------------------------------------------------\n", + "Ri 8.00 No 0.50 1.50 \n", + "thick 0.16 No 0.00 1.00 \n", + "omega 1.57 No 0.00 0.00 \n", + "L0 1.00 No 1.00 1.00 \n", + "lambdaZ 1.00 No 1.00 1.00 \n", + "mu_0 1.61 No 1.00e-04 1.00e+02 \n", + "k1_1 2.79e+02 No 0.10 30.00 \n", + "k2_1 87.62 No 0.10 30.00 \n", + "k3_1 0.28 No 0.00 0.33 \n", + "------------------------------------------------------------------" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tube3 = pmt.TubeInflation(adventitia,disp_measure='radius',force_measure='pressure')\n", + "pmt.specify_two_fibers(tube3,angle=theta3,degrees=True)\n", + "params_tube3 = tube3.parameters\n", + "ri0 = 6\n", + "omega = np.pi/2.\n", + "params_tube3.set('omega',omega)\n", + "params_tube3.set('Ri',ri0*2*np.pi/(2*np.pi-omega))\n", + "params_tube3.set('thick',0.16)\n", + "tube3.parameters" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "1983320f-37d9-4f1c-9584-9d0a25bef2e2", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "------------------------------------------------------------------\n", + "Keys Value Fixed? Lower bound Upper bound \n", + "------------------------------------------------------------------\n", + "Ri_layer0 8.00 No 0.50 1.50 \n", + "thick_layer0 0.30 No 0.00 1.00 \n", + "omega_layer0 1.57 No 0.00 0.00 \n", + "L0_layer0 1.00 No 1.00 1.00 \n", + "lambdaZ_layer0 1.00 No 1.00 1.00 \n", + "mu_0_layer0 22.57 No 1.00e-04 1.00e+02 \n", + "k1_1_layer0 2.76e+02 No 0.10 30.00 \n", + "k2_1_layer0 42.85 No 0.10 30.00 \n", + "k3_1_layer0 0.25 No 0.00 0.33 \n", + "Ri_layer1 8.00 No 0.50 1.50 \n", + "thick_layer1 0.54 No 0.00 1.00 \n", + "omega_layer1 1.57 No 0.00 0.00 \n", + "L0_layer1 1.00 No 1.00 1.00 \n", + "lambdaZ_layer1 1.00 No 1.00 1.00 \n", + "mu_0_layer1 14.30 No 1.00e-04 1.00e+02 \n", + "k1_1_layer1 2.90e+02 No 0.10 30.00 \n", + "k2_1_layer1 4.87 No 0.10 30.00 \n", + "k3_1_layer1 0.22 No 0.00 0.33 \n", + "Ri_layer2 8.00 No 0.50 1.50 \n", + "thick_layer2 0.16 No 0.00 1.00 \n", + "omega_layer2 1.57 No 0.00 0.00 \n", + "L0_layer2 1.00 No 1.00 1.00 \n", + "lambdaZ_layer2 1.00 No 1.00 1.00 \n", + "mu_0_layer2 1.61 No 1.00e-04 1.00e+02 \n", + "k1_1_layer2 2.79e+02 No 0.10 30.00 \n", + "k2_1_layer2 87.62 No 0.10 30.00 \n", + "k3_1_layer2 0.28 No 0.00 0.33 \n", + "------------------------------------------------------------------" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "artery = pmt.LayeredTube(tube1,tube2,tube3)\n", + "artery.parameters" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "0d57a71a-5781-4634-8622-5c5fde049e4e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([5.6583947 , 6.75954302, 6.97341844])" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "artery.force_controlled(np.array([0,10,15]),x0=6)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "e0948b0f-aa34-4fb7-848a-608909a9555c", + "metadata": {}, + "outputs": [], + "source": [ + "xi,stress = artery.cauchy_stress(6.97341844)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "6a75c9c0-82bd-4c06-ba80-dd8d36f93cee", + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAANYAAACfCAYAAACFtCeKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8g+/7EAAAACXBIWXMAAAsTAAALEwEAmpwYAAAYTElEQVR4nO2de5xV1XXHvz9gRFB0QIjFARw0BsRqGJ1EoybRxoqSGifa+mhSNdEam4cxUXzUNkEbK4nVWJPUxCRWTeMDHzUopoiCj2rRgCD4AEXQ6pgoIcFHReSx+sfeV85c7uPcO/fM3Dus7+dzP+ec/Trrnpl19+OstbbMDMdxaku/3hbAcfoirliOkwGuWI6TAa5YjpMBrliOkwGuWI6TAQN6W4DuMHz4cGttbe1tMZythAULFvzezEakKdvQitXa2sr8+fN7WwxnK0HSS2nLNrRiOVsfdy7s5LJZy3h1zVp2aR7ElEnj6Ghr6W2xtiD1HEvSUEl7SdpNks/NnB7nzoWdXHDHEjrXrMWAzjVrOeuWRbRdfC93LuzsbfG6ULLHkrQj8BXgRGAbYBWwLbCzpHnAv5nZ3MyldBzgslnLWLt+4xbpf3xnPRfcsQSgbnqvcj3PbcDLwMfNbJyZHWxm7WY2GpgGHC3p1MyldBzg1TVri+atXb+Rs25ZxEHT5tRF76VGNsJtb283X7zYejho2hw6SyhXkqGDm/j2UXvVtAeTtMDM2tOUrXSO9VFJn8h9qhfRcSpnyqRxDByQ7l82Nzzsrd4rlZSSTgMeAmYBF8Xj1OzEcpwt6WhrYcqkcanL9+bwMG2P9XXgI8BLZnYo0AasyUooxynGn0/YGYD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6b8GDgGelLSQsCf2v6aRtadw63bHyQDvsRwnA1yxHCcDXLEcJwNcsRwnA1yxHCcDXLEcJwNcsRwnA1yxHCcD/h/wE+M0G5CxsQAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "def von_mises(sigma_list):\n", + " return [np.sqrt(3./2.)*np.linalg.norm(sigma-np.trace(sigma)/3.*np.eye(3)) for sigma in sigma_list]\n", + "\n", + "fig,ax = plt.subplots(1,1,figsize=(4*0.7,3*0.7))\n", + "\n", + "ax.plot(xi,von_mises(stress),'-o')\n", + "ax.set_xlabel('Normalized thickness')\n", + "ax.set_ylabel('von-Mises stress (kPa)')\n", + "plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bf6e4c6b-9039-41ab-81e6-96e08924153f", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.16" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}