Kernel: Python 2 (system-wide)
Plot the ratio of the principal normal and shear stresses to the maximum contact area pressure as a function of the depth below the surface along the z axis for two spheres.
In [1]:
In [2]:
'1.5.1'
In [3]:
/usr/local/lib/python2.7/dist-packages/IPython/html.py:14: ShimWarning: The `IPython.html` package has been deprecated since IPython 4.0. You should import from `notebook` instead. `IPython.html.widgets` has moved to `ipywidgets`.
"`IPython.html.widgets` has moved to `ipywidgets`.", ShimWarning)
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-3-6fd8c8693dff> in <module>()
----> 1 from IPython.html.widgets import interactive
2 from IPython.display import display
ImportError: cannot import name interactive
In [4]:
In [5]:
In [6]:
First define all of the known and unknown symbols needed for the calculations for sphere to sphere contact.
In [7]:
Now define the equations for the contact area radius, , the maximum pressure at the contact area, , and the principal stresses along the axis.
In [8]:
In [9]:
In [10]:
In [11]:
In [12]:
In [13]:
In [14]:
Create some functions to evaluate the expressions that we derived above.
In [15]:
In [16]:
In [17]:
In [18]:
In [19]:
We need a graph of vs so define a function that produces the plot.
In [20]:
In [21]:
<IPython.core.display.Javascript object>
In [22]:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-22-69837174437d> in <module>()
----> 1 w = interactive(plot_stresses, v1=(0.2, 0.5), v2=(0.2, 0.5), E1=(0.0, 50.0E6),
2 E2=(0.0, 50.0E6), d1=(-10.0, 10.0), d2=(-10.0, 10.0))
NameError: name 'interactive' is not defined
In [23]:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-23-f4b9e4afebae> in <module>()
----> 1 display(w)
NameError: name 'w' is not defined
In [0]: