summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Engineering_Mechanics_of_Solids_by_Popov_E_P/Chapter1_4.ipynb429
-rw-r--r--Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter10_4.ipynb795
-rw-r--r--Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter11_4.ipynb385
-rw-r--r--Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter12_4.ipynb411
-rw-r--r--Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter13_3.ipynb226
-rw-r--r--Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter2_4.ipynb334
-rw-r--r--Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter4_4.ipynb448
-rw-r--r--Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter5_4.ipynb883
-rw-r--r--Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter6_4.ipynb579
-rw-r--r--Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter7_4.ipynb275
-rw-r--r--Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter8_4.ipynb363
-rw-r--r--Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter9_4.ipynb256
-rw-r--r--Engineering_Mechanics_of_Solids_by_Popov_E_P/charpter_3_5.ipynb300
-rw-r--r--Engineering_Mechanics_of_Solids_by_Popov_E_P/screenshots/1_2.PNGbin0 -> 55244 bytes
-rw-r--r--Engineering_Mechanics_of_Solids_by_Popov_E_P/screenshots/2_2.PNGbin0 -> 43946 bytes
-rw-r--r--Engineering_Mechanics_of_Solids_by_Popov_E_P/screenshots/3_2.PNGbin0 -> 55584 bytes
-rw-r--r--Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/Chapter9_9.ipynb421
-rw-r--r--Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter1_9.ipynb629
-rw-r--r--Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter2_(1).ipynb2188
-rw-r--r--Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter3_(1).ipynb1130
-rw-r--r--Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter4_9.ipynb880
-rw-r--r--Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter6_9.ipynb1072
-rw-r--r--Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter7_9.ipynb714
-rw-r--r--Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter8_9.ipynb1093
-rw-r--r--Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter_5_9.ipynb359
-rw-r--r--Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/screenshots/ex1.2_4.pngbin0 -> 18718 bytes
-rw-r--r--Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/screenshots/ex3.7_1.pngbin0 -> 17630 bytes
-rw-r--r--Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/screenshots/ex6.5_1.pngbin0 -> 32808 bytes
28 files changed, 14170 insertions, 0 deletions
diff --git a/Engineering_Mechanics_of_Solids_by_Popov_E_P/Chapter1_4.ipynb b/Engineering_Mechanics_of_Solids_by_Popov_E_P/Chapter1_4.ipynb
new file mode 100644
index 00000000..a4e9bc81
--- /dev/null
+++ b/Engineering_Mechanics_of_Solids_by_Popov_E_P/Chapter1_4.ipynb
@@ -0,0 +1,429 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1 : Stress, Axial loads and Safety concepts"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.1 page number 24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The bearing stress at C is 0.875 MPA\n",
+ "The maximum normal stress in BD bolt is: 62.0 MPA\n",
+ "The tensile strss at shank of the bolt is: 40.0 MPA\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "import math\n",
+ "d_bolt = 20.0 #mm,diameter,This is not the minimum area\n",
+ "d_bolt_min = 16.0 #mm This is at the roots of the thread \n",
+ "#This yealds maximum stress \n",
+ "A_crossection = (math.pi)*(d_bolt**2)/4 #mm*2\n",
+ "A_crossection_min = (math.pi)*(d_bolt_min**2)/4 #mm*2 ,This is minimum area which yeilds maximum stress\n",
+ "load = 10.0 #KN\n",
+ "BC = 1.0 #m\n",
+ "CF = 2.5 #m\n",
+ "contact_area = 200*200 # mm*2 , The contact area at c\n",
+ "\n",
+ "#caliculations \n",
+ "#Balancing forces in the x direction:\n",
+ "# Balncing the moments about C and B:\n",
+ "Fx = 0 \n",
+ "R_cy = load*(BC+CF) #KN , Reaction at C in y-direction\n",
+ "R_by = load*(CF) #KN , Reaction at B in y-direction\n",
+ "#Because of 2 bolts\n",
+ "stress_max = (R_by/(2*A_crossection_min))*(10**3) # MPA,maximum stess records at minimum area\n",
+ "stress_shank = (R_by/(2*A_crossection))*(10**3) # MPA\n",
+ "Bearing_stress_c = (R_cy/contact_area)*(10**3) #MPA, Bearing stress at C\n",
+ "\n",
+ "print\"The bearing stress at C is \",(Bearing_stress_c) ,\"MPA\"\n",
+ "print\"The maximum normal stress in BD bolt is: \",round(stress_max),\"MPA\"\n",
+ "print\"The tensile strss at shank of the bolt is: \",round(stress_shank),\"MPA\"\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.2 page number 26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The total weight of pier is 25.0 KN\n",
+ "The stress at 1 m above is 28.75 MPA\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "load_distributed = 20 #KN/m*2, This is the load distributed over the pier\n",
+ "H = 2 # m, Total height \n",
+ "h = 1 #m , point of investigation \n",
+ "base = 1.5 #m The length of crossection in side veiw \n",
+ "top = 0.5 #m ,The length where load is distributed on top\n",
+ "base_inv = 1 #m , the length at the point of investigation \n",
+ "area = 0.5*1 #m ,The length at a-a crossection \n",
+ "density_conc = 25 #KN/m*2\n",
+ "#caliculation of total weight \n",
+ "\n",
+ "v_total = ((top+base)/2)*top*H #m*2 ,The total volume \n",
+ "w_total = v_total* density_conc #KN , The total weight\n",
+ "R_top = (top**2)*load_distributed #KN , THe reaction force due to load distribution \n",
+ "reaction_net = w_total + R_top\n",
+ "\n",
+ "#caliculation of State of stress at 1m \n",
+ "v_inv = ((top+base_inv)/2)*top*h #m*2 ,The total volume from 1m to top\n",
+ "w_inv = v_inv*density_conc #KN , The total weight from 1m to top\n",
+ "reaction_net = w_inv + R_top #KN\n",
+ "Stress = reaction_net/area #KN/m*2\n",
+ "print\"The total weight of pier is\",w_total,\"KN\"\n",
+ "print\"The stress at 1 m above is\",Stress,\"MPA\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.3 page number 27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Tensile stress in main bar AB: 17.89 Ksi\n",
+ "Tensile stress in clevis of main bar AB: 11.18 Ksi\n",
+ "Comprensive stress in main bar BC: 12.93 Ksi\n",
+ "Bearing stress in pin at C: 18.86 Ksi\n",
+ "torsion stress in pin at C: -25.62 Ksi\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "from math import pow\n",
+ "d_pins = 0.375 #inch\n",
+ "load = 3 #Kips\n",
+ "AB_x = 6 #inch,X-component\n",
+ "AB_y = 3 #inch,Y-component \n",
+ "BC_y = 6 #inch,Y-component\n",
+ "BC_x = 6 #inch,X-component\n",
+ "area_AB = 0.25*0.5 #inch*2 \n",
+ "area_net = 0.20*2*(0.875-0.375) #inch*2 \n",
+ "area_BC = 0.875*0.25 #inch*2 \n",
+ "area_pin = d_pins*2*0.20 #inch*2 \n",
+ "area_pin_crossection = 3.14*((d_pins/2)**2)\n",
+ "#caliculations\n",
+ "\n",
+ "slope = AB_y/ AB_x #For AB\n",
+ "slope = BC_y/ BC_x #For BC\n",
+ "\n",
+ "#momentum at point C:\n",
+ "F_A_x = (load*AB_x )/(BC_y + AB_y ) #Kips, F_A_x X-component of F_A\n",
+ "\n",
+ "#momentum at point A:\n",
+ "F_C_x = -(load*BC_x)/(BC_y + AB_y ) #Kips, F_C_x X-component of F_c\n",
+ "\n",
+ "#X,Y components of F_A\n",
+ "F_A= (pow(5,0.5)/2)*F_A_x #Kips\n",
+ "F_A_y = 0.5*F_A_x #Kips\n",
+ "\n",
+ "#X,Y components of F_C \n",
+ "F_C= pow(2,0.5)*F_C_x #Kips\n",
+ "F_C_y = F_C_x #Kips\n",
+ "\n",
+ "T_stress_AB = F_A/area_AB #Ksi , Tensile stress in main bar AB\n",
+ "stress_clevis = F_A/area_net #Ksi ,Tensile stress in clevis of main bar AB\n",
+ "c_strees_BC = F_C/area_BC #Ksi , Comprensive stress in main bar BC\n",
+ "B_stress_pin = F_C/area_pin #Ksi , Bearing stress in pin at C\n",
+ "To_stress_pin = F_C/area_pin_crossection #Ksi , torsion stress in pin at C\n",
+ "\n",
+ "print\"Tensile stress in main bar AB:\",round(T_stress_AB,2),\"Ksi\"\n",
+ "print\"Tensile stress in clevis of main bar AB:\",round(stress_clevis,2),\"Ksi\"\n",
+ "print\"Comprensive stress in main bar BC:\",round(-c_strees_BC,2),\"Ksi\"\n",
+ "print\"Bearing stress in pin at C:\",round(-B_stress_pin,2),\"Ksi\"\n",
+ "print\"torsion stress in pin at C:\",round(To_stress_pin,2),\"Ksi\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.4 page number 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The factor 2.5 is less than assumed factor 2.7 so this can be considered\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "strength_steel = 120 #Ksi\n",
+ "factor = 2.5\n",
+ "F_C = 2.23 #Ksi\n",
+ "\n",
+ "#caliculations\n",
+ "\n",
+ "stress_allow = strength_steel/factor #Ksi\n",
+ "A_net = F_C/strength_steel #in*2 , \n",
+ "#lets adopt 0.20x0.25 in*2 and check wether we are correct or not? \n",
+ "\n",
+ "A_net_assumption = 0.25*0.20 #in*2 , this is assumed area which is near to A_net\n",
+ "stress = 2.23/A_net_assumption #Ksi\n",
+ "factor_assumed = strength_steel/stress \n",
+ "\n",
+ "if factor_assumed > factor :\n",
+ " print \"The factor\",factor,\"is less than assumed factor\",round(factor_assumed,1),\"so this can be considered\"\n",
+ "else:\n",
+ " print \"The assumed factor\",factor, \"is more than assumed factor\",factor_assumed,\"factor_assumed\"\n",
+ " \n",
+ " \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.6 page number 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The required size of rod is: 49.35 m*2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "mass = 5 #Kg\n",
+ "frequency = 10 #Hz\n",
+ "stress_allow = 200 #MPa\n",
+ "R = 0.5 #m\n",
+ "\n",
+ "#caliculations \n",
+ "from math import pi\n",
+ "w = 2*pi*frequency #rad/sec\n",
+ "a = (w**2)*R #m*2/sec\n",
+ "F = mass*a #N\n",
+ "A_req = F/stress_allow #m*2 , The required area for aloowing stress\n",
+ "print\"The required size of rod is:\",round(A_req,2),\"m*2\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.7 page number 45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the allowable area for live load 1.0 is 0.273 in*2\n",
+ "the allowable area for live load 15 is 0.909 in*2\n",
+ "the crossection area for live load 1.0 is 0.235 in*2\n",
+ "the crossection area for live load 15 is 0.926 in*2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "D_n = 5.0 #kips, dead load\n",
+ "L_n_1 = 1.0 #kips ,live load 1\n",
+ "L_n_2 = 15 #kips ,live load 2\n",
+ "stress_allow = 22 #ksi\n",
+ "phi = 0.9 #probalistic coefficients\n",
+ "y_stress = 36 #ksi,Yeild strength\n",
+ "#According to AISR \n",
+ "\n",
+ "#a\n",
+ "p_1 = D_n + L_n_1 #kips since the total load is sum of dead load and live load\n",
+ "p_2 = D_n + L_n_2 #kips, For second live load\n",
+ "\n",
+ "Area_1 = p_1/stress_allow #in*2 ,the allowable area for the allowed stress\n",
+ "Area_2 = p_2/stress_allow #in*2\n",
+ "print \"the allowable area for live load\",L_n_1,\"is\",round(Area_1,3),\"in*2\"\n",
+ "print \"the allowable area for live load\",L_n_2,\"is\",round(Area_2,3),\"in*2\"\n",
+ "\n",
+ "#b\n",
+ "#area_crossection= (1.2*D_n +1.6L_n)/(phi*y_stress)\n",
+ "\n",
+ "area_crossection_1= (1.2*D_n +1.6*L_n_1)/(phi*y_stress) #in*2,crossection area for first live load\n",
+ "area_crossection_2= (1.2*D_n +1.6*L_n_2)/(phi*y_stress) #in*2,crossection area for second live load\n",
+ "print \"the crossection area for live load\",L_n_1,\"is\",round(area_crossection_1,3),\"in*2\"\n",
+ "print \"the crossection area for live load\",L_n_2,\"is\",round(area_crossection_2,3),\"in*2\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.8 page number 51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Length of the Weld 1: 2.54 in\n",
+ "Length of the Weld 2: 4.65 in\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "A_angle = 2 #in*2 \n",
+ "stress_allow = 20 #ksi, The maximum alowable stress\n",
+ "F = stress_allow*A_angle #K, The maximum force\n",
+ "AD = 3 #in, from the figure\n",
+ "DC = 1.06 #in, from the figure\n",
+ "strength_AWS = 5.56 # kips/in,Allowable strength according to AWS\n",
+ "\n",
+ "#caliculations \n",
+ "#momentum at point \"d\" is equal to 0\n",
+ "R_1 = (F*DC)/AD #k,Resultant force developed by the weld\n",
+ "R_2 = (F*(AD-DC))/AD #k,Resultant force developed by the weld\n",
+ "\n",
+ "l_1 = R_1/strength_AWS #in,Length of the Weld 1\n",
+ "l_2 = R_2/strength_AWS #in,Length of the Weld 2\n",
+ " \n",
+ "print \"Length of the Weld 1:\",round(l_1,2),\"in\"\n",
+ "print \"Length of the Weld 2:\",round(l_2,2),\"in\" \n",
+ " \n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter10_4.ipynb b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter10_4.ipynb
new file mode 100644
index 00000000..e3ff3ff9
--- /dev/null
+++ b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter10_4.ipynb
@@ -0,0 +1,795 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 10:Deflections of beams "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.1 page number 501"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum bending stress developed in the saw 300.0 Mpa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "dia = 400 #mm - The diameter of a pulley\n",
+ "E = 200 #Gpa - Youngs modulus\n",
+ "t = 0.6 #mm - The thickness of band\n",
+ "c = t/2 #mm - The maximum stress is seen \n",
+ "#Caliculations\n",
+ "\n",
+ "stress_max = E*c*(10**3)/(dia/2) #Mpa - The maximum stress on the crossection occurs at the ends\n",
+ "print \"The maximum bending stress developed in the saw \",stress_max,\"Mpa\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.3 page number 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a) The maximum displacement in y direction is -0.0130208333333 W(l**4)/EI \n",
+ "a) The maximum deflection occured at 0.5 L\n"
+ ]
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAEACAYAAABYq7oeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XucTfX+x/HXZ8g1l5LEiORSUkiRTmgSGkWU04lc0o2S\n6lzquPxMBoU61XHrHCqZTKI7k1IumeRILsctkUtzlJlQiEwuY+b7+2M2TTODuezZa8/e7+fjMY/H\nrL2/a+23ZWZ95ru+a32XOecQERHJKsLrACIiEnxUHEREJAcVBxERyUHFQUREclBxEBGRHFQcREQk\nB78UBzOLNrPNZrbFzAbl8v4lZrbMzI6Y2V9zeT/CzP5rZgn+yCMiIoVT6OJgZhHAJOAmoBHQw8wu\nzdZsL/AI8I9TbOYx4OvCZhEREf/wR8+hBbDVObfDOZcGzAK6ZG3gnPvJObcaOJ59ZTOrCdwMvOKH\nLCIi4gf+KA6RwPdZlnf6XsurfwJPALpVW0QkSHg6IG1mtwC7nXNrAfN9iYiIx0r6YRvJQK0syzV9\nr+XFdcCtZnYzUBaoYGbTnXN9sjc0M/UsREQKwDmX7z+8/dFzWAnUM7PaZlYK6A6c7qqjkyGdc0Od\nc7Wccxf71vs0t8KQpb2+nGP48OGeZwiWL+0L7Qvti9N/FVShew7OuXQzGwjMJ7PYTHXObTKz/plv\nu5fMrBqwCqgAZJjZY8BlzrlDhf18ERHxP3+cVsI59zFwSbbXpmT5fjdw4Rm28RnwmT/yiIhI4egO\n6WIoKirK6whBQ/viN9oXv9G+KDwrzDmpQDIzV1yyiogECzPDeTQgLSIiIUbFQUREclBxEBGRHFQc\nREQkBxUHERHJQcVBRERyUHEQEZEcVBxERCQHFQcREclBxUFERHJQcRARkRxUHEREJAe/TNktEo6S\nknYQExNHcnIGkZERjBrVlzp1ansdS8QvNCurSAEkJe2gffuJ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5f0OnsR7Y9WQFNg/Snez/dxM9h6Dqe8\nYS6LLsB0AOfcl0AlM6tG6DnjvnDOLXfOHfAtLif3+0eKu7z8TAA8ArwD7AlkuADLy764C3jXOZcM\n4Jz7KcAZAyUv+2IXUMH3fQVgr3PueAAzBoxzbimw/zRN8n3cDLbikJcb5rK3Sc6lTSjI682DJ9xP\naN5EeMb9YGY1gK7OuX+TeR9OqMrLz0QD4FwzW2xmK82sd8DSBVZe9sXLQCMzSwHWAY8FKFswyvdx\ns7CXskoQMLMbgHvI7FqGo3FA1nPOoVwgzqQk0AxoC5QHvjCzL5xz27yN5YkhwDrn3A1mVhdYYGaN\nnXOHvA5WHARbcUgGamVZrul7LXubC8/QJhTkZV9gZo2Bl4Bo59zpupXFVV72w9XALDMzMs8tdzSz\nNOdcQoAyBkpe9sVO4Cfn3BHgiJktAZqQeX4+lORlX1wHPA3gnNtuZknApcCqgCQMLvk+bgbbaaWT\nN8yZWSkyb5jL/gueAPSBk3df/+x88zuFmDPuCzOrBbwL9HbObfcgYyCccT845y72fdUhc9xhQAgW\nBsjb78ccoJWZlTCzcmQOPm4KcM5AyMu+2AS0A/CdX28AfBvQlIFlnLrXnO/jZlD1HJxz6WY2kMyp\nvE/cMLfJzPpnvu1ecs59ZGY3m9k2IJXM0ykhJy/7AogBzgX+5furOc0518K71P6Xx/3wu1UCHjJA\n8vj7sdnMPgHWA+nAS865rz2MXSTy+HMxBphmZuvIPGj+3Tm3z7vURcfM3gCigCpm9h2ZV2qVohDH\nTd0EJyIiOQTbaSUREQkCKg4iIpKDioOIiOSg4iAiIjmoOIiISA4qDiIikoOKg4iI5KDiICIiOfw/\n/vJBW0Moy/YAAAAASUVORK5CYII=\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0xc31ce48>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "b) The above graph is bending moment graph\n"
+ ]
+ },
+ {
+ "data": {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ErkJggg==\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0xbfd30f0>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "b)The above graph is beam displacement graph\n",
+ "b)The maximum occures in the middle from the above graph \n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "import numpy\n",
+ "l_ab = 1.0 #L in - The length of the beam\n",
+ "F_D = 1.0 #W lb/in - The force distribution \n",
+ "F = F_D*l_ab #WL - The force applied\n",
+ "#Beause of symmetry the moment caliculations can be neglected\n",
+ "#F_Y = 0\n",
+ "R_A = F/2 #wl - The reactive force at A\n",
+ "R_B = F/2 #wl - The reactive force at B\n",
+ "#EI - The flxure rigidity is constant and 1/EI =1 # k\n",
+ "\n",
+ "#part - A\n",
+ "#section 1--1\n",
+ "l_1 = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] #L taking each section at 0.1L distance \n",
+ "M_1 = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "v = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "for i in range(10):\n",
+ " v[i] = R_A - F_D*l_1[i] \n",
+ " M_1[i] = R_A*l_1[i] - F_D*(l_1[i]**2)/2\n",
+ "# (EI)y'' = M_1[i] we will integrate M_1[i] twice where variable is l_1[i]\n",
+ "#(EI)y'- \n",
+ "\n",
+ "M_1_intg1 = R_A*(l_1[i]**2)/4 - F_D*(l_1[i]**3)/6 - F_D*(l_ab**3)*l_1[i]/24 #integration of x**n = x**n+1/n+1\n",
+ "#(EI)y- Using end conditions for caliculating constants \n",
+ "\n",
+ "M_1_intg2 = R_A*(l_1[i]**3)/12.0 - F_D*(l_1[i]**4)/24.0 + F_D*(l_ab**3)*l_1[i]/24.0 \n",
+ "#Equations \n",
+ "\n",
+ "l_1 = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] #L taking each section at 0.1L distance \n",
+ "M_1_intg2 = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "Y = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "for i in range(10):\n",
+ " M_1_intg2[i] = (l_1[i]**3)/12.0 - (l_1[i]**4)/24.0 - l_1[i]/24.0 # discluding every term for ruling out float values\n",
+ " Y[i] = M_1_intg2[i] #W(l**4)/EI k = 1/EI\n",
+ "#The precision is very less while caliculating through this equation because the least count in X direction is 0.1\n",
+ "print \"a) The maximum displacement in y direction is\",min(Y),\"W(l**4)/EI \"\n",
+ "print \"a) The maximum deflection occured at\",l_1[Y.index(min(Y))],\"L\"\n",
+ "\n",
+ "#Part - B\n",
+ "#Graphs\n",
+ "import numpy as np\n",
+ "values = M_1\n",
+ "y = np.array(values)\n",
+ "t = np.linspace(0,1,11)\n",
+ "poly_coeff = np.polyfit(t, y, 2)\n",
+ "import matplotlib.pyplot as plt\n",
+ "%matplotlib inline\n",
+ "plt.plot(t, y, 'o')\n",
+ "plt.plot(t, np.poly1d(poly_coeff)(t), '-')\n",
+ "plt.show()\n",
+ "print \"b) The above graph is bending moment graph\"\n",
+ "values = Y \n",
+ "y = np.array(values)\n",
+ "t = np.linspace(0,1,11)\n",
+ "poly_coeff = np.polyfit(t, y, 2)\n",
+ "import matplotlib.pyplot as plt\n",
+ "plt.plot(t, y, 'o')\n",
+ "plt.plot(t, np.poly1d(poly_coeff)(t), '-')\n",
+ "plt.show()\n",
+ "print \"b)The above graph is beam displacement graph\"\n",
+ "print \"b)The maximum occures in the middle from the above graph \"\n",
+ "\n",
+ "\n",
+ " \n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.5 page number 517"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The reaction at A is 0.375 WL\n",
+ "The reaction at B is 0.625 WL\n",
+ "The reaction at C is 0.375 WL\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "#because of symmetry the problem can be solved by considering first half\n",
+ "#Given\n",
+ "import numpy\n",
+ "\n",
+ "l_ab = 1.0 #L in - The length of the beam\n",
+ "F_D = 1.0 #W lb/in - The force distribution \n",
+ "F = F_D*l_ab #WL - The force applied\n",
+ "#Beause of symmetry the moment caliculations can be neglected\n",
+ "#EI - The flxure rigidity is constant and 1/EI =1 # k\n",
+ "\n",
+ "#part - A\n",
+ "#section 1--1\n",
+ "l_1 = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] #L taking each section at 0.1L distance \n",
+ "M_1 = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "v = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "\n",
+ "\n",
+ "# M_1_intg2[10] = 0, the displacement at the end of rod is 0 since its rigid \n",
+ "R_A = (F_D*(l_1[10]**4)/24.0 + F_D*(l_ab**3)*l_1[10]/48.0)/((l_1[10]**3)/6.0)\n",
+ "R_C = R_A #WL - symmetry\n",
+ "R_B = 1-R_A # WL - F_Y = 0, the equilibrium in Y direction\n",
+ "print \"The reaction at A is\",R_A ,\"WL\"\n",
+ "print \"The reaction at B is\",R_B ,\"WL\"\n",
+ "print \"The reaction at C is\",R_C ,\"WL\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.7 page number 521 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEACAYAAAC08h1NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHXZJREFUeJzt3Xt4VNW9xvHvCncQEBQpCUhDAAXkkigEqmgEoaDWW1tv\nVIph1JaLsc+hrRBowBC0PbUnMX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bxhnP4V6Yu\nEAcMAJoAnxpjPrXWfulsWY4YD+Rba282xsRQdmVhD2vtEacLCwWBCv4dwJUVltv6Xjt7nXaVrBMO\nqtIWGGN6AK8AQ6y1F/pTL5RVpS2uA+b6Bvm7HBhqjCm21r4ToBoDpSptsR3YZ609Dhw3xiwGelLW\nHx5OqtIW1wNpANbazcaYrcDVwKqAVBg8qpWbgerqWQl0NMa0N8bUB+4Hzv7FfQcYDmCM6QsctNbu\nCVB9gVRpWxhjrgTeAh6y1m52oMZAqbQtrLUdfI9oyvr5R4Vh6EPVfkfeBm4wxtQxxjSm7GTe+gDX\nGQhVaYv1wC0Avj7tzsCWgFYZOIbz/6VbrdwMyBG/tbbEGDOGsmGcI4Asa+16Y8xjZW/bV6y17xtj\nbjXGfAkUUdbFEXaq0hbAJKAlZ4azLrbWht3oplVsi+98JOBFBkgVf0c2GGM+BD4DSoBXrLXrHCzb\nL6r4c/E08FdjTD5lofg7a+1/nKvaP4wxrwMJwGXGmK8pu5qpPjXMTd3AJSLiMpp6UUTEZRT8IiIu\no+AXEXEZBb+IiMso+EVEXEbBLyLiMgp+ERGXUfCLiLjM/wNWcxRplSOb4wAAAABJRU5ErkJggg==\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0xccd3710>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "b) The shape from x belongs to 0<x<4\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "C:\\Users\\Kowshik\\AppData\\Local\\Enthought\\Canopy\\User\\lib\\site-packages\\numpy\\lib\\polynomial.py:588: RankWarning: Polyfit may be poorly conditioned\n",
+ " warnings.warn(msg, RankWarning)\n"
+ ]
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEACAYAAAC08h1NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+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AAABJRU5ErkJggg==\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0xb2150b8>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "b) The shape from x belongs to 4<x<5\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "%matplotlib inline \n",
+ "import matplotlib.pyplot as plt\n",
+ "\n",
+ "l_ac = 5 #m - The length of the beam \n",
+ "l_ab = 4 #m - The length of ac on beam \n",
+ "l_bc = 1 #m - The length of bc on beam \n",
+ "F = 20 #N - force applied on beam at 'b'\n",
+ "R_A = F/2 #wl - The reactive force at A\n",
+ "R_B = F/2 #wl - The reactive force at B\n",
+ "I_ab = 4 #I The moment of inertia of part AB \n",
+ "I_bc = 1 #I - The momemt of inertia of part BC\n",
+ "R_A = F*(l_bc/l_ac) #N- The reaction at joint A\n",
+ "R_B = F*(l_ab/l_ac) #N- The reaction at joint B\n",
+ "E = 1 #E youngs modulus\n",
+ "\n",
+ "#0<x<4\n",
+ "x = [0,1,2,3,4]\n",
+ "M = [0,0,0,0,0]\n",
+ "y = [0,0,0,0,0]\n",
+ "for i in range(5):\n",
+ " M[i] = 4*x[i] #integration of x**n = x**n+1/n+1\n",
+ " #y_2[i] = 4*x[i]/(E*I_ab) #The \n",
+ " #y_1[i] = 4*(x[i]**2)/(E*I_ab) -4.8/(E*I_bc) #The constant can be found by conditions y(o) = y(c) = 0\n",
+ " y[i] = 4*(x[i]**2)/(6*E*I_ab) -4.8*x[i]/(E*I_bc) #elastic curve constant can be found by Y_1(0) = 0 \n",
+ "\n",
+ "\n",
+ "#0<x_1<1\n",
+ "x_1 = [4,5]\n",
+ "m = [0,0]\n",
+ "Y = [0,0]\n",
+ "for i in range(2):\n",
+ " m[i] = 16 - 16*x_1[i] #integration of x**n = x**n+1/n+1\n",
+ " # Y_2 = (16 - 16*x_1[i])/(E*I_ab) \n",
+ " #Y_1 = (16*x_1[i]-8*(x_1[i]**2) +8 - 4.8)/(E*I_ab)#The constant can be found by conditions y(o) = y(c) = 0\n",
+ " Y[i] = (8*(x_1[i]**2)-8*(x_1[i]**3)/3 +(8-4.8)*x_1[i] - 4*4.8 )/(E*I_ab) #elastic curve constant can be found by Y_1(0) = 0\n",
+ "\n",
+ "#Graphs\n",
+ "values = y\n",
+ "y = np.array(values)\n",
+ "t = np.linspace(0,1,5)\n",
+ "poly_coeff = np.polyfit(t, y, 2)\n",
+ "plt.plot(t, y, 'o')\n",
+ "plt.plot(t, np.poly1d(poly_coeff)(t), '-')\n",
+ "plt.show()\n",
+ "print \"b) The shape from x belongs to 0<x<4\"\n",
+ "values = Y \n",
+ "y = np.array(values)\n",
+ "t = np.linspace(0,1,2)\n",
+ "poly_coeff = np.polyfit(t, y, 2)\n",
+ "plt.plot(t, y, 'o')\n",
+ "plt.plot(t, np.poly1d(poly_coeff)(t), '-')\n",
+ "plt.show()\n",
+ "print \"b) The shape from x belongs to 4<x<5\"\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.10 page number 529"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The deflection of point D -5.56 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "k = 24.0*(10**12) #N.mm2 Flexure rigidity\n",
+ "E = 200.0 #Gpa - Youngs modulus of the string\n",
+ "l = 5000.0 #mm - The length of the string\n",
+ "C_A = 300.0 #mm2 - crossection area \n",
+ "P = 50.0 #KN - The force applies at the end \n",
+ "a = 2000.0 #mm - The distance C-F\n",
+ "x = 1#X - let it be a variable X\n",
+ "y_d = x*(a**3)/(3*k) #Xmm The displacement at D, lets keep the variable in units part\n",
+ "y_p = -P*(10**3)*(16*(a**3)-12*(a**3)+(a**3))/(k*6) #mm The displacement due to p \n",
+ "e_rod = l/(C_A*E*(10**3)) #Xmm -deflection, The varible is in units \n",
+ "e_rod\n",
+ "X = y_p/(2*e_rod+y_d) # By equating deflections \n",
+ "y_d_1 = X*(a**3)/(3*k) # the deflection of point D\n",
+ "print \"The deflection of point D\",round(y_d_1,2),\"mm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.11 page number 530 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the horizantal component of deflection 0.246 in\n",
+ "the vertical component of deflection 0.073 in\n",
+ "the resultant deflection 0.257 in\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math \n",
+ "l = 15 #in - The length of the crossection \n",
+ "b = 33.9 #in - the width of the crossection\n",
+ "L = 100 #in The length of the cantilever \n",
+ "E = 29*(10**6) #psi The youngs modulus of the material used \n",
+ "I_Z = 315 #in4 - the moment of inertia wrt Z axis \n",
+ "I_y = 8.13 #in4 - the moment of inertia wrt Y axis\n",
+ "o = 5 # degrees - the angle of acting force \n",
+ "P = 2000 #k the acting force \n",
+ "P_h = P*math.sin(math.radians(o)) #k - The horizantal component of P\n",
+ "P_v = P*math.cos(math.radians(o)) #k - The vertical component of P\n",
+ "e_h = P_h*(L**3)/(3*E*I_y) # the horizantal component of deflection \n",
+ "e_v = P_v*(L**3)/(3*E*I_Z ) # the vertical component of deflection\n",
+ "e = pow((e_h**2 + e_v**2),0.5)\n",
+ "print \"the horizantal component of deflection\",round(e_h,3) ,\"in\"\n",
+ "print \"the vertical component of deflection\",round(e_v,3) ,\"in\"\n",
+ "print \"the resultant deflection\",round(e,3) ,\"in\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.13 page number 533"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a) The maximum deflection when the beam is on rigid supports 0.03 mm with impact factor 71.7 b) The maximum deflection when the beam is on spring supports 0.28 mm with impact factor 24.17\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "l = 50.0 #mm - The length of the crossection \n",
+ "b = 50.0 #mm - the width of the crossection\n",
+ "m = 15.3 # mass of the falling body\n",
+ "h = 75.0 #mm - The height of the falling body \n",
+ "p = m*9.81 #N the force acted due to the body\n",
+ "L = 1000.0 #mm The length of the cantilever\n",
+ "E = 200 #Gpa The youngs modulus of the material used \n",
+ "I = (l**4)/12 #mm - the moment of inertia \n",
+ "k = 300 #N/mm -the stiffness of the spring \n",
+ "#Rigid supports \n",
+ "e = m*9.81*(L**3)*(10**-3)/(48*E*I) #mm - the deflection of beam \n",
+ "imp_fact_a = 1 +pow((1 +2*h/e),0.5) #no units , impact factor \n",
+ "#spring supports\n",
+ "e_spr = h/k #mm the elongation due to spring \n",
+ "e_total = e_spr + e \n",
+ "imp_fact_b = 1 +pow((1 +2*h/e_total),0.5) #no units , impact factor\n",
+ "print \"a) The maximum deflection when the beam is on rigid supports\",round(e,3),\"mm with impact factor\",round(imp_fact_a ,2),\n",
+ "print \"b) The maximum deflection when the beam is on spring supports\",round(e_total,2),\"mm with impact factor\",round(imp_fact_b,2) ,\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.15 page number 536 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the ultimate capacity 120 K-in\n",
+ "the ultimate curvature 0.000806666666667 in*-1\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "E = 30*(10**3) #ksi - The youngs modulus of the material \n",
+ "stress_y = 40 #Ksi - yield stress\n",
+ "stress_max = 24.2 #Ksi - the maximum stress\n",
+ "l = 2 #in - The length of the crossection \n",
+ "b = 3 #in - the width of the crossection\n",
+ "h = 3 #in - the depth of the crossection\n",
+ "#lets check ultimate capacity for a 2 in deep section \n",
+ "M_ul = stress_y*b*(l**2)/4 #K-in the ultimate capacity \n",
+ "curvature = 2*stress_y/(E*(h/2) ) #in*-1 the curvature of the beam \n",
+ "curvature_max = stress_max/(E*(h/2)) #in*-1 The maximum curvature \n",
+ "print \"the ultimate capacity\",M_ul,\"K-in\"\n",
+ "print \"the ultimate curvature\",curvature_max,\"in*-1\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.16 page number 543"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum deflection at tip B -4.11 mm\n",
+ "The slope at the tip B -0.0 radians\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "l_ad = 1600 #mm - The total length of the beam \n",
+ "l_ab = 600 #mm - The length of AB\n",
+ "l_bc = 600 #mm - The length of BC\n",
+ "e_1 = 0.24 #mm - deflection \n",
+ "e_2 = 0.48 #mm - deflection\n",
+ "E = 35 #Gpa\n",
+ "#Caliculation \n",
+ "\n",
+ "A_afe = -(l_ab+l_bc)*e_1*(10**-3)/(2*E)\n",
+ "A_afe = -(l_ab)*e_2*(10**-3)/(4*E)\n",
+ "y_1_b = A_afe + A_afe #rad the slope at the tip B\n",
+ "x_1 = 1200 #com from B\n",
+ "x_2 = 800 #com from B\n",
+ "y_b = A_afe*x_1 + A_afe*x_2 #mm The maximum deflection at tip B\n",
+ "print\"The maximum deflection at tip B\",round(y_b,2),\"mm\"\n",
+ "print \"The slope at the tip B\",round(y_1_b,2) ,\"radians\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.19 page number 547 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " The maximum displacement in y direction is -0.0130208333333 W(l**4)/EI \n",
+ " The maximum deflection occured at 0.5 L\n",
+ " The maximum deflection is -0.05775 W(l**3)/EI \n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "import numpy\n",
+ "l_ab = 1.0 #L in - The length of the beam\n",
+ "F_D = 1.0 #W lb/in - The force distribution \n",
+ "F = F_D*l_ab #WL - The force applied\n",
+ "#Beause of symmetry the moment caliculations can be neglected\n",
+ "#F_Y = 0\n",
+ "R_A = F/2 #wl - The reactive force at A\n",
+ "R_B = F/2 #wl - The reactive force at B\n",
+ "#EI - The flxure rigidity is constant and 1/EI =1 # k\n",
+ "\n",
+ "#part - A\n",
+ "#section 1--1\n",
+ "l_1 = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] #L taking each section at 0.1L distance \n",
+ "M_1 = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "v = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "for i in range(10):\n",
+ " v[i] = R_A - F_D*l_1[i] \n",
+ " M_1[i] = R_A*l_1[i] - F_D*(l_1[i]**2)/2\n",
+ "# (EI)y'' = M_1[i] we will integrate M_1[i] twice where variable is l_1[i]\n",
+ "#(EI)y'- \n",
+ "\n",
+ "M_1_intg1 = R_A*(l_1[i]**2)/4 - F_D*(l_1[i]**3)/6 - F_D*(l_ab**3)*l_1[i]/24 #deflection integration of x**n = x**n+1/n+1\n",
+ "#(EI)y- Using end conditions for caliculating constants \n",
+ "\n",
+ "M_1_intg2 = R_A*(l_1[i]**3)/12.0 - F_D*(l_1[i]**4)/24.0 + F_D*(l_ab**3)*l_1[i]/24.0 \n",
+ "#Equations \n",
+ "\n",
+ "l_1 = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] #L taking each section at 0.1L distance \n",
+ "M_1_intg2 = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "Y = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "for i in range(10):\n",
+ " M_1_intg2[i] = (l_1[i]**3)/12.0 - (l_1[i]**4)/24.0 - l_1[i]/24.0 # discluding every term for ruling out float values\n",
+ " Y[i] = M_1_intg2[i] #W(l**4)/EI k = 1/EI\n",
+ "#The precision is very less while caliculating through this equation because the least count in X direction is 0.1\n",
+ "print \" The maximum displacement in y direction is\",min(Y),\"W(l**4)/EI \"\n",
+ "print \" The maximum deflection occured at\",l_1[Y.index(min(Y))],\"L\"\n",
+ "\n",
+ "l_1 = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] #L taking each section at 0.1L distance \n",
+ "M_1_intg1 = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "Y = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "for i in range(10):\n",
+ " M_1_intg1[i] = R_A*(l_1[i]**2)/4 - F_D*(l_1[i]**3)/6 - F_D*(l_ab**3)*l_1[i]/24\n",
+ "print \" The maximum deflection is\",min(M_1_intg1 ),\"W(l**3)/EI \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.23 page number 554 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The moment at the end is -0.0833333333333 wl**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy\n",
+ "l_ab = 1.0 #L in - The length of the beam\n",
+ "F_D = 1.0 #W lb/in - The force distribution \n",
+ "F = F_D*l_ab #WL - The force applied\n",
+ "#Beause of symmetry the moment caliculations can be neglected\n",
+ "#F_Y = 0\n",
+ "R_A = F/2 #wl - The reactive force at A\n",
+ "R_B = F/2 #wl - The reactive force at B\n",
+ "#EI - The flxure rigidity is constant and 1/EI =1 # k\n",
+ "#M_A and M_B are applied at the ends\n",
+ "\n",
+ "#part - A\n",
+ "#section 1--1\n",
+ "l_1 = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] #L taking each section at 0.1L distance \n",
+ "M = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "for i in range(10):\n",
+ " M[i] = l_1[i]/2.0 - (l_1[i]**2)/2.0 -1.0/12.0 #The moment euation at 1--1 section\n",
+ "# M_1 = R_A*l_1[i]/2.0 - F_D*(l_1[i]**2)/2.0 -F_D*(l_ab**2)/12.0 #The moment euation at 1--1 section \n",
+ "# (EI)y'' = M_1[i] we will integrate M_1[i] twice where variable is l_1[i]\n",
+ "#(EI)y'\n",
+ "M_1_intg1 = R_A*(l_1[i]**2)/4 - F_D*(l_1[i]**3)/6 - F_D*(l_ab**2)*l_1[i]/12.0 #integration of x**n = x**n+1/n+1\n",
+ "#(EI)y\n",
+ " \n",
+ "print \"The moment at the end is \",M[0],\"wl**2\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.25 pagenumber 556"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAEACAYAAABYq7oeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmcjfX7x/HXZd9F9rEkClmSb7YixzJRymj9WUObilQS\nJb5DVFRakBbJkl2+2YsJQwkJITuNibEU2YVhrt8fczDNYsacM+c+58z1fDzm0Tn3+dz3/XY/pnPN\n/fncn/sWVcUYY4xJKIvTAYwxxvgfKw7GGGOSsOJgjDEmCSsOxh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z43rRJcMYYY5Lwt24lY4wx\nfsCKgzHGmCSsOBhjjEnCioMxxpgkrDgYY4xJwoqDMcaYJKw4GGOMScKKgzHGmCT+H0QpvJnXJERk\nAAAAAElFTkSuQmCC\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0xccd30f0>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAAEACAYAAABVtcpZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHz9JREFUeJzt3Xl4VdW9//H3l/mqgBMiCYoYKxZUQJBKoRoHCE6g1F5B\nQFGxoKLW/n4W9TYS5VqlvU+12qIyKCoqtgiIE4NCRLiKoIDKIFMaIUFAVIRIICTf+0cCxkhC4Oyc\nfYbP63ny9Azr7P11N6xP9l77rGXujoiIJKdaYRcgIiLhUQiIiCQxhYCISBJTCIiIJDGFgIhIElMI\niIgksUBCwMx6mNlKM1tlZsP28/4xZvaWmS0xs0/NbGAQ+xURkchYpN8TMLNawCrgQiAfWAj0cfeV\n5doMBxq4+z1mdizwOdDU3fdEtHMREYlIEGcCnYDV7p7r7kXARKBXhTZfAg3LHjcEtioARETCVyeA\nbaQC68s930BpMJQ3BnjHzPKBI4CrA9iviIhEKFoDw/cAS909BWgP/MPMjojSvkVEpBJBnAnkASeW\ne9687LXyugAPArj7WjPLAU4DFlXcmJlpMiMRkYPk7nYonwviTGAhcIqZtTCzekAfYFqFNiuAiwDM\nrClwKrCusg26u37cGT58eOg1xMKPjoOOhY5F1T+RiPhMwN2LzWwoMJPSUBnn7ivMbHDp2z4aeAh4\nxsyWAgb8wd2/jnTfIiISmSAuB+Hu04FWFV57qtzjr4DLg9iXiIgER98YjmHp6elhlxATdBx+oGPx\nAx2LYET8ZbGgmZnHWk0iIrHMzPAQB4ZFRCROKQRERJKYQkBEJIkpBEREkphCQEQkiSkERESSmEJA\nRCSJKQRERJKYQkB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NgBfuXsh\nUGhmc4G2lF4/TyTVORZdgAcB3H2tmeUApwGLolJhbDnovjOMy0ELgVPMrIWZ1QP6ABX/EU8DrgUw\ns3OAb71sjqIEc8BjYWYnAq8AA9x9bQg1RssBj4W7n1z205LScYFbEjAAoHr/Rl4FuppZbTM7jNJB\nwBVRrjMaqnMsVgAXAZRd/z4VWBfVKqPLqPws+KD7zqifCbh7sZkNBWZSGkLj3H2FmQ0ufdtHu/ub\nZnaJma0BCii9DJJwqnMsgEzgaGBU2V/ARe7eKbyqa0Y1j8WPPhL1IqOkmv9GVprZDOAToBgY7e4J\nN1V7NX8vHgKeMbOllHaOf3D3r8OruuaY2YtAOnCMmX1B6Z1R9Yig79SXxUREkpiWlxQRSWIKARGR\nJKYQEBFJYgoBEZEkphAQEUliCgERkSSmEBARSWIKARGRJPZ/XAlOnyX6TbQAAAAASUVORK5CYII=\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0xaf5ca90>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "import matplotlib.pyplot as plt\n",
+ "%matplotlib inline\n",
+ "import numpy as np\n",
+ "# This problem is divided into two parts\n",
+ "#Part _1\n",
+ "#Given\n",
+ "\n",
+ "l = 1.0 #l - The length of the beam\n",
+ "p = 1.0 #W - The total load applied\n",
+ "#since it is triangular distribution \n",
+ "l_com = 0.66*l #l - The distance of force of action from one end\n",
+ "#F_Y = 0\n",
+ "#R_A + R_B = p\n",
+ "#M_a = 0 Implies that R_B = 2*R_A\n",
+ "R_A = p/3.0\n",
+ "R_B = 2.0*p/3\n",
+ "\n",
+ "#Taking Many sections \n",
+ "\n",
+ "#Section 1----1\n",
+ "l = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] #L taking each section at 0.1L distance \n",
+ "M = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "v = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "for i in range(10):\n",
+ " v[i] = p*(l[i]**2) - p/3.0\n",
+ " M[i] = p*(l[i]**3)/(3.0)- p*l[i]/3.0\n",
+ "\n",
+ "v[10] = R_B #again concluded Because the value is tearing of \n",
+ "\n",
+ "\n",
+ "#Graph\n",
+ "values = M\n",
+ "y = np.array(values)\n",
+ "t = np.linspace(0,1,11)\n",
+ "poly_coeff = np.polyfit(t, y, 2)\n",
+ "plt.plot(t, y, 'o')\n",
+ "plt.plot(t, np.poly1d(poly_coeff)(t), '-')\n",
+ "plt.show()\n",
+ "values = v\n",
+ "y = np.array(values)\n",
+ "t = np.linspace(0,1,11)\n",
+ "poly_coeff = np.polyfit(t, y, 2)\n",
+ "\n",
+ "plt.plot(t, y, 'o')\n",
+ "plt.plot(t, np.poly1d(poly_coeff)(t), '-')\n",
+ "plt.show()\n",
+ "\n",
+ "\n",
+ "#part B\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter11_4.ipynb b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter11_4.ipynb
new file mode 100644
index 00000000..b35f7fc0
--- /dev/null
+++ b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter11_4.ipynb
@@ -0,0 +1,385 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 11:Stability of Equilibrium: columns "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.2 page number 589"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The length after which the beam starts buckling is 1539.0 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "import math\n",
+ "h = 60 #mm - the length of the crossection \n",
+ "b = 100 #mm - the width of hte crossection \n",
+ "E = 200 #Gpa - The youngs modulus\n",
+ "stress_cr = 250 #Mpa - The proportionality limit\n",
+ "#Caliculations \n",
+ "\n",
+ "I = b*(h**3)/12 #mm3 The momentof inertia of the crossection\n",
+ "A = h*b #mm2 - The area of teh crossection \n",
+ "#From Eulier formula\n",
+ "r_min = pow((I/A),0.5) #mm - The radius of the gyration \n",
+ "#(l/r)**2= (pi**2)*E/stress_cr #From Eulier formula\n",
+ "l = (((math.pi**2)*E*(10**3)/stress_cr)**0.5)*r_min #mm - the length after which the beam starts buckling\n",
+ "print \"The length after which the beam starts buckling is \",round(l,0),\"mm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.6 page number 613"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)The following approch is solvable\n",
+ "a) The allowable stress in this case is 18.9 Kips\n",
+ "b) The following approch is solvable\n",
+ "b) The allowable stress in this case is 11.59 Kips\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "import math\n",
+ "L = 15 #ft - The length of the each rod\n",
+ "A = 46.7 #in2 - The length of the crossection \n",
+ "r_min = 4 #in - The radius of gyration\n",
+ "stress_yp = 36 #Ksi - the yielding point stress\n",
+ "E = 29*(10**3) #ksi - The youngs modulus\n",
+ "C_c = ((2*(math.pi**2)*E/stress_yp)**0.5) #Slenderness ratio L/R\n",
+ "C_s = L*12/r_min # Slenderness ratio L/R of the present situation \n",
+ "#According to AISC formulas \n",
+ "if C_s <C_c :\n",
+ " print \"a)The following approch is solvable\"\n",
+ "else: \n",
+ " print \"The caliculation is not possible\"\n",
+ "F_S = 5.0/3 +3*C_s/(8*C_c) -(3*C_s**3)/(8*C_c**3) #Safety factor \n",
+ "Stress_all = (1 - (C_s**2)/(2*C_c**2))*stress_yp/F_S #The allowable strees \n",
+ "print \"a) The allowable stress in this case is\",round(Stress_all,2),\"Kips\" \n",
+ "#Part - B\n",
+ "#Given\n",
+ "L = 40 #ft - The length of the each rod\n",
+ "A = 46.7 #in2 - The length of the crossection \n",
+ "r_min = 4 #in - The radius of gyration\n",
+ "stress_yp = 36 #Ksi - the yielding point stress\n",
+ "E = 29*(10**3) #ksi - The youngs modulus\n",
+ "C_c = ((2*(math.pi**2)*E/stress_yp)**0.5) #Slenderness ratio L/R\n",
+ "C_s = L*12/r_min # Slenderness ratio L/R of the present situation \n",
+ "#According to AISC formulas \n",
+ "if C_s <C_c :\n",
+ " print \"b) The following approch is solvable\"\n",
+ "else: \n",
+ " print \"The caliculation is not possible\"\n",
+ "F_S = 5.0/3 +3*C_s/(8*C_c) -(3*C_s**3)/(8*C_c**3) #Safety factor \n",
+ "Stress_all = (1 - (C_s**2)/(2*C_c**2))*stress_yp/F_S #The allowable strees \n",
+ "print \"b) The allowable stress in this case is\",round(Stress_all,2),\"Kips\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.7 page number 614"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)The following approch is solvable\n",
+ "The allowable stress in this case is 19.14 Kips\n",
+ "This stress requires 10.45 in2\n",
+ "This case is satisfying W8x24 section\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "import math\n",
+ "L = 15 #ft - The length of the each rod \n",
+ "p = 200 #Kips The concentric load applied \n",
+ "r_min = 2.10 #in - The radius of gyration\n",
+ "stress_yp = 50 #Ksi - the yielding point stress\n",
+ "E = 29*(10**3) #ksi - The youngs modulus\n",
+ "C_c = ((2*(math.pi**2)*E/stress_yp)**0.5) #Slenderness ratio L/R\n",
+ "C_s = L*12/r_min #Slenderness ratio L/R present situation\n",
+ "if C_s <C_c :\n",
+ " print \"a)The following approch is solvable\"\n",
+ "else: \n",
+ " print \"The caliculation is not possible\"\n",
+ "F_S = 5.0/3 +3*C_s/(8*C_c) -(3*C_s**3)/(8*C_c**3) #Safety factor \n",
+ "Stress_all = (1 - (C_s**2)/(2*C_c**2))*stress_yp/F_S #The allowable strees\n",
+ "a = p/Stress_all #in2 the alloawble area of the beam \n",
+ "print \"The allowable stress in this case is\",round(Stress_all,2),\"Kips\"\n",
+ "print \"This stress requires \",round(a,2),\"in2\"\n",
+ "if a <11.5:\n",
+ " print \"This case is satisfying W8x24 section\" #From AISC Manual \n",
+ "else:\n",
+ " print \"This case is not satisfying W8x24 section\"\n",
+ " #The ans are quiet varying because of rounding\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.8 pagenumber 614 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The following approach is right\n",
+ "column design compressive strength 1284.51846781 Kips\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "import math\n",
+ "L = 15.0 #ft - The length of the each rod\n",
+ "A = 46.7 #in2 - The length of the crossection \n",
+ "r_min = 4 #in - The radius of gyration\n",
+ "stress_yp = 36.0 #Ksi - the yielding point stress\n",
+ "E = 29*(10**3) #ksi - The youngs modulus\n",
+ "lamda = L*12*((stress_yp/E)**0.5)/(4*(math.pi)) #column slenderness ratio\n",
+ "if lamda<1.5:\n",
+ " print \"The following approach is right\"\n",
+ "else:\n",
+ " print \"The following approach is wrong\"\n",
+ "stress_cr = (0.658**(lamda**2))*stress_yp #Ksi - The critical stress \n",
+ "P_n = stress_cr*A #Kips #Nominal compressive strength \n",
+ "o = 0.85 #Resistance factor\n",
+ "p_u = o*P_n #Kips ,column design compressive strength \n",
+ "print \"column design compressive strength \",p_u,\"Kips\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.9 page number 615"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum allowable stress in case of web width 19.0 Ksi\n",
+ "The maximum allowable stress in case of flang 17.16 Ksi\n",
+ "a) The maximum allowable load in case of Buckling 75.58 Kips\n",
+ "b) The maximum allowable load in case of Buckling 63.14 Kips\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "#FOR FLANGS\n",
+ "l = 5 #in - The length of the flang\n",
+ "b = 5 #in - Teh width of the flang\n",
+ "t = 0.312 #in - the thickness of the flang\n",
+ "L = 20 #in - Length of the beam, Extracted from AISC manuals\n",
+ "A = 4.563 #in2 - The area of crossection of the beam\n",
+ "r = 1.188 #in - radius of the gyration, Extracted from AISC manuals \n",
+ "#b/t- value of the flang \n",
+ "k = (5 -t)/(2*t) #b/t ratio \n",
+ "#AISC, lets check maximum allowable stress for slang\n",
+ "Stressf_all = 23.1 - 0.79*k #ksi The maximum allowable stress in case of flang,AISC\n",
+ "\n",
+ "#web width thickness ratio\n",
+ "k_2 = (5 -2*t)/(t)\n",
+ "if k_2<16:\n",
+ " Stressw_all = 19 #ksi - The allowable stress in case of web width\n",
+ " \n",
+ "#a) Overall buckling investment \n",
+ "k_3 = L/r #slenderness ratio\n",
+ "Stressb_all = 20.2 - 0.216*k_3#ksi The maximum allowable stress in case of Buckling,AISC\n",
+ "p_allow = A*Stressb_all #Kips The allowable concentric load \n",
+ "\n",
+ "#b) Overall buckling investment\n",
+ "L_2 = 60 #in \n",
+ "k_3 = L_2/r #slenderness ratio\n",
+ "Stressb_all_2 = 20.2 - 0.126*k_3#ksi The maximum allowable stress in case of Buckling,AISC\n",
+ "p_allow_2 = A*Stressb_all_2 #Kips The allowable concentric load \n",
+ "\n",
+ "print \"The maximum allowable stress in case of web width\",round(Stressw_all,2),\"Ksi\"\n",
+ "print \"The maximum allowable stress in case of flang\",round(Stressf_all,2),\"Ksi\"\n",
+ "print \"a) The maximum allowable load in case of Buckling\",round(p_allow,2),\"Kips\"\n",
+ "print \"b) The maximum allowable load in case of Buckling\",round(p_allow_2,2),\"Kips\"\n",
+ "\n",
+ "\n",
+ " \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.11 page number 620 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The minimum area is 13.71 in2\n",
+ "The following approch is solvable\n",
+ "The following W10x49 section is not satisfying our constraints since f_a/F_a_1 + c_m*f_b*(1-(f_a/F_e))/F_b 1.09 >1\n",
+ "The following approch is solvable\n",
+ "The following W10x49 section is satisfying our constraints since f_a/F_a_1 + c_m*f_b*(1-(f_a/F_e))/F_b 0.9 <1\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "P = 200.0 #K The force on the beam \n",
+ "L = 15 #ft - The length of the rod\n",
+ "F_y = 50.0 #Ksi \n",
+ "F_a = F_y/(5.0/3) #Ksi -AISC MANUAL ,allowable axial stress if axial force is alone\n",
+ "F_b = F_a #Allowable compressive bending stress\n",
+ "M_1 = 600.0 #k-in - The moment acting on the ends of the rod\n",
+ "M_2 = 800.0 #k-in - the moment acting on the other end of teh rod\n",
+ "B_x = 0.264 #in - Extracted from AISC manual \n",
+ "E = 29*(10**3) \n",
+ "A = P/F_a + M_2*B_x/F_b #in2- The minimum area \n",
+ "print \"The minimum area is \",round(A,2),\"in2\"\n",
+ "#we will select W10x49 section \n",
+ "A_s = 14.4 #in2 - The area of the section \n",
+ "r_min = 2.54 #in The minimum radius \n",
+ "r_x = 4.35 #in \n",
+ "f_a = P/A_s #Ksi- The computed axial stress\n",
+ "f_b = M_2*B_x/A_s #Computed bending stess\n",
+ "C_c = ((2*(math.pi**2)*E/F_y)**0.5) #Slenderness ratio L/R\n",
+ "C_s = L*12/r_min # Slenderness ratio L/R of the present situation\n",
+ "if C_s <C_c :\n",
+ " print \"The following approch is solvable\"\n",
+ "else: \n",
+ " print \"The caliculation is not possible\"\n",
+ "F_a_1 = 19.3 #Ksi - AISC lets try this\n",
+ "c_m = 0.6 - 0.4*(-M_1/M_2) \n",
+ "F_e = (12*(math.pi**2)*E)/(23*(L*12/r_x)**2) \n",
+ "k = f_a/F_a_1 + c_m*f_b*(1-(f_a/F_e))/F_b #Condition mentioned in AISC\n",
+ "if k>1:\n",
+ " print \"The following W10x49 section is not satisfying our constraints since f_a/F_a_1 + c_m*f_b*(1-(f_a/F_e))/F_b\",round(k,3),\">1\"\n",
+ "else:\n",
+ " print \"The following W10x49 section is satisfying our constraints since f_a/F_a_1 + c_m*f_b*(1-(f_a/F_e))/F_b\",k,\"<1\"\n",
+ " \n",
+ "#trail - 2\n",
+ "#Lets take W10 x 60\n",
+ "A_s = 17.6 #in2 - The area of the section \n",
+ "r_min = 2.57 #in The minimum radius \n",
+ "r_x = 4.39 #in \n",
+ "f_a = P/A_s #Ksi- The computed axial stress\n",
+ "f_b = M_2*B_x/A_s #Computed bending stess\n",
+ "C_c = ((2*(math.pi**2)*E/F_y)**0.5) #Slenderness ratio L/R\n",
+ "C_s = L*12/r_min # Slenderness ratio L/R of the present situation\n",
+ "if C_s <C_c :\n",
+ " print \"The following approch is solvable\"\n",
+ "else: \n",
+ " print \"The caliculation is not possible\"\n",
+ "F_a_1 = 19.3 #Ksi - AISC lets try this\n",
+ "c_m = 0.6 - 0.4*(-M_1/M_2) \n",
+ "F_e = (12*(math.pi**2)*E)/(23*(L*12/r_x)**2) \n",
+ "k = f_a/F_a_1 + c_m*f_b*(1-(f_a/F_e))/F_b #Condition mentioned in AISC\n",
+ "if k>1:\n",
+ " print \"The following W10x49 section is not satisfying our constraints since f_a/F_a_1 + c_m*f_b*(1-(f_a/F_e))/F_b\",round(k,3),\">1\"\n",
+ "else:\n",
+ " print \"The following W10x49 section is satisfying our constraints since f_a/F_a_1 + c_m*f_b*(1-(f_a/F_e))/F_b\",round(k,2),\"<1\"\n",
+ " \n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter12_4.ipynb b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter12_4.ipynb
new file mode 100644
index 00000000..71380130
--- /dev/null
+++ b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter12_4.ipynb
@@ -0,0 +1,411 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Chapter 12:Energy and Virtual-work Methods"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.1 page number 645 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a) The deflection is downwards 0.044 in\n",
+ "b) The deflection is upwards 0.104 in\n",
+ "c) The deflection is downwards 0.039 in\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "#Virtual loading\n",
+ "p_ab = -0.833 #lb The recorded virtual loading\n",
+ "p_bc = + 0.833 #lb The recorded virtual loading\n",
+ "F_ab = 2500 #lb\n",
+ "F_bc = -2500 #lb\n",
+ "l_ab = 60 #in - The length of the rod\n",
+ "l_bc = 60 #in - The length of the rod\n",
+ "A_ab = 0.15 #in2 the areaof ab\n",
+ "A_bc = 0.25 #in2 the areaof bc\n",
+ "E = 30*(10**6) #psi The youngs modulus of the material\n",
+ "#Part_a\n",
+ "e_a =p_ab*l_ab*F_ab/(A_ab*E) + p_bc*l_bc*F_bc/(A_bc*E) #in the deflection\n",
+ "if e_a<0:\n",
+ " print \"a) The deflection is downwards\",round(-e_a,3),\"in\"\n",
+ "else:\n",
+ " print \"a) The deflection is upwards\",round(e_a,3),\"in\"\n",
+ "#part-b\n",
+ "x = 0.125 #Shortening of member Ab\n",
+ "e_b = p_ab*(-x) + p_bc*0 #in - in\n",
+ "if e_b<0:\n",
+ " print \"b) The deflection is downwards\",round(-e_b,3),\"in\"\n",
+ "else:\n",
+ " print \"b) The deflection is upwards\",round(e_b,3),\"in\"\n",
+ "#Part-c\n",
+ "S = 6.5*(10**-6) #Thermal specific heat\n",
+ "T = 120 #F - The cahnge in temperature\n",
+ "e_t = -S*T*l_ab #in - The change in length of member\n",
+ "e_c = p_bc*e_t #in the deflection\n",
+ "if e_c<0:\n",
+ " print \"c) The deflection is downwards\",round(-e_c,3),\"in\"\n",
+ "else:\n",
+ " print \"c) The deflection is upwards\",round(e_c,3),\"in\"\n",
+ "\n",
+ "\n",
+ " \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.3 page number 648"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The point C deflects 0.019 mt down\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "#Virtual loading\n",
+ "#Two parts \n",
+ "#Part -1 \n",
+ "p_ab = 5 #KN The recorded virtual loading\n",
+ "p_bc = -4 #KN The recorded virtual loading\n",
+ "F_ab = 10 #KN\n",
+ "F_bc = -8 #KN\n",
+ "l_ab = 2.5 #mt - The length of the rod\n",
+ "l_bc = 2 #mt - The length of the rod\n",
+ "A_ab = 5*(10**-4) #mt2 the areaof ab\n",
+ "A_bc = 5*(10**-3) #mt2 the areaof bc\n",
+ "E = 70 #Gpa The youngs modulus of the material\n",
+ "e_a =(p_ab*l_ab*F_ab/(A_ab*E) + p_bc*l_bc*F_bc/(A_bc*E))*(10**-6) #KN-m\n",
+ "#Part -2 due to flexure\n",
+ "I = 60*10**6 #mm4 - the moment of inertia \n",
+ "#After solving the integration \n",
+ "e_b = 0.01525 #KN-m\n",
+ "#Total\n",
+ "e = (e_a+e_b)*1 #m\n",
+ "print \"The point C deflects\",round(e,3),\"mt down\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.5 page number 651"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The reaction force at D is 1578.98 lb\n",
+ "The deflection of nodal point B 0.0211 in\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "#Virtual loading Without f_d\n",
+ "p_ab = -0.833 #lb The recorded virtual loading\n",
+ "p_bc = + 0.833 #lb The recorded virtual loading\n",
+ "F_ab = 2500 #lb\n",
+ "F_bc = -2500 #lb\n",
+ "l_ab = 60 #in - The length of the rod\n",
+ "l_bc = 60 #in - The length of the rod\n",
+ "A_ab = 0.15 #in2 the areaof ab\n",
+ "A_bc = 0.25 #in2 the areaof bc\n",
+ "E = 30*(10**6) #psi The youngs modulus of the material\n",
+ "#Part_a\n",
+ "e_a =p_ab*l_ab*F_ab/(A_ab*E) + p_bc*l_bc*F_bc/(A_bc*E) #lb-in the deflection\n",
+ "#With f_d\n",
+ "p_bd = 1 #lb The recorded virtual loading \n",
+ "F_bd = 1 #lb\n",
+ "l_bd = 40 #in - The length of the rod\n",
+ "A_bd = 0.1 #in2 the areaof ab\n",
+ "e_a_1 =p_ab*p_ab*l_ab/(A_ab*E) + p_bc*p_bc*l_bc/(A_bc*E) +p_bd*p_bd*l_bd/(A_bd*E) #lb-in the deflection\n",
+ "#Since the produced defelection should compensate the other one\n",
+ "x_d = e_a/e_a_1\n",
+ "print \"The reaction force at D is\",round(-x_d,2),\"lb\"\n",
+ "\n",
+ "#Part - B\n",
+ "e_b = -x_d*l_bd/(A_bd*E ) #in - The deflection of nodal point B\n",
+ "print\"The deflection of nodal point B\",round(e_b,4),\"in\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.6 page number 655"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The reaction at A 2.5 k\n",
+ "The reaction at B -2.5 k\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "#Virtual loading\n",
+ "import numpy as np\n",
+ "p_ab = -0.833 #lb The recorded virtual loading\n",
+ "p_bc = + 0.833 #lb The recorded virtual loading \n",
+ "l_ab = 60 #in - The length of the rod\n",
+ "l_bc = 60 #in - The length of the rod\n",
+ "A_ab = 0.15 #in2 the areaof ab\n",
+ "A_bc = 0.25 #in2 the areaof bc\n",
+ "E = 30*(10**6) #psi The youngs modulus of the material\n",
+ "K_1 = A_ab*E/l_ab #k/in - Stiffness\n",
+ "K_2 = A_bc*E/l_bc #k/in - Stiffness\n",
+ "#soving for e_1 and e_2 gives a liner euations to solve\n",
+ "# 128*e_1 + 24*e_2 = 0\n",
+ "#24*e_1 + 72*e_2 = -3\n",
+ "#Solving for e_1,e_2\n",
+ "a = np.array([[128,24], [24,72]])\n",
+ "b = np.array([0,-3])\n",
+ "x = np.linalg.solve(a, b)\n",
+ "e_1 = x[0] #in\n",
+ "e_2 = x[1] #in\n",
+ "u_1 = 0.8*e_1 - 0.6*e_2 #Taking each components\n",
+ "F_1 = K_1*u_1*(10**-3) #k The reaction at A Force = stiffness x dislacement \n",
+ "u_2 = 0.8*e_1 + 0.6*e_2 #Taking each components\n",
+ "F_2 = K_2*u_2*(10**-3) #k The reaction at B Force\n",
+ "print \"The reaction at A \",F_1,\"k\"\n",
+ "print \"The reaction at B \",F_2,\"k\"\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.7 page number 655"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The reaction at A 1.18 k\n",
+ "The reaction at B -1.18 k\n",
+ "The reaction at D -1.58 k\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Virtual loading\n",
+ "import numpy as np\n",
+ "p_ab = -0.833 #lb The recorded virtual loading\n",
+ "p_bc = + 0.833 #lb The recorded virtual loading \n",
+ "l_ab = 60 #in - The length of the rod\n",
+ "l_bc = 60 #in - The length of the rod\n",
+ "A_ab = 0.15 #in2 the areaof ab\n",
+ "A_bc = 0.25 #in2 the areaof bc\n",
+ "E = 30*(10**6) #psi The youngs modulus of the material\n",
+ "K_1 = A_ab*E/l_ab #k/in - Stiffness\n",
+ "K_2 = A_bc*E/l_bc #k/in - Stiffness\n",
+ "p_bd = 1 #lb The recorded virtual loading \n",
+ "F_bd = 1 #lb\n",
+ "l_bd = 40 #in - The length of the rod\n",
+ "A_bd = 0.1 #in2 the areaof ab\n",
+ "K_3 = A_ab*E/l_ab #k/in - Stiffness\n",
+ "#soving for e_1 and e_2 gives a liner euations to solve\n",
+ "# 128*e_1 + 24*e_2 = 0\n",
+ "#24*e_1 + 72*e_2 = -3\n",
+ "#Solving for e_1,e_2\n",
+ "a = np.array([[128,24], [24,147]])\n",
+ "b = np.array([0,-3])\n",
+ "x = np.linalg.solve(a, b)\n",
+ "e_1 = x[0] #in\n",
+ "e_2 = x[1] #in\n",
+ "u_1 = 0.8*e_1 - 0.6*e_2 #Taking each components\n",
+ "F_1 = K_1*u_1*(10**-3) #k The reaction at A Force = stiffness x dislacement \n",
+ "u_2 = 0.8*e_1 + 0.6*e_2 #Taking each components\n",
+ "F_2 = K_2*u_2*(10**-3) #k The reaction at B Force\n",
+ "u_3 = e_2 #Taking each components\n",
+ "F_3 = K_3*u_3*(10**-3) #k The reaction at D Force\n",
+ "print \"The reaction at A \",round(F_1,2),\"k\"\n",
+ "print \"The reaction at B \",round(F_2,2),\"k\"\n",
+ "print \"The reaction at D \",round(F_3,2),\"k\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.8 page number 659"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "b) The vertical component of the nodal force is [ 12.] \n",
+ "b) The vertical component of the nodal force is [ 24.] \n",
+ "a) The components of displacement of point B are 18.75 L/AE and 16.67 L/AE\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "#First we will solve part B\n",
+ "import numpy as np\n",
+ "u_1 =5 #L/AE, elastic elongation\n",
+ "u_2 =25 #L/AE,elastic elongation\n",
+ "f_1 = u_1#, Units got neutralized , Constitutive relation for elastic bars\n",
+ "f_2 = u_2# Units got neutralized\n",
+ "#u_1 = 0.8*e_1 - 0.6*e_2\n",
+ "#u_2 = 0.8*e_1 + 0.6*e_2\n",
+ "#u = A*e Matric multiplication \n",
+ "A = np.array([[0.8,-0.6],[0.8,0.6]]) #The matrix form of A\n",
+ "F = np.array([[f_1],[f_2]])\n",
+ "P = np.dot((A.T),F) #Nodal forces matrix\n",
+ "print \"b) The vertical component of the nodal force is\",P[1],\"\"\n",
+ "print \"b) The vertical component of the nodal force is\",P[0],\"\"\n",
+ "#Part A\n",
+ "#F_1 = (5/8.0)*P_1 - (5/6.0)*p_2 , From statics\n",
+ "#F_1 = (5/8.0)*P_1 + (5/6.0)*p_2\n",
+ "#F = BP ,Matric multiplication \n",
+ "B = np.array([[(5/8.0),-(5/6.0)],[(5/8.0),(5/6.0)]]) #The matrix form of A\n",
+ "U = np.array([[u_1],[u_2]])\n",
+ "e = P = np.dot((B.T),U) #L/AE, Nodal forces matrix\n",
+ "print \"a) The components of displacement of point B are\",round(e[0],2),\"L/AE and\",round(e[1],2),\"L/AE\" \n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.10 page number 667"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The deflection is 0.018 in\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "A_1 = 0.125 #in2 , The area of the crossection of AB\n",
+ "A_2 = 0.219 #in2 , The area of the crossection of BC\n",
+ "l_1 = 3*(5**0.5) #in , The length of AB\n",
+ "l_2 = 6*(2**0.5) #in , The length of BC\n",
+ "p = 3 #k , Force acting on the system \n",
+ "E = 10.6*(10**3) #Ksi - youngs modulus of the material\n",
+ "p_1 = (5**0.5)*p/3 #P, The component of p on AB\n",
+ "p_2 = -2*(2**0.5)*p/3 #P, The component of p on AB\n",
+ "\n",
+ "e = p_1*l_1*p_1/(p*E*A_1) + p_2*l_2*p_2/(p*E*A_2) #in, By virtual deflection method \n",
+ "print \"The deflection is\",round(e,3),\"in\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter13_3.ipynb b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter13_3.ipynb
new file mode 100644
index 00000000..ba422425
--- /dev/null
+++ b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter13_3.ipynb
@@ -0,0 +1,226 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 13: Statically Indeterminate Problems"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.2 page number 693"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a) The maximum displacement in y direction is -0.208333333333 W(l**4)/EI \n",
+ "a) The maximum deflection occured at 1.0 L\n",
+ "The reaction at the mid of the bar 1.25 WL\n"
+ ]
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEACAYAAABCl1qQAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAA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+zqPOmvhqqbw5099eBtmaW6J6PbBe6LNx9kbt/HEy+DpyQ\n5hrTpSHrBcBY4A/AB+ksLs0asiz+D/CMu28BcPcdaa4xXRqyLP4OHBmMHwl86FXnVpsVd3+ZqqtJ\n69Lo7Wamh0VDbupL1KY5biQbe4PjvwLPH9SKohO6LMysM1Ubil8Gs5rrybmGrBc9gPZmtsDM3jSz\na9JWXXo1ZFk8DJxqZluBt4Gb0lRbpmn0djOVS2fToaF/4LUvoW2OG4YGvyczOx+4FvjawSsnUg1Z\nFvcDE9zdg5s7m+tl1g1ZFq2A04FvAG2ARWa22N3XHdTK0q8hy+J2YJm7x8wsHyg2s77u/slBri0T\nNWq7melh8T7QpcZ0F6oSsL42JwTzmpuGLAuCk9oPAwXuXt9uaDZryLI4A3gq+BKAY4CLzGyfu89J\nT4lp05BlsRnY4e57gb1mthDoCzS3sGjIsjgHuBvA3TeY2UbgZKruCcsljd5uZvphqOqb+szsUKpu\n6qv9xz4H+B6AmQ0AdvkX31nVnIQuCzPrCvwRuNrd10dQY7qELgt3/yd3P8ndT6LqvMWNzTAooGF/\nI38CzjWzFmbWhqoTms3xSzobsixKgAsBgmP0J1P1paW5ptHbzYzes3D3cjPbf1NfC+BRd19tZjcE\nj//K3Z83s2+a2XrgM2B0hCUfNA1ZFsBdQDvgl8H/qPe5+1lR1XywNHBZ5IQG/o2UmNkLwHKgEnjY\n3ZtdWDRwvfgvYJaZvU3Vf5ZvdfePIiv6IDGz3wHnAccENz9PoupwZNLbTd2UJyIioTL9MJSIiGQA\nhYWIiIRSWIiISCiFhYiIhFJYiIhIKIWFiIiEUliIiEgohYWIiIT6/7BdkkWCzUoQAAAAAElFTkSu\nQmCC\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0x7fad208>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "b)The above graph is beam displacement graph\n",
+ "b)The minimum occures in the middle from the above graph \n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "#First we will solve without the reaction at middle\n",
+ "#Given\n",
+ "import numpy\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "l_ab = 1.0 #2L in - The length of the beam\n",
+ "F_D = 1.0 #W lb/in - The force distribution \n",
+ "F = F_D*l_ab #WL - The force applied\n",
+ "#Beause of symmetry the moment caliculations can be neglected\n",
+ "#F_Y = 0\n",
+ "R_A = F/2 #wl - The reactive force at A\n",
+ "R_B = F/2 #wl - The reactive force at B\n",
+ "#EI - The flxure rigidity is constant and 1/EI =1 # k\n",
+ "\n",
+ "#part - A\n",
+ "#section 1--1\n",
+ "l_1 = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] #L taking each section at 0.2L distance \n",
+ "M_1 = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "v = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "for i in range(10):\n",
+ " v[i] = R_A - F_D*l_1[i] \n",
+ " M_1[i] = R_A*l_1[i] - F_D*(l_1[i]**2)/2\n",
+ "# (EI)y'' = M_1[i] we will integrate M_1[i] twice where variable is l_1[i]\n",
+ "#(EI)y'- \n",
+ "\n",
+ "M_1_intg1 = R_A*(l_1[i]**2)/4 - F_D*(l_1[i]**3)/6 - F_D*(l_ab**3)*l_1[i]/24 #integration of x**n = x**n+1/n+1\n",
+ "#(EI)y- Using end conditions for caliculating constants \n",
+ "\n",
+ "M_1_intg2 = R_A*(l_1[i]**3)/12.0 - F_D*(l_1[i]**4)/24.0 + F_D*(l_ab**3)*l_1[i]/24.0 \n",
+ "#Equations \n",
+ "\n",
+ "l_1 = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] #L taking each section at 0.2L distance \n",
+ "M_1_intg2 = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "Y = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "for i in range(10):\n",
+ " M_1_intg2[i] = (l_1[i]**3)/12.0 - (l_1[i]**4)/24.0 - l_1[i]/24.0 # discluding every term for ruling out float values\n",
+ " Y[i] = M_1_intg2[i] #W(l**4)/EI k = 1/EI\n",
+ "Y_min = 16*min(Y)\n",
+ "print \"a) The maximum displacement in y direction is\",16*min(Y),\"W(l**4)/EI \"\n",
+ "print \"a) The maximum deflection occured at\",2*l_1[Y.index(min(Y))],\"L\"\n",
+ "f_bb = 2**3/48.0 #l**3/EI - flexibility coefficient\n",
+ "Reac = - Y_min/f_bb #WL , The reaction at the mid of the bar\n",
+ "print \"The reaction at the mid of the bar\",Reac ,\"WL\"\n",
+ "\n",
+ "#Graphs \n",
+ "Y.extend(Y) #Because of symmetry\n",
+ "values = Y \n",
+ "y = np.array(values)\n",
+ "t = np.linspace(0,1,22)\n",
+ "poly_coeff = np.polyfit(t, y, 2)\n",
+ "\n",
+ "plt.plot(t, y, 'o')\n",
+ "plt.plot(t, np.poly1d(poly_coeff)(t), '-')\n",
+ "plt.show()\n",
+ "print \"b)The above graph is beam displacement graph\"\n",
+ "print \"b)The minimum occures in the middle from the above graph \"\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.3 page number 694 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The reactive moment at A i.e M_A -0.0714285714286 WL**2\n",
+ "The reactive force at A i.e R_A -1.14285714286 WL\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "#First we will solve without the reaction at middle\n",
+ "#Given\n",
+ "import numpy as np\n",
+ "l_ab = 1.0 #2L in - The length of the beam\n",
+ "F_D = 1.0 #W lb/in - The force distribution \n",
+ "F = F_D*l_ab #WL - The force applied\n",
+ "#Beause of symmetry the moment caliculations can be neglected\n",
+ "#F_Y = 0\n",
+ "R_A = F/2 #wl - The reactive force at A\n",
+ "R_B = F/2 #wl - The reactive force at B\n",
+ "#EI - The flxure rigidity is constant and 1/EI =1 # k\n",
+ "\n",
+ "#part - A\n",
+ "#section 1--1\n",
+ "l_1 = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] #L taking each section at 0.2L distance \n",
+ "M_1 = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "v = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "for i in range(10):\n",
+ " v[i] = R_A - F_D*l_1[i] \n",
+ " M_1[i] = R_A*l_1[i] - F_D*(l_1[i]**2)/2\n",
+ "# (EI)y'' = M_1[i] we will integrate M_1[i] twice where variable is l_1[i]\n",
+ "#(EI)y'- \n",
+ "\n",
+ "M_1_intg1 = R_A*(l_1[i]**2)/4 - F_D*(l_1[i]**3)/6 - F_D*(l_ab**3)*l_1[i]/24 #integration of x**n = x**n+1/n+1\n",
+ "#(EI)y- Using end conditions for caliculating constants \n",
+ "\n",
+ "M_1_intg2 = R_A*(l_1[i]**3)/12.0 - F_D*(l_1[i]**4)/24.0 + F_D*(l_ab**3)*l_1[i]/24.0 \n",
+ "#Equations \n",
+ "\n",
+ "l_1 = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] #L taking each section at 0.2L distance \n",
+ "M_1_intg2 = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "Y = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "for i in range(10):\n",
+ " M_1_intg2[i] = (l_1[i]**3)/12.0 - (l_1[i]**4)/24.0 - l_1[i]/24.0 # discluding every term for ruling out float values\n",
+ " Y[i] = M_1_intg2[i] #W(l**4)/EI k = 1/EI\n",
+ "e_1 = 16*min(Y) #WL4/EI - The maximum defection \n",
+ "e_2 = - F_D*((2*l_ab)**3)/24.0 #WL3/EI - The maximum angle\n",
+ "#Caliculating for momentum and force\n",
+ "f_ab = ((2*l_ab)**2)/16.0 #L2/EI \n",
+ "f_bb = ((2*l_ab)**3)/48.0 #L3/EI \n",
+ "f_aa = 2*l_ab/3.0 #L/EI\n",
+ "f_ba = ((l_ab)**2)/4.0 #L2/EI\n",
+ "#F*X = e - Matrix multiplication \n",
+ "#Solving for X\n",
+ "a = np.array([[f_aa,f_ba], [f_ba,f_bb]])\n",
+ "b = np.array([e_2,e_1])\n",
+ "x = np.linalg.solve(a, b)\n",
+ "print \"The reactive moment at A i.e M_A\",x[0],\"WL**2\"\n",
+ "print \"The reactive force at A i.e R_A\",x[1],\"WL\"\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "#Given \n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter2_4.ipynb b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter2_4.ipynb
new file mode 100644
index 00000000..8e0b7419
--- /dev/null
+++ b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter2_4.ipynb
@@ -0,0 +1,334 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 2:Axial strains and Deformations in bars "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.1 page number 77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 77,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The total deflection is : 1.0 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "l_ob = 2000 #mm - length of rod ob\n",
+ "l_bc = 1000 #mm - length of rod bc\n",
+ "l_cd = 1500 #mm - length of rod cd\n",
+ "p_ob = 100 #kN - Force in rods \n",
+ "p_bc = -150 #KN\n",
+ "p_cd = 50 #KN \n",
+ "A_ob = 1000 #mm2 - Area of rod ob\n",
+ "A_bc = 2000 #mm2 - Area of rod bc \n",
+ "A_cd = 1000 #mm2 - Area of rod cd\n",
+ "E = 200.0 #GPA \n",
+ "# the total deflection is algebraic sums of `deflection in each module \n",
+ "e_1 = p_ob*l_ob/(A_ob*E)\n",
+ "e_2 = p_bc*l_bc/(A_bc*E)\n",
+ "e_3 = p_cd*l_cd/(A_cd*E)\n",
+ "#All units are satisfied \n",
+ "e_total = e_1+ e_2 + e_3\n",
+ "print \"The total deflection is :\",round(e_total,3) ,\"mm\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.4 page number 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 36,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "0.0112677358491\n",
+ "The vertical stiffness of the combination is 113.14 kips/inch\n"
+ ]
+ }
+ ],
+ "source": [
+ "p_app = 3 #Kips - applied force \n",
+ "P_A = 2.23 #Kips \n",
+ "p_B = -2.83 #kips - compressive force\n",
+ "l_ab = 6.71 #inch\n",
+ "l_bc = 8.29 #inch\n",
+ "s_ab = 17.8 #ksi - tensile stress\n",
+ "s_bc = -12.9 #ksi - compressive stress\n",
+ "E = 10.6 * pow(10,3) #ksi -youngs modulus \n",
+ "e_ab = s_ab*l_ab/E\n",
+ "\n",
+ "e_bc = s_bc*l_bc/E\n",
+ "x = e_ab/e_bc #the Ratio of cosines of the deflected angles \n",
+ "# t_1 and t_2 be deflected angles \n",
+ "#t_2 = 180-45-26.6-t_1 the sum of angles is 360\n",
+ "#t_1 = 52.2 degress\n",
+ "import math\n",
+ "e = e_ab/math.acos(math.radians(52.2)) #inch\n",
+ "k = p_app/e # kips/in vertical stiffness of the combination\n",
+ "print \"The vertical stiffness of the combination is\",round(k,3),\"kips/inch\"\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.6 page number 83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The lateral strain is: 0.00243 no units\n",
+ "The longitudinal strain is: 0.00073 no units\n",
+ "The poissions ratio is: 3.32876712329 no units\n",
+ "Youngs modulus: 69.8 N/mm2\n"
+ ]
+ }
+ ],
+ "source": [
+ "dia = 50 #mm - diameter of aluminium \n",
+ "p = 100 # KN - instant force applid\n",
+ "dia_c = 0.1215 #mm- change in diameter \n",
+ "l_c = 0.219 #mm - change in length\n",
+ "l = 300 #mm - length \n",
+ "strain_dia = dia_c/dia # lateral strain \n",
+ "strain_l = l_c/l #longitudinal strain \n",
+ "po = strain_dia/strain_l # poission ratio \n",
+ "area = 3.14*dia*dia/4 #mm2 area\n",
+ "E = p*l/(area*l_c) #N/mm2 youngs modulus \n",
+ "print \"The lateral strain is:\",strain_dia,\"no units\"\n",
+ "print \"The longitudinal strain is:\",strain_l,\"no units\"\n",
+ "print \"The poissions ratio is:\",po,\"no units\"\n",
+ "print \"Youngs modulus:\",round(E,2),\"N/mm2\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7 page number 86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The displacement in point B is : 0.00795578950395 in\n"
+ ]
+ }
+ ],
+ "source": [
+ "T = 12.9*pow(10,-6) #/F\n",
+ "t = 100.00 # F \n",
+ "l_ab = 6.71 #inch\n",
+ "l_bc = 8.29 #inch\n",
+ "e_ab = T*t*l_ab #in-elongation \n",
+ "e_bc = T*t*l_bc #in-elongation\n",
+ "k = e_ab/e_bc # ratio of cosines of deflected angles \n",
+ "# t_1 and t_2 be deflected angles \n",
+ "#t_2 = 180-45-26.6-t_1 the sum of angles is 360\n",
+ "t_1 = 26.6\n",
+ "import math\n",
+ "e = e_ab/math.acos(math.radians(26.6))\n",
+ "print \"The displacement in point B is :\",e ,\"in\"\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.11 page number "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum stress is: 3.59377281766 Mpa\n"
+ ]
+ }
+ ],
+ "source": [
+ "mass = 4 #kg \n",
+ "dist = 1 #mt freely falling distance\n",
+ "l = 1500 #mm length of rod\n",
+ "d = 15 #mm diameter\n",
+ "l_ab = 6.71 #inch\n",
+ "l_bc = 8.29 #inch\n",
+ "E = 200 #GPA youngs modulus \n",
+ "k = 4.5 # N/mm stiffness costant\n",
+ "F = mass*9.81# The force applying\n",
+ "Area = 3.14*(d**2)/4 \n",
+ "# Two cases \n",
+ "#youngs modulus \n",
+ "e_y = F*l/(Area*E*pow(10,3))\n",
+ "# stiffness\n",
+ "e_f = F/k \n",
+ "#total\n",
+ "e = e_y +e_f\n",
+ "k = 1+(2/(e*pow(10,-3)))\n",
+ "stress_max_1 = F*(1+pow(k,0.5))/Area\n",
+ "print \"The maximum stress is:\",stress_max_1,\"Mpa\"\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.12 page number 103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 75,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The reactions at bottom is -1.25 p\n"
+ ]
+ }
+ ],
+ "source": [
+ "flex_a = 1#f\n",
+ "flex_b = 2#f\n",
+ "#removing lower support and solving FBD\n",
+ "e = -2 -(2+1)#fp\n",
+ "#e_1 = (2+1+1)*R\n",
+ "#e_1 = -e Making the elongations zero since the both ends are fixed\n",
+ "R = e/(2+1+1.0) #p\n",
+ "print \"The reactions at bottom is\",R,\"p\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.19 page number 113"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The end deflection is 0.12 in\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "l = 30 #in - The length of the rod\n",
+ "p_1 = 80 #kips - The Force on the end\n",
+ "p_2 = 125 #kips - The force on the other end\n",
+ "A_s = 0.5 #in2 - The crossection of the steel rod\n",
+ "A_a = 0.5 #in2 - The crossection of the aluminium \n",
+ "E_a = 10*(10**6) #psi - The youngs modulus of the aluminium \n",
+ "E_s = 30*(10**6) #psi - The youngs modulus of the steel\n",
+ "#Internally stastically indeterminant \n",
+ "p_a = p_1/4 #From solving we get p_s = 3*P_a\n",
+ "#From material properties point of view \n",
+ "#stress_steel = stress_aluminium\n",
+ "e = p_a*l*(10**3)/(A_a*E_a) #The end deflection \n",
+ "print \"The end deflection is\",e,\"in\"\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter4_4.ipynb b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter4_4.ipynb
new file mode 100644
index 00000000..579a922d
--- /dev/null
+++ b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter4_4.ipynb
@@ -0,0 +1,448 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4:Torsion"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.2 page number 183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " The maximum shear due to torsion is 152.87 Mpa\n",
+ "stress tensor matrix [[ 0. 152.9 0. ]\n",
+ " [ 152.9 0. 0. ]\n",
+ " [ 0. 0. 0. ]]\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "dia = 10 #diameter of shaft(A-C)\n",
+ "c = dia/2 #mm - Radius\n",
+ "T = 30 #N/mm -Torque in the shaft \n",
+ "#Caliculations\n",
+ "\n",
+ "J = 3.14*(dia**4)/32 #mm4\n",
+ "shear_T = T*c*pow(10,3)/J # The torsion shear in the shaft AC\n",
+ "import numpy as np \n",
+ "print \"The maximum shear due to torsion is \",round(shear_T,2),\"Mpa\"\n",
+ "arr_T = np.zeros((3,3))\n",
+ "arr_T[0][1]=round(shear_T,1) #arranging the elements in array\n",
+ "arr_T[1][0]=round(shear_T,1)\n",
+ "print \"stress tensor matrix\",(arr_T),\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.3 page number 184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum shear due to torsion is 43.15 Mpa\n",
+ "The minimum shear due to torsion is 34.52 Mpa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "dia_out = 20 #mm- outer diameter of shaft\n",
+ "dia_in = 16 #mm- inner diameter of shaft \n",
+ "c_out = dia_out/2 #mm - outer Radius of shaft \n",
+ "c_in = dia_in/2 #mm - inner radius of shaft \n",
+ "T = 40 #N/mm -Torque in the shaft \n",
+ "#caliculations\n",
+ "\n",
+ "J = 3.14*((dia_out**4)- (dia_in**4))/32 #mm4\n",
+ "shear_T_max = T*c_out*pow(10,3)/J # The maximum torsion shear in the shaft\n",
+ "shear_T_min = T*c_in*pow(10,3)/J # The maximum torsion shear in the shaft\n",
+ "print \"The maximum shear due to torsion is \",round(shear_T_max,2),\"Mpa\"\n",
+ "print \"The minimum shear due to torsion is \",round(shear_T_min,2),\"Mpa\"\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4 page number 187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The Diameter of the shaft used is 15.26 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "hp = 10 # horse power of motor \n",
+ "f = 30 # given \n",
+ "shear_T = 55 #Mpa - The maximum shearing in the shaft \n",
+ "#caliculations\n",
+ "\n",
+ "T = 119*hp/f # N.m The torsion in the shaft \n",
+ "#j/c=T/shear_T=K\n",
+ "k = T*pow(10,3)/shear_T #mm3\n",
+ "#c3=2K/3.14\n",
+ "c = pow((2*k/3),0.33) #mm - The radius of the shaft \n",
+ "diamter = 2*c #mm - The diameter of the shaft\n",
+ "print \"The Diameter of the shaft used is\",round(diamter,2),\"mm\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.5 page number 188"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The Diameter of the shaft1 is 6.87 mm\n",
+ "The Diameter of the shaft2 is 0.702590481015 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "hp = 200 #Horse power\n",
+ "stress_sh = 10000 #psi- shear stress\n",
+ "rpm_1 = 20.0 # The rpm at which this shaft1 operates \n",
+ "rpm_2 = 20000.0 # The rpm at which this shaft2 operates\n",
+ "T_1= hp*63000.0/rpm_1 #in-lb Torsion due to rpm1\n",
+ "T_2= hp*63000/rpm_2 #in-lb Torsion due to rpm1\n",
+ "#caliculations \n",
+ "\n",
+ "#j/c=T/shear_T=K\n",
+ "k_1= T_1/stress_sh #mm3\n",
+ "#c3=2K/3.14\n",
+ "c_1= pow((2*k_1/3),0.33) #mm - The radius of the shaft \n",
+ "diamter_1 = 2*c_1 #mm - The diameter of the shaft\n",
+ "print \"The Diameter of the shaft1 is\",round(diamter_1,2),\"mm\"\n",
+ "\n",
+ "#j/c=T/shear_T=K\n",
+ "k_2= T_2/stress_sh #mm3\n",
+ "#c3=2K/3.14\n",
+ "c_2= pow((2*k_2/3),0.33) #mm - The radius of the shaft \n",
+ "diamter_2 = 2*c_2 #mm - The diameter of the shaft\n",
+ "print \"The Diameter of the shaft2 is\",diamter_2,\"mm\"\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.7 page number 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum angle rotated is 0.0232628450106 radians \n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "T_ab = 0 #N.m - torsion in AB \n",
+ "T_bc = 150 #N.m - torsion in BC\n",
+ "T_cd = 150 #N.m - torsion in CD\n",
+ "T_de = 1150 #N.m - torsion in DE\n",
+ "l_ab = 250 #mm - length of AB\n",
+ "l_bc = 200 #mm - length of BC\n",
+ "l_cd = 300 #mm - length of cd \n",
+ "l_de = 500.0 #mm - length of de\n",
+ "d_1 = 25 #mm - outer diameter \n",
+ "d_2 = 50 #mm - inner diameter\n",
+ "G = 80 #Gpa -shear modulus\n",
+ "#Caliculations \n",
+ "\n",
+ "J_ab = 3.14*(d_1**4)/32 #mm4\n",
+ "J_bc = 3.14*(d_1**4)/32 #mm4\n",
+ "J_cd = 3.14*(d_2**4 - d_1**4)/32 #mm4\n",
+ "J_de = 3.14*(d_2**4 - d_1**4)/32 #mm4\n",
+ "rad = T_ab*l_ab/(J_ab*G)+ T_bc*l_bc/(J_bc*G)+ T_cd*l_cd/(J_cd*G)+ T_de*l_de/(J_de*G) # adding the maximum radians roteted in each module\n",
+ "print \"The maximum angle rotated is \",rad,\"radians \" "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.9 Pagenumber 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 39,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The Torsion at rigid end A is -141.72 N-m\n",
+ "The Torsion at rigid end B is 1291.72 N-m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given \n",
+ "#its a statistally indeterminant \n",
+ "#we will take of one of the support \n",
+ "#Given \n",
+ "T_ab = 0 #N.m - torsion in AB \n",
+ "T_bc = 150 #N.m - torsion in BC\n",
+ "T_cd = 150 #N.m - torsion in CD\n",
+ "T_de = 1150 #N.m - torsion in DE\n",
+ "l_ab = 250 #mm - length of AB\n",
+ "l_bc = 200 #mm - length of BC\n",
+ "l_cd = 300 #mm - length of cd \n",
+ "l_de = 500.0#mm - length of de\n",
+ "d_1 = 25 #mm - outer diameter \n",
+ "d_2 = 50 #mm - inner diameter\n",
+ "#Caliculations \n",
+ "\n",
+ "J_ab = 3.14*(d_1**4)/32 #mm4\n",
+ "J_bc = 3.14*(d_1**4)/32 #mm4\n",
+ "J_cd = 3.14*(d_2**4 - d_1**4)/32 #mm4\n",
+ "J_de = 3.14*(d_2**4 - d_1**4)/32 #mm4\n",
+ "G = 80 #Gpa -shear modulus\n",
+ "rad = T_ab*l_ab/(J_ab*G)+ T_bc*l_bc/(J_bc*G)+ T_cd*l_cd/(J_cd*G)+ T_de*l_de/(J_de*G) \n",
+ "#now lets consider T_A then the torsion is only T_A\n",
+ "# T_A*(l_ab/(J_ab*G)+ l_bc/(J_bc*G)+ l_cd/(J_cd*G)+ l_de/(J_de*G)) +rad = 0\n",
+ "# since there will be no displacement \n",
+ "T_A =-rad/(l_ab/(J_ab*G)+ l_bc/(J_bc*G)+ l_cd/(J_cd*G)+ l_de/(J_de*G)) #Torsion at A\n",
+ "T_B = 1150 - T_A #n-m F_X = 0 torsion at B\n",
+ "print \"The Torsion at rigid end A is\",round(T_A,2),\"N-m\"\n",
+ "print \"The Torsion at rigid end B is\",round(T_B,2),\"N-m\"\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.12 Pagenumber 202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 49,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The allowable torsion on the 8 bolt combination 27129600.0 N-m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "dai_bc = 240 #mm- daimeter of '8'bolt circle \n",
+ "dia = dai_bc/8 #Diameter of each bolt\n",
+ "A = 0.25*(dia**2)*3.14 # Area of a bolt\n",
+ "S_allow = 40 #Mpa - The maximum allowable allowable shear stress \n",
+ "P_max = (S_allow)*A #N - The maximum allowable force \n",
+ "D = 120.0 #mm - the distance from central axis \n",
+ "T_allow =P_max*D*8 #N-m The allowable torsion on the 8 bolt combination \n",
+ "print \"The allowable torsion on the 8 bolt combination\",T_allow ,\"N-m\"\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.15 page number 211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 57,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the Equivalent Torsion constant is 1.97 in4\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "#AISC MANUALS\n",
+ "#approximated by three narrow tubes \n",
+ "#J = Bbt^3\n",
+ "B = 0.33 # constant mentiones in AISC\n",
+ "#three rods \n",
+ "\n",
+ "#rod_1\n",
+ "t_1 = 0.605 #inch - Thickness \n",
+ "b = 12.0 #inches - width \n",
+ "J_1 = B*b*(t_1**3) #in4 - Torsion constant \n",
+ "\n",
+ "#rod_2\n",
+ "t_2 = 0.605 #inch - Thickness \n",
+ "b = 12 #inches - width \n",
+ "J_2 = B*b*(t_2**3) #in4 - Torsion constant \n",
+ "\n",
+ "#rod_3\n",
+ "t_3 = 0.390 #inch - Thickness \n",
+ "b = 10.91 #inches - width \n",
+ "J_3 = B*b*(t_3**3) #in4 - Torsion constant \n",
+ "\n",
+ "#Equivalent\n",
+ "J_eq = J_1+J_2+J_3 #in4 - Torsion constant \n",
+ "print \"the Equivalent Torsion constant is \",round(J_eq,2), \"in4\"\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.16 page number 214"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 58,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum shear due to torsion is 345.23 Mpa\n",
+ "The minimum shear due to torsion is 276.18 Mpa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "dia_out = 10 #mm- outer diameter of shaft\n",
+ "dia_in = 8 #mm- inner diameter of shaft \n",
+ "c_out = dia_out/2 #mm - outer Radius of shaft \n",
+ "c_in = dia_in/2 #mm - inner radius of shaft \n",
+ "T = 40 #N/mm -Torque in the shaft \n",
+ "#caliculations\n",
+ "\n",
+ "J = 3.14*((dia_out**4)- (dia_in**4))/32 #mm4\n",
+ "shear_T_max = T*c_out*pow(10,3)/J # The maximum torsion shear in the shaft\n",
+ "shear_T_min = T*c_in*pow(10,3)/J # The maximum torsion shear in the shaft\n",
+ "print \"The maximum shear due to torsion is \",round(shear_T_max,2),\"Mpa\"\n",
+ "print \"The minimum shear due to torsion is \",round(shear_T_min,2),\"Mpa\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter5_4.ipynb b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter5_4.ipynb
new file mode 100644
index 00000000..33ed9874
--- /dev/null
+++ b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter5_4.ipynb
@@ -0,0 +1,883 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Chapter 5:Axial force, Shear and Bending moment "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example5.2 pagenumber 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The X,Y components of reaction force at A is 0 , -410.0 N\n",
+ "The X,Y components of reaction force at B is 0 , 670.0 N\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "L_ab = 0.4 #mt The total length of the rod\n",
+ "M = 200 #N_m - the moment acting on rod\n",
+ "l_1 = 0.1 #mt -moment acting point the distance from 'a'\n",
+ "R_1 = 100 #N - The Force acting \n",
+ "l_2 = 0.2 #mt -R_1 acting point the distance from 'a'\n",
+ "R_2 = 160 #N The Force acting \n",
+ "l_3 = 0.3 #mt -R_2 acting point the distance from 'a'\n",
+ "#caliculations\n",
+ "\n",
+ "#F_X = 0 forces in x directions \n",
+ "R_A_X = 0 # since there are no forces in X-direction \n",
+ "R_B_X = 0\n",
+ "#M_A = 0 momentum at point a is zero\n",
+ "\n",
+ "# M + R_1*l_2 + R_2*l_3 = R_B*L_ab *the moment for a force is FxL\n",
+ "R_B_Y = (M + R_1*l_2 + R_2*l_3)/L_ab\n",
+ "\n",
+ "#M_B= 0 momentum at point b is zero\n",
+ "# R_A_Y*L_ab + M - R_1*l_2 - R_2*0.1 = 0\n",
+ "\n",
+ "R_A_Y = -(M - R_1*l_2 - R_2*0.1)/L_ab\n",
+ " \n",
+ "print \"The X,Y components of reaction force at A is \",R_A_X,\",\",R_A_Y,\"N\"\n",
+ "print \"The X,Y components of reaction force at B is \",R_B_X,\",\",R_B_Y,\"N\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.2 page number 233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The X,Y components of reaction force at A is 0 , -9.0 N\n",
+ "The X,Y components of reaction force at B is 0 , 6.0 N\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "P_Max = 10 #N - the maximum distribution in a triangular distribution\n",
+ "L = 3 #mt the total length of force distribution \n",
+ "L_X = 5 #mt - the horizantal length of the rod\n",
+ "#caliculations \n",
+ "\n",
+ "F_y = P_Max*L*0.5 #N - The force due to triangular distribition \n",
+ "L_com = 2*L /3 #mt - the resultant force acting as a result of distribution acting position \n",
+ "#F_X = 0 forces in x directions\n",
+ "R_A_X = 0 # since there are no forces in X-direction\n",
+ "R_B_X = 0\n",
+ "#M_A = 0 momentum at point a is zero\n",
+ "#F_y*L_com - R_B_Y*L_X = 0\n",
+ "R_B_Y = F_y*L_com/L_X\n",
+ "\n",
+ "#M_B= 0 momentum at point b is zero\n",
+ "#- R_A_Y*L_X = F_y*(L_X-L )\n",
+ "\n",
+ "R_A_Y = - F_y*L/L_X \n",
+ "print \"The X,Y components of reaction force at A is \",R_A_X,\",\",R_A_Y,\"N\"\n",
+ "print \"The X,Y components of reaction force at B is \",R_B_X,\",\",R_B_Y,\"N\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.3 page number 233 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The X,Y components and resultant of reaction force at A is 4 , 3 , 5.0 N\n",
+ "The X,Y components and resultant of reaction force at B is 1 , 1 , 1.41 N\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "F = 5 #K - force acting on the system\n",
+ "tan = (4/3) # the Tan of the angle of force with x axis\n",
+ "l_ab = 12 #inch - the total length of ab \n",
+ "l = 3 # inch - Distance from 'a'\n",
+ "#caliculation\n",
+ "F_X = 4 #K\n",
+ "F_Y = 3 #k\n",
+ "\n",
+ "#M_A = 0 momentum at point a is zero\n",
+ "# F_X*l- R_B_Y*l_ab = 0 \n",
+ "R_B_Y = F_X*l/l_ab\n",
+ "\n",
+ "#M_B= 0 momentum at point b is zero\n",
+ "# R_A_Y*l_ab - F_X*(l_ab - l)\n",
+ "R_A_Y = F_X*(l_ab - l)/l_ab\n",
+ " \n",
+ "#F_X = 0 forces in x directions\n",
+ "R_A_X = F_Y + R_B_Y \n",
+ "R_B_X = R_B_Y # since the angle is 45 degrees\n",
+ "\n",
+ "#resultants \n",
+ "R_A = pow(R_A_X**2 + R_A_Y**2,0.5)\n",
+ "R_B = pow(R_B_X**2 + R_B_Y**2,0.5)\n",
+ "\n",
+ "print \"The X,Y components and resultant of reaction force at A is \",R_A_X,\",\",R_A_Y,\",\",R_A,\"N\"\n",
+ "print \"The X,Y components and resultant of reaction force at B is \",R_B_X,\",\",R_B_Y,\",\",round(R_B,2),\"N\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.4 page number 239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The force and moment in section a--a are -2.33 KN , -13.644 KN-m\n",
+ "The force and moment in section b--b are 6.0 KN , 6.0 KN-m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "P_Max = 10 #N - the maximum distribution in a triangular distribution\n",
+ "L = 3 #mt the total length of force distribution \n",
+ "L_X = 5 #mt - the horizantal length of the rod\n",
+ "#caliculations \n",
+ "\n",
+ "F_y = P_Max*L*0.5 #N - The force due to triangular distribition \n",
+ "L_com = 2*L /3 #mt - the resultant force acting as a result of distribution acting position \n",
+ "#F_X = 0 forces in x directions\n",
+ "R_A_X = 0 # since there are no forces in X-direction\n",
+ "R_B_X = 0\n",
+ "#M_A = 0 momentum at point a is zero\n",
+ "#F_y*L_com - R_B_Y*L_X = 0\n",
+ "R_B_Y = F_y*L_com/L_X\n",
+ "\n",
+ "#M_B= 0 momentum at point b is zero\n",
+ "#- R_A_Y*L_X = F_y*(L_X-L )\n",
+ "\n",
+ "R_A_Y = - F_y*L/L_X\n",
+ "\n",
+ "#For a---a section \n",
+ "l_a = 2 #mt - a---a section from a \n",
+ "l_com_a = 2*l_a/3\n",
+ "v_a = R_A_Y + 0.5*l_a*(10.0*2/3) #*(10*2/3) because the maximum moves\n",
+ "\n",
+ "M_a = (10.0*0.66)*l_a*(0.33) + R_A_Y*l_a \n",
+ "\n",
+ "#For b---b section \n",
+ "\n",
+ "v_b = F_y + R_A_Y #equilabrium conditions\n",
+ "M_b = (F_y + R_A_Y)*(-1)\n",
+ "\n",
+ "print \"The force and moment in section a--a are\",round(v_a,2),\"KN ,\",M_a,\"KN-m\"\n",
+ "print \"The force and moment in section b--b are\",v_b,\"KN ,\",M_b,\"KN-m\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.5 page number 241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Given problem is for drawing diagram, this diagram is drawn by step by step manner. \n"
+ ]
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEhCAYAAACQrrywAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAI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kkaUzynZdKuCfidpEWk5Ysbui+G1S5PNJuZWYkrBTMzK3FSMDOzEicFMzMrcVIwM7MSJwUzMytx\nUjAzsxInBTMzK3FSMDOzkv8PlVM9sSzz1iEAAAAASUVORK5CYII=\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0x41889b0>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "#Lets divide the section into two sections \n",
+ "l_ac = 10 # ft -The total length of the rod\n",
+ "R = 5 #k - The applies force at c\n",
+ "tan = 4/3 # The tan of the angle of the force \n",
+ "l_ab = 5 #ft - The distance of applied force from A\n",
+ "R_y = 4 #k,downwards X- component of the force\n",
+ "R_X = 3 #k Y- component of the force , lets consider only Y direction since we are concentrating on the Shears \n",
+ "\n",
+ "#F_Y = 0 forces in Y directions\n",
+ "#R_A +R_B = R_y\n",
+ "#M_c = 0 making the moment zero at point c \n",
+ "#Caliculations \n",
+ "# R_A= R_B*(l_ac - l_ab)/(l_ab) so R_A = R_B\n",
+ "\n",
+ "R_A = R_y/2 #F_Y = 0\n",
+ "R_B = R_y/2\n",
+ "#considering section x--x\n",
+ "l_x = 2 #ft - length of section from A\n",
+ "v_x = R_A #k ,F_X = 0 \n",
+ "M_x = R_A*l_x #k-ft M_c = 0\n",
+ "\n",
+ "#considering section at midpoint t--t\n",
+ "l_t = 2 #ft - length of section from A\n",
+ "v_t = 0 #k ,F_X = 0 \n",
+ "M_t = (R_A)*l_t #k-ft M_c = 0\n",
+ "\n",
+ "##considering section y---y\n",
+ "l_y = 2 #ft - length of section from B\n",
+ "v_y = - R_B #k ,F_X = 0 \n",
+ "M_y = R_B*l_y #k-ft M_c = 0\n",
+ "\n",
+ "#Graph\n",
+ "%matplotlib inline\n",
+ "import math \n",
+ "from matplotlib.pyplot import plot,suptitle,xlabel,ylabel\n",
+ "#Drawing of shear and bending moment diagram\n",
+ "print \"Given problem is for drawing diagram, this diagram is drawn by step by step manner. \"\n",
+ "X = [0,2,4.9999999999999,5,5.00000000000000001,7,10] # For graph precision \n",
+ "\n",
+ "V = [R_A,v_x,v_x,v_t,v_y,v_y,-R_B];\t\t\t#Shear matrix\n",
+ "M = [0,M_x,M_t,M_t,M_t,M_y,0];\t\t\t#Bending moment matrix\n",
+ "plot(X,V);\t\t\t#Shear diagram\n",
+ "plot(X,M,'r');\t\t\t#Bending moment diagram\n",
+ "suptitle( 'Shear and bending moment diagram')\n",
+ "xlabel('X axis')\n",
+ "ylabel( 'Y axis') ;"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.6 pagenumber 243 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Given problem is for drawing diagram, this diagram is drawn by step by step manner. \n"
+ ]
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAEhCAYAAABRKfYcAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGchJREFUeJzt3Xu0ZGV9p/HnC4ioKIhxlBHBiDAEFVmoSKLCIRoFogE7\nireIGnUxOo4mmhmdGQ09cYyiKy5lMWogjJcx4CVqQASFid0iCoJcWwIK0raKlywVtEVDEH7zR72H\nLtpzqbP7VNWpOs9nrbN6V9Wuvd/afbqe3nvXJVWFJElLtd24ByBJmkwGRJLUiQGRJHViQCRJnRgQ\nSVInBkSS1IkBWQWS/I8kX09yVZLLkzy+Xb8xyW7jHt9i5htnks1DWt8Hkqxp06cm2W8Y61kJkjwm\nyZEDzrsuyUFt+uwk9xvu6LTS7TDuAWi4khwCHAUcWFW/bk/EO7abl/1NQEm2r6o7lnmx841z6G9i\nqqpXDHsdY3Yg8Djg3KXcqaqesRwrH9Lvi0bEPZDptzvw46r6NUBV/bSqfthuC/CaJJe1vZN9AZLc\nO8lp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kSZ0YEElSJwZE\nktTJ/we9KQxTSP9nSgAAAABJRU5ErkJggg==\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0x8b0bef0>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "l = 1 #L - Length of the cantilever \n",
+ "F_app = ((2**0.5))*2 #p - force applies \n",
+ "tan = 1 # The angle of force applied\n",
+ "F_app_x = F_app/((2**0.5)) #p The horizantal component of the force , neglected \n",
+ "F_app_y = F_app/((2**0.5)) #p The Vertical component of the force \n",
+ "#F_Y = 0 \n",
+ "R_A = 1 #p\n",
+ "\n",
+ "#Considering section 1-----1\n",
+ "l_1 = 0.5 # The length of the section from one end\n",
+ "v_1 = R_A #F_Y = 0\n",
+ "M_1 = -R_A*l_1 #MAking moment at section 1 = 0\n",
+ "\n",
+ "#considering end of cantilever\n",
+ "l_2 = 1 # The length of the section from one end\n",
+ "v_2 = R_A #F_Y = 0\n",
+ "M_2 = -R_A*l_2#MAking moment at section 1 = 0\n",
+ "\n",
+ "#Graph\n",
+ "%matplotlib inline\n",
+ "import math \n",
+ "from matplotlib.pyplot import plot,suptitle,xlabel,ylabel\n",
+ "#Drawing of shear and bending moment diagram\n",
+ "print \"Given problem is for drawing diagram, this diagram is drawn by step by step manner. \"\n",
+ "X = [0,0.5,1] # For graph precision \n",
+ "\n",
+ "V = [R_A,v_1,v_2 ];\t\t\t#Shear matrix\n",
+ "M = [0,M_1,M_2];\t\t\t#Bending moment matrix\n",
+ "plot(X,V);\t\t\t #Shear diagram\n",
+ "plot(X,M,'r');\t\t\t #Bending moment diagram\n",
+ "suptitle( 'Shear and bending moment diagram')\n",
+ "xlabel('X axis')\n",
+ "ylabel( 'Y axis') ;\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.7 page number 243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Given problem is for drawing diagram, this diagram is drawn by step by step manner. \n"
+ ]
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAEhCAYAAABRKfYcAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGjZJREFUeJzt3XmUNXV95/H3BxARCWsUOSI4KgaJGoIGMRro4BJgjKAx\nippxiXoYZziaaHJ0ouZ5HGcc0RMXZNSwuKBxiYkLKihEnhZRWWSRBwR9HAkqKnNGQVE8hMB3/qh6\n5NL07b5d3Xft9+ucPk/de+ve+lVXP/3uqrpLqgpJklZqm3EPQJI0nQyIJKkTAyJJ6sSASJI6MSCS\npE4MiCSpEwOyDiR5TZIrk3wjyaVJfq+9/toku497fMvpN84kNw9pee9L8vR2+pQk+w9jOZMgye8k\nOXLAeTclOaid/mySnYc7Ok267cY9AA1XkkOAo4ADq+rf21/E27c3r/mLgJJsW1W3r/HD9hvn0F/E\nVFUvGfYyxuxA4NHAWSu5U1U9ZS0WPqSfF42IeyCzby/g/1XVvwNU1U+r6sftbQFeluSSdu/koQBJ\ndkxyWpIL2tv+uL1+3yTnJfl6+3VIe/1h7fWfBq5aOIAk70pyUZLNSTb0XH9tko2LLH/3JF9o5z+l\nHedikuSt7d7VOUn2aK98UJKzklyc5Es9j/u+JO9I8pUk39m6l9HedlKSq5OcDdy35/rev7pvTvI/\nklye5KtJ7tOzvK+16/CGxfaM2u/d1e0YvpXkH5I8qR3Lt5I8up1vtySfbB/rq0ke3l6/Icn72+/z\ntUmenuQtSa5IcmaSbdv5Dkoy3677WUn27FmPNyW5MMk1SR6X5B7Afwee2e6Z/umCMe+Q5CNJrkry\nCWCHBdtu93b6k+3yNid5cc88L2rX7YIkJyc5sWc7vDvJBcAJSX6vXddLkpyfZL92vue3j312ku8m\nOT7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6TfP2S/Kb\nSXZpp+8FPInmSTq9VrztpuoQVlXdnmTrCwu3AU6rqquTHNfcXCdX1ZlJjkryHeCXwAvHOeaVGGT9\ngGckeSlwG/Ar4FnjG/HKJPkwMAfskeR7wAZge2Zg28Hy68cUbzuAJI8Dngtsbo+lF/A3NM8anOpt\nOMi6Md3bby/gA0lC87vlg1X1xdX+7vSFhJKkTqbtEJYkaUIYEElSJwZEktSJAZEkdWJAJEmdGBBJ\nUicGRBpQ+5bf302ya3t5t/byPsvdd4DHPn/1I5RGy9eBSCuQ5K+A/arquCR/D/yfqnrzuMcljYN7\nINLKvB14TJKXA78P/N1iMyX5ZJKL2w8nenF73T5pPihs9zTOS/LE9rab23/vl+RL7QcWXdG+Qlqa\nSO6BSCuU5MnA54EnVtW5febZtapuSrIDzXucHVpVNyb5c+AI4CLgwVX10nb+n1fVzkleAdyzqv5X\n+7YTO1bVL0eyYtIKuQcirdxRwA+BRywxz18kuZzmk9/2BvYDqKr3AjsDxwF/tcj9LgZemORvgUca\nD00yAyKtQPs50U8ADgFesdgntiU5DDgceExVHUjzrqc7tLfdiyYo0Hx06l1U1ZeBQ2neRvv9Sf5s\nGOshrQUDIq3Mu2g+bOgHwJtZ/BzILsCNVXVrkv1pYrPVCcCHgL8FTu25PtCcJwH+b1Wd1t5+0Nqv\ngrQ2DIg0oCQvAa7rOe/xbmD/JH+wYNbP03zY0FXAG4Gvtfc/lOZDfE6oqo8AtyZ5fnufrScj54Bv\nJLkUeCbQ73M3pLHzJLokqRP3QCRJnRgQSVInBkSS1IkBkSR1YkAkSZ0YEElSJwZEktSJAZEkdfL/\nAXYdfyx3uhDkAAAAAElFTkSuQmCC\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0x414ff60>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "l_ab = 3 #L - The total length lets say '3L'\n",
+ "R_1 = 1 #p - The force applied at b\n",
+ "R_2 = 1 #p - The force applied at c\n",
+ "l_ab = 1 #L\n",
+ "l_bc = 1 #L \n",
+ "\n",
+ "#Logical step \n",
+ "#Since the system is in symmetry we can avoid moment M = 0 caliculations\n",
+ "\n",
+ "#F_Y = 0 \n",
+ "R_A = (R_1 + R_2)/2\n",
+ "R_B = (R_1 + R_2)/2\n",
+ "\n",
+ "#Lets take '3' sections \n",
+ "#Considering section 1-----1 at 0.5L\n",
+ "l_1 = 0.5 #L - distance of the section from the A\n",
+ "v_1 = R_A #F_Y = 0 \n",
+ "M_1 = R_A*l_1 #MAking moment at section 1 = 0\n",
+ "\n",
+ "#Considering section 2-----2 at 1L\n",
+ "l_2 = 1 #L - distance of the section from the A\n",
+ "v_2 = R_A #F_Y = 0 \n",
+ "M_2 = R_A*l_2 #MAking moment at section 2 = 0\n",
+ "\n",
+ "#Considering section 3-----3 at 1.5L\n",
+ "l_3 = 1.5 #L - distance of the section from the A\n",
+ "v_3 = 0 #F_Y = 0 \n",
+ "M_3 = R_A*l_2 #MAking moment at section 2 = 0 and symmetry \n",
+ "\n",
+ "#GRAPH\n",
+ "#Since the symmetry exists the graphs are also symmetry\n",
+ "%matplotlib inline\n",
+ "import math \n",
+ "from matplotlib.pyplot import plot,suptitle,xlabel,ylabel\n",
+ "#Drawing of shear and bending moment diagram\n",
+ "print \"Given problem is for drawing diagram, this diagram is drawn by step by step manner. \"\n",
+ "X = [0,0.5,1,1.000000001,1.5,1.999999999999,2,2.5,3] # For graph precision \n",
+ "\n",
+ "V = [R_A,v_1,v_2,v_3,v_3,v_3,-v_2,-v_1,-R_B];\t\t\t#Shear matrix\n",
+ "M = [0,M_1,M_2,1,1,1,M_2,M_1,0];\t\t\t#Bending moment matrix\n",
+ "plot(X,V);\t\t\t#Shear diagram\n",
+ "plot(X,M);\t\t\t#Bending moment diagram\n",
+ "suptitle( 'Shear and bending moment diagram')\n",
+ "xlabel('X axis')\n",
+ "ylabel( 'Y axis') ;"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.8 page nmber 244"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "0.5\n"
+ ]
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAAEACAYAAABVtcpZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFQBJREFUeJzt3W2wnGV9x/HvPyS0hUIKKiIHiSFAdNogT0VmpLgmUhMr\nxPFFJ0Ci2NGE6cA40zolzPRMQqmtWKaKolQoQXlRaSsyHClPsWbbcQSNCIkPeSIiIScSB62hYpkG\n+PfF2YTt4Tzsye7Z+969v5+ZHXb3XNz3xT0n+8tev72WyEwkSdU0o+gJSJKKYwhIUoUZApJUYYaA\nJFWYISBJFWYISFKFdSQEImJxRGyNiO0RcfU4Y2oR8VhE/CAiNnTivJKk9kS7+wQiYgawHVgE7AE2\nAssyc2vTmNnAt4A/zMzhiHhtZj7b1oklSW3rxDuBc4EdmflUZu4H7gSWjhpzKXBXZg4DGACSVA6d\nCIEB4Ommx7sbzzU7DTg2IjZExMaIWNGB80qS2jSzi+c5C1gIHAk8HBEPZ+YTXTq/JGkMnQiBYeCk\npscnNp5rtht4NjNfAF6IiP8E3gq8KgQiwi8zkqQpysw4lH+vE8tBG4FTImJORBwOLAOGRo25Bzg/\nIg6LiCOAtwFbxjtgZnrLZM2aNYXPoQw3r4PXwmsx8a0dbb8TyMyXIuJK4CFGQuW2zNwSEatGfpy3\nZObWiHgQ2Ay8BNySmT9q99ySpPZ0pBPIzAeA+aOe+8KoxzcAN3TifJKkznDHcInVarWip1AKXodX\neC1e4bXojLY3i3VaRGTZ5iRJZRYRZIHFsCSpRxkCklRhhoAkVZghIEkVZghIUoUZApJUYYaAJFWY\nISBJFWYISFKFlTIEli+/lieffKroaUhS3yvl10bAr5g3bw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2Ay8BNyS\nmePuxO9VLf5e/C1we0RsYuTF8S8y8xfFzXr6RMQ/ATXgNRGxi5FPRh1OG6+dbhaTpArzfy8pSRVm\nCEhShRkCklRhhoAkVZghIEkVZghIUoUZApJUYYaAJFXY/wFYiQK5Fc41VwAAAABJRU5ErkJggg==\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0x8e76208>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAEACAYAAABYq7oeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XucTfX+x/HXZ8g1l5LEiORSUkiRTmgSGkWU04lc0o2S\n6lzquPxMBoU61XHrHCqZTKI7k1IumeRILsctkUtzlJlQiEwuY+b7+2M2TTODuezZa8/e7+fjMY/H\nrL2/a+23ZWZ95ru+a32XOecQERHJKsLrACIiEnxUHEREJAcVBxERyUHFQUREclBxEBGRHFQcREQk\nB78UBzOLNrPNZrbFzAbl8v4lZrbMzI6Y2V9zeT/CzP5rZgn+yCMiIoVT6OJgZhHAJOAmoBHQw8wu\nzdZsL/AI8I9TbOYx4OvCZhEREf/wR8+hBbDVObfDOZcGzAK6ZG3gnPvJObcaOJ59ZTOrCdwMvOKH\nLCIi4gf+KA6RwPdZlnf6XsurfwJPALpVW0QkSHg6IG1mtwC7nXNrAfN9iYiIx0r6YRvJQK0syzV9\nr+XFdcCtZnYzUBaoYGbTnXN9sjc0M/UsREQKwDmX7z+8/dFzWAnUM7PaZlYK6A6c7qqjkyGdc0Od\nc7Wccxf71vs0t8KQpb2+nGP48OGeZwiWL+0L7Qvti9N/FVShew7OuXQzGwjMJ7PYTHXObTKz/plv\nu5fMrBqwCqgAZJjZY8BlzrlDhf18ERHxP3+cVsI59zFwSbbXpmT5fjdw4Rm28RnwmT/yiIhI4egO\n6WIoKirK6whBQ/viN9oXv9G+KDwrzDmpQDIz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
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0xab25c50>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "import numpy as np\n",
+ "l_ab = 1.0 #L - The length of the beam\n",
+ "F_D = 1.0 #W - The force distribution \n",
+ "F = F_D*l_ab #WL - The force applied\n",
+ "#Beause of symmetry the moment caliculations can be neglected\n",
+ "#F_Y = 0\n",
+ "R_A = F/2 #wl - The reactive force at A\n",
+ "R_B = F/2 #wl - The reactive force at B\n",
+ "\n",
+ "#considering many sections \n",
+ "\n",
+ "#section 1--1\n",
+ "l_1 = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] #L taking each section at 0.1L distance \n",
+ "M_1 = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "v = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "for i in range(10):\n",
+ " v[i] = R_A - F_D*l_1[i] \n",
+ " M_1[i] = R_A*l_1[i] - F_D*(l_1[i]**2)/2 #M = 0 in the section\n",
+ "print R_A\n",
+ "#Graphs\n",
+ "import numpy as np\n",
+ "values = [0.5,0,-0.5]\n",
+ "y = np.array(values)\n",
+ "t = np.linspace(0,1,3)\n",
+ "poly_coeff = np.polyfit(t, y, 2)\n",
+ "import matplotlib.pyplot as plt\n",
+ "plt.plot(t, y, 'o')\n",
+ "plt.plot(t, np.poly1d(poly_coeff)(t), '-')\n",
+ "plt.show()\n",
+ "\n",
+ "import numpy as np\n",
+ "values = M_1\n",
+ "y = np.array(values)\n",
+ "t = np.linspace(0,1,11)\n",
+ "poly_coeff = np.polyfit(t, y, 2)\n",
+ "import matplotlib.pyplot as plt\n",
+ "plt.plot(t, y, 'o')\n",
+ "plt.plot(t, np.poly1d(poly_coeff)(t), '-')\n",
+ "plt.show()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.9 page number 245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The force and moment in section a--a are -2.33 KN , -13.644 KN-m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "P_Max = 10 #N - the maximum distribution in a triangular distribution\n",
+ "L = 3 #mt the total length of force distribution \n",
+ "L_X = 5 #mt - the horizantal length of the rod\n",
+ "#caliculations \n",
+ "\n",
+ "F_y = P_Max*L*0.5 #N - The force due to triangular distribition \n",
+ "L_com = 2*L /3 #mt - the resultant force acting as a result of distribution acting position \n",
+ "#F_X = 0 forces in x directions\n",
+ "R_A_X = 0 # since there are no forces in X-direction\n",
+ "R_B_X = 0\n",
+ "#M_A = 0 momentum at point a is zero\n",
+ "#F_y*L_com - R_B_Y*L_X = 0\n",
+ "R_B_Y = F_y*L_com/L_X\n",
+ "\n",
+ "#M_B= 0 momentum at point b is zero\n",
+ "#- R_A_Y*L_X = F_y*(L_X-L )\n",
+ "\n",
+ "R_A_Y = - F_y*L/L_X\n",
+ "\n",
+ "#caliculating for some random value\n",
+ "#For a---a section \n",
+ "l_a = 2 #mt - a---a section from a \n",
+ "l_com_a = 2*l_a/3\n",
+ "v_a = R_A_Y + 0.5*l_a*(10.0*2/3) #*(10*2/3) because the maximum moves\n",
+ "\n",
+ "M_a = (10.0*0.66)*l_a*(0.33) + R_A_Y*l_a\n",
+ "\n",
+ "print \"The force and moment in section a--a are\",round(v_a,2),\"KN ,\",M_a,\"KN-m\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.13 page number 254"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Given problem is for drawing diagram, this diagram is drawn by step by step manner. \n"
+ ]
+ },
+ {
+ "data": {
+ "image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JP0zPn6nsYkOLIuJrkrbb/nB6zkAz\nsk/Sj22vkXS2pFrXFQEKRxMdAJALeyAAgFwIEABALgQIACAXAgQAkAsBAgDIhQABAORCgAAAciFA\nAAC5/H/91y4DSEHt5wAAAABJRU5ErkJggg==\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0x8f3aa58>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "l_ab = 4 #L - The total length lets say '3L'\n",
+ "R_1 = 1 #p - The force applied at b\n",
+ "R_2 = 1 #p - The force applied at c\n",
+ "l_ab = 1 #L\n",
+ "l_bc = 3 #L \n",
+ "\n",
+ "#Logical step \n",
+ "#Since the system is in symmetry we can avoid moment M = 0 caliculations\n",
+ "\n",
+ "#F_Y = 0 \n",
+ "R_A = (R_1 + R_2)/2\n",
+ "R_B = (R_1 + R_2)/2\n",
+ "\n",
+ "#Lets take '3' sections \n",
+ "#Considering section 1-----1 at 0.5L\n",
+ "l_1 = 0.5 #L - distance of the section from the A\n",
+ "v_1 = R_A #F_Y = 0 \n",
+ "M_1 = R_A*l_1 #MAking moment at section 1 = 0\n",
+ "\n",
+ "#Considering section 2-----2 at 1L\n",
+ "l_2 = 1 #L - distance of the section from the A\n",
+ "v_2 = R_A #F_Y = 0 \n",
+ "M_2 = R_A*l_2 #MAking moment at section 2 = 0\n",
+ "\n",
+ "#Considering section 3-----3 at 1.5L\n",
+ "l_3 = 3 #L - distance of the section from the A\n",
+ "v_3 = 0 #F_Y = 0 \n",
+ "M_3 = R_A*l_2 #MAking moment at section 2 = 0 and symmetry \n",
+ "\n",
+ "#GRAPH\n",
+ "#Since the symmetry exists the graphs are also symmetry\n",
+ "%matplotlib inline\n",
+ "import math \n",
+ "from matplotlib.pyplot import plot,suptitle,xlabel,ylabel\n",
+ "#Drawing of shear and bending moment diagram\n",
+ "print \"Given problem is for drawing diagram, this diagram is drawn by step by step manner. \"\n",
+ "X = [0,0.5,1,1.0000001,2,2.9999999999,3,3.5,4] # For graph precision \n",
+ "\n",
+ "V = [R_A,v_1,v_2,v_3,v_3,v_3,-v_2,-v_1,-R_B];\t\t\t#Shear matrix\n",
+ "M = [0,M_1,M_2,M_3,M_3,M_3,M_2,M_1,0];\t\t\t#Bending moment matrix\n",
+ "plot(X,V);\t\t\t#Shear diagram\n",
+ "plot(X,M);\t\t\t#Bending moment diagram\n",
+ "suptitle( 'Shear and bending moment diagram')\n",
+ "xlabel('X axis')\n",
+ "ylabel( 'Y axis') ;"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.14 page number 255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAAEACAYAAABVtcpZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHz9JREFUeJzt3Xl4VdW9//H3l/mqgBMiCYoYKxZUQJBKoRoHCE6g1F5B\nQFGxoKLW/n4W9TYS5VqlvU+12qIyKCoqtgiIE4NCRLiKoIDKIFMaIUFAVIRIICTf+0cCxkhC4Oyc\nfYbP63ny9Azr7P11N6xP9l77rGXujoiIJKdaYRcgIiLhUQiIiCQxhYCISBJTCIiIJDGFgIhIElMI\niIgksUBCwMx6mNlKM1tlZsP28/4xZvaWmS0xs0/NbGAQ+xURkchYpN8TMLNawCrgQiAfWAj0cfeV\n5doMBxq4+z1mdizwOdDU3fdEtHMREYlIEGcCnYDV7p7r7kXARKBXhTZfAg3LHjcEtioARETCVyeA\nbaQC68s930BpMJQ3BnjHzPKBI4CrA9iviIhEKFoDw/cAS909BWgP/MPMjojSvkVEpBJBnAnkASeW\ne9687LXyugAPArj7WjPLAU4DFlXcmJlpMiMRkYPk7nYonwviTGAhcIqZtTCzekAfYFqFNiuAiwDM\nrClwKrCusg26u37cGT58eOg1xMK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3\nJ0js75tU5/fiVOBoM5tjZgvNbEDUqouu6hyLMUAbM8sHllI6RU2yOui+MzYXmpefMLPzgespPR1M\nVo8C5a8JJ3IQHEgd4CzgAkoXxX7fzN539zXhlhWKe4Cl7n6+maUBs8zsTHffEXZh8SCMEMgDTiz3\nvHnZaxXbnHCANomgOscCMzsTGA30cPeqTgXjWXWORUdgopkZpdd+LzazIndPtJlpq3MsNgBfuXsh\nUGhmc4G2lF4/TyTVORZdgAcB3H2tmeUApwGLolJhbDnovjOMy0ELgVPMrIWZ1QP6ABX/EU8DrgUw\ns3OAb71sjqIEc8BjYWYnAq8AA9x9bQg1RssBj4W7n1z205LScYFbEjAAoHr/Rl4FuppZbTM7jNJB\nwBVRrjMaqnMsVgAXAZRd/z4VWBfVKqPLqPws+KD7zqifCbh7sZkNBWZSGkLj3H2FmQ0ufdtHu/ub\nZnaJma0BCii9DJJwqnMsgEzgaGBU2V/ARe7eKbyqa0Y1j8WPPhL1IqOkmv9GVprZDOAToBgY7e4J\nN1V7NX8vHgKeMbOllHaOf3D3r8OruuaY2YtAOnCMmX1B6Z1R9Yig79SXxUREkpiWlxQRSWIKARGR\nJKYQEBFJYgoBEZEkphAQEUliCgERkSSmEBARSWIKARGRJPZ/XAlOnyX6TbQAAAAASUVORK5CYII=\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0xac8e208>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "import numpy as np\n",
+ "import matplotlib.pyplot as plt\n",
+ "l = 1.0 #l - The length of the beam\n",
+ "p = 1.0 #W - The total load applied\n",
+ "#since it is triangular distribution \n",
+ "l_com = 0.66*l#l - The distance of force of action from one end\n",
+ "#F_Y = 0\n",
+ "#R_A + R_B = p\n",
+ "#M_a = 0 Implies that R_B = 2*R_A\n",
+ "R_A = p/3.0\n",
+ "R_B = 2.0*p/3\n",
+ "\n",
+ "#Taking Many sections \n",
+ "\n",
+ "#Section 1----1\n",
+ "l = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] #L taking each section at 0.1L distance \n",
+ "M = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "v = [0,0,0,0,0,0,0,0,0,0,0]\n",
+ "for i in range(10):\n",
+ " v[i] = p*(l[i]**2) - p/3.0\n",
+ " M[i] = p*(l[i]**3)/(3.0)- p*l[i]/3.0\n",
+ "\n",
+ "v[10] = R_B #again concluded Because the value is tearing of \n",
+ "\n",
+ "\n",
+ "#Graph\n",
+ "values = M\n",
+ "y = np.array(values)\n",
+ "t = np.linspace(0,1,11)\n",
+ "poly_coeff = np.polyfit(t, y, 2)\n",
+ "\n",
+ "plt.plot(t, y, 'o')\n",
+ "plt.plot(t, np.poly1d(poly_coeff)(t), '-')\n",
+ "plt.show()\n",
+ "%matplotlib inline\n",
+ "values = v\n",
+ "y = np.array(values)\n",
+ "t = np.linspace(0,1,11)\n",
+ "poly_coeff = np.polyfit(t, y, 2)\n",
+ "\n",
+ "plt.plot(t, y, 'o')\n",
+ "plt.plot(t, np.poly1d(poly_coeff)(t), '-')\n",
+ "plt.show()\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.16 page number 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "0.166666666667\n",
+ "Given problem is for drawing diagram, this diagram is drawn by step by step manner. \n"
+ ]
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEhCAYAAACOZ4wDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHddJREFUeJzt3Xu0HHWZ7vHvE8I9EsAx3IkidyGJkYszCLQCAQNDGGZE\nFBUBGdZoDqiEm8okDB4kZukM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86a2ZmrdcNu6HMzKzFHBZm\nZpbLYWFmZrkcFmZmlsthYWZmuRwWZmaWy2Fh1qB0OvVHJW2Y7m+U7m+d99oG5n376ldo1jo+zsJs\nCCRNAbaLiBMk/QD4fUR8u+i6zFrNWxZmQ/NvwJ6STgL+BvhOrUGSrk1nKl0k6Qvpsa3TBbo2VuY2\nSfun515KXzeV9Kt0FtAH0hHuZoXzloXZEEmaAMwG9o+IuXXGbJiuKb8O2fnL9omI5yQdCxwE3A28\nPyL+KY1/MSI2kPRVYO2I+FY6Rch6EfFKW1bMbBDesjAbuolkV2XcdZAxX5a0ELiT7EzI2wFExI+A\nDYATgCk1XjcfOEbSPwNjHBTWKRwWZkMgaRzZ2Tk/DHxV0iY1xuwLfAzYMyLGkZ1ldp303Lpk4QEw\nYuBrI+K/gX3ITrN/qaTPtGI9zIbKYWE2NN8nu0DTk8C3qd2zGAk8FxGvSdqRLFj6TQd+Avwzb78U\nqSDrawB/jIiL0/N1ry9g1k4OC7MGpctqPl7Vp7gQ2FHS3gOGzgbWlLQYOAf4TXr9PmQXPpoeET8D\nXpN0dHpNf/OwAtwv6V7gCKDrrvFh5eQGt5mZ5fKWhZmZ5XJYmJlZLoeFmZnlcliYmVkuh4WZmeVy\nWJiZWS6HhZmZ5XJYmJlZrv8PP8dAL0wfwAEAAAAASUVORK5CYII=\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0xad0f2e8>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "import math \n",
+ "from matplotlib.pyplot import plot,suptitle,xlabel,ylabel\n",
+ "l = 6.0 #a - length of the rod\n",
+ "F = 1.0 #p - force applies in x direction \n",
+ "d = 1.0 #a \n",
+ "M = 1.0 #pa - torque applies on the rod\n",
+ "l_ab = 4.0 #a application of torque point from A\n",
+ "#M = 0 implies that\n",
+ "R_A = F/6.0 #p - The reaction at A\n",
+ "R_B = - R_A #F_Y = 0\n",
+ "\n",
+ "#Caliculations \n",
+ "\n",
+ "#Taking sections \n",
+ "#Section 1---1\n",
+ "l_1 = 1 #a - the length of the section \n",
+ "M_1 = - R_A*l_1 #M = 0\n",
+ "\n",
+ "#Section 2---2\n",
+ "l_2 = 4 #a - the length of the section \n",
+ "M_2 = - R_A*l_2 #M = 0\n",
+ "\n",
+ "l_4 = 2 #a - the length of the section \n",
+ "M_4 = 1/3.0 #pa #M = 0 '-M' because there is moment couple in between\n",
+ "\n",
+ "\n",
+ "#Section 3---3\n",
+ "l_3 = 1 #a - the length of the section \n",
+ "M_3 = 1/6.0#pa M = 0 '-M' because there is moment couple in between\n",
+ "print R_A\n",
+ "\n",
+ "#GRAPH\n",
+ "#Since the symmetry exists the graphs are also symmetry\n",
+ "%matplotlib inline\n",
+ "#Drawing of shear and bending moment diagram\n",
+ "print \"Given problem is for drawing diagram, this diagram is drawn by step by step manner. \"\n",
+ "X = [0,1,4,4.00001,5,6] # For graph precision \n",
+ "M = [0,M_1,M_2,M_4,M_3,0];\t\t\t#Bending moment matrix\n",
+ "plot(X,M);\t\t\t#Bending moment diagram\n",
+ "suptitle( 'Shear and bending moment diagram')\n",
+ "xlabel('X axis')\n",
+ "ylabel( 'Y axis') ;\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter6_4.ipynb b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter6_4.ipynb
new file mode 100644
index 00000000..a251e233
--- /dev/null
+++ b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter6_4.ipynb
@@ -0,0 +1,579 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 6:Pure Bending and Bending with Axial force "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.3 page number 293"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The moment of inertia of total system is 655000.0 mm4\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "#Entire area - hallow area\n",
+ "l_e = 60.0 #mm - length of the entire area\n",
+ "b_e = 40 #mm - width of the entire area\n",
+ "l_h = 30 #mm - length of the hallow area\n",
+ "b_h = 20 #mm - width of the hallow area\n",
+ "A_e = l_e*b_e #mm2 - The entire area\n",
+ "A_h = -l_h*b_h #mm2 - The hallow area '-' because its hallow\n",
+ "A_re = A_e + A_h #mm2 resultant area\n",
+ "y_e = l_e/2 # mm com from bottom \n",
+ "y_h = 20+l_h/2 #mm com from bottom \n",
+ "y_com = (A_e*y_e + A_h*y_h)/A_re \n",
+ "#moment of inertia caliculatins - bh3/12 +ad2\n",
+ "I_e = b_e*(l_e**3)/12 + A_e*((y_e-y_com)**2) #Parallel axis theorm\n",
+ "I_h = b_h*(l_h**3)/12 - A_h*((y_h-y_com)**2) #Parallel axis theorm\n",
+ "I_total = I_e - I_h\n",
+ "print \"The moment of inertia of total system is \",I_total,\"mm4\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.4 page number 295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum stress at 2 mt is 4.81 Mpa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "l = 400 #mm - Length \n",
+ "b = 300 #mm - breath \n",
+ "F = 20 #KN _ the force applied on the beam \n",
+ "F_d = 0.75 #KN-m - The force distribution \n",
+ "d = 2 #mt - the point of interest from the free end\n",
+ "#caliculations \n",
+ "#From moment diagram\n",
+ "M = F*d - F_d*d*1\n",
+ "I = b*(l**3)/12 #mm4 - Bending moment diagram \n",
+ "c = l/2 # the stress max at this C\n",
+ "S = I/c #The maximum shear stress \n",
+ "shear_max = M*(10**6)/S #MPA - the maximum stress \n",
+ "print \"The maximum stress at 2 mt is\",round(shear_max,2),\"Mpa\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.5 pagr number 297"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum tensile stress 16.0 Ksi\n",
+ "The maximum compressive stress 21.6 Ksi\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "#We will divide this into three parts\n",
+ "F = 8 #k - force applied\n",
+ "d = 16 #inch -distance\n",
+ "l_1 = 1 #in \n",
+ "l_2 = 3 #in \n",
+ "b_1 = 4 #in \n",
+ "b_2 = 1 #in\n",
+ "A_1 = l_1* b_1 #in2 - area of part_1\n",
+ "y_1 = 0.5 #in com distance from ab\n",
+ "A_2 =l_2*b_2 #in2 - area of part_1\n",
+ "y_2 = 2.5 #in com distance from ab\n",
+ "A_3 = l_2*b_2 #in2 - area of part_1\n",
+ "y_3 = 2.5 #in com distance from ab\n",
+ "\n",
+ "y_net = (A_1*y_1 +A_2*y_2 + A_3*y_3)/(A_1+A_2+A_3) #in - The com of the whole system\n",
+ "c_max = (4-y_net) #in - The maximum distace from com to end\n",
+ "c_min = y_net #in - the minimum distance from com to end\n",
+ "I_1 = b_1*(l_1**3)/12 + A_1*((y_1-y_net)**2) #Parallel axis theorm\n",
+ "I_2 = b_2*(l_2**3)/12 + A_2*((y_2-y_net)**2)\n",
+ "I_3 = b_2*(l_2**3)/12 + A_2*((y_2-y_net)**2)\n",
+ "I_net = I_1 + I_2 + I_3 #in4 - the total moment of inertia\n",
+ "M_c = F*d*c_max \n",
+ "stress_cmax = M_c/I_net #Ksi - The maximum compressive stress\n",
+ "\n",
+ "M_t= F*d*c_min \n",
+ "stress_tmax = M_t/I_net #Ksi - The maximum tensile stress\n",
+ "print \"The maximum tensile stress\",stress_tmax ,\"Ksi\"\n",
+ "print \"The maximum compressive stress\",round(stress_cmax,1) ,\"Ksi\"\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.8 page number 303"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum stress in steel 11.49 Mpa\n",
+ "The maximum stress in wood 97.09 Mpa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "#Given \n",
+ "#We will divide this into two parts\n",
+ "E_w = 10.0 #Gpa - Youngs modulus of wood\n",
+ "E_s = 200.0 #Gpa - Youngs modulus of steel\n",
+ "M = 30.0 #K.N-m _ applied bending moment \n",
+ "n = E_s/E_w \n",
+ "l_1 = 250 #mm \n",
+ "l_2 = 10 #mm\n",
+ "b_1 = 150.0 #mm\n",
+ "b_2 = 150.0*n #mm\n",
+ "A_1 = l_1* b_1 #mm2 - area of part_1\n",
+ "y_1 = 125.0 #mm com distance from top\n",
+ "A_2 =l_2*b_2 #mm2 - area of part_1\n",
+ "y_2 = 255.0 #mm com distance from top\n",
+ "y_net = (A_1*y_1 +A_2*y_2)/(A_1+A_2) #mm - The com of the whole system from top\n",
+ "I_1 = b_1*(l_1**3)/12.0 + A_1*((y_1-y_net)**2) #Parallel axis theorm\n",
+ "I_2 = b_2*(l_2**3)/12.0 + A_2*((y_2-y_net)**2)\n",
+ "I_net = I_1 + I_2 #mm4 - the total moment of inertia\n",
+ "c_s= y_net # The maximum distance in steel \n",
+ "stress_steel = M*(10.0**6)*c_s/I_net #Mpa - The maximum stress in steel \n",
+ "\n",
+ "c_w= l_1+l_2-y_net # The maximum distance in wood \n",
+ "stress_wood = n*M*(10.0**6)*c_w/I_net #MPa - The maximum stress in wood \n",
+ "\n",
+ "print \"The maximum stress in steel \",round(stress_steel,2) ,\"Mpa\"\n",
+ "print \"The maximum stress in wood\",round(stress_wood,2) ,\"Mpa\" \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.9 page number 305"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum stress in concrete 834.07 psi\n",
+ "The stress in steel 17427.61 psi\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "M = 50000 #ft-lb , positive bending moment applied\n",
+ "N = 9 # number of steel bars \n",
+ "n = 15 # The ratio of steel to concrete \n",
+ "A_s = 30 #in2 area of steel in concrete\n",
+ "#(10*y)*(y/2) = 30*(20-y)\n",
+ "#y**2 + 6*y -120\n",
+ "#solving quadractic equation \n",
+ "import math\n",
+ "\n",
+ "a = 1\n",
+ "b = 6\n",
+ "c = -120\n",
+ "# calculate the discriminant\n",
+ "d = (b**2) - (4*a*c)\n",
+ "\n",
+ "# find two solutions\n",
+ "sol1 = (-b-math.sqrt(d))/(2*a)\n",
+ "sol2 = (-b+math.sqrt(d))/(2*a)\n",
+ "y = sol2 # Nuetral axis is found\n",
+ "l_1 = y #in- the concrete below nuetral axis is not considered\n",
+ "b_1 = 10 #in - width\n",
+ "A_1 = l_1* b_1 #in2 - area of concrete\n",
+ "y_1 = y/2 #in com of the concrete \n",
+ "y_2 = 20-y #in com of the transformed steel \n",
+ "I_1 = b_1*(l_1**3)/12.0 + A_1*((y_1-y)**2) #in4 parallel axis theorm\n",
+ "I_2 = A_s*((y_2)**2) #in4 first part is neglected\n",
+ "I_net = I_1 + I_2 #in4 - the total moment of inertia\n",
+ "c_c= y #in The maximum distance in concrete \n",
+ "stress_concrete = M*12*c_c/I_net #psi - The maximum stress in concrete \n",
+ "c_s= 20- y \n",
+ "stress_steel =n*M*12*c_s/I_net #psi - The maximum stress in concrete \n",
+ "print \"The maximum stress in concrete \",round(stress_concrete,2) ,\"psi\"\n",
+ "print \"The stress in steel\",round(stress_steel,2) ,\"psi\"\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## example 6.10 page number 309"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum stress upward in straight case is 99.984 Mpa\n",
+ "The maximum stress downward in straight case is -99.984 Mpa\n",
+ "The maximum stress upward in curved case is 107.093207632 Mpa\n",
+ "The maximum stress downward in curved case is -93.6813516989 Mpa\n",
+ "The maximum stress upward in curved case2 is 128.733538525 Mpa\n",
+ "The maximum stress downward in curved case2 is -81.0307692623 Mpa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "l = 50.0 #mm - the length of the beam \n",
+ "b = 50.0 #mm - the width of the beam\n",
+ "M = 2083 #Nm\n",
+ "A = l*b #mm2 - The area \n",
+ "#straight beam \n",
+ "I = b*(l**3)/12.0 #mm4 - The moment of inertia of the beam\n",
+ "c_1= l/2 # the distance where the stress is maximum \n",
+ "c_2 = -l/2 # the distance where the stress is maximum \n",
+ "s_1 = I/c_1\n",
+ "s_2 = I/c_2\n",
+ "stress_max_1 = M*(10**3)/s_1 #Mpa - the maximum strss recorded in the crossection\n",
+ "stress_max_2 = M*(10**3)/s_2 #Mpa - the maximum strss recorded in the crossection \n",
+ "print \"The maximum stress upward in straight case is\",stress_max_1,\"Mpa\"\n",
+ "print \"The maximum stress downward in straight case is\",stress_max_2,\"Mpa\"\n",
+ "\n",
+ "#curved beam \n",
+ "import math\n",
+ "r = 250.0 #mm Radius of beam curved \n",
+ "r_0 = r - l/2 # inner radius \n",
+ "r_1 = r + l/2 # outer radius\n",
+ "R = l/(math.log(r_1/r_0)) #mm \n",
+ "e = r - R \n",
+ "stressr_max_1 = M*(10**3)*(R-r_0)/(r_0*A*e)\n",
+ "stressr_max_2 = M*(10**3)*(R-r_1)/(r_1*A*e)\n",
+ "print \"The maximum stress upward in curved case is\",stressr_max_1,\"Mpa\"\n",
+ "print \"The maximum stress downward in curved case is\",stressr_max_2,\"Mpa\"\n",
+ "\n",
+ "#curved beam _2 \n",
+ "import math\n",
+ "r = 75.0 #mm Radius of beam curved \n",
+ "r_0 = r - l/2 # inner radius \n",
+ "r_1 = r + l/2 # outer radius\n",
+ "R = l/(math.log(r_1/r_0)) #mm \n",
+ "e = r - R \n",
+ "stressr_max_1 = M*(10**3)*(R-r_0)/(r_0*A*e)\n",
+ "stressr_max_2 = M*(10**3)*(R-r_1)/(r_1*A*e)\n",
+ "print \"The maximum stress upward in curved case2 is\",stressr_max_1,\"Mpa\"\n",
+ "print \"The maximum stress downward in curved case2 is\",stressr_max_2,\"Mpa\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Page number 6.14 page number 318"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 35,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The plastic moment of the system is 120784.313725 ft-lb\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given \n",
+ "#from example 6.9\n",
+ "St_ul = 2500 #psi - ultimate strength\n",
+ "st_yl = 40000 #psi _ yielding strength \n",
+ "b = 10 #in - width from example \n",
+ "A = 2 #in2 The area of the steel\n",
+ "d = 20 \n",
+ "t_ul = st_yl*A #ultimate capasity\n",
+ "y = t_ul/(St_ul*b*0.85) #in 0.85 because its customary\n",
+ "M_ul = t_ul*(d-y/2)/12 #ft-lb Plastic moment \n",
+ "print \"The plastic moment of the system is \",M_ul,\"ft-lb\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.15 page number 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 50,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The angle at which nuetral axis locates is 0.0226547191205 radians\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "#From example 5.8 \n",
+ "W = 4.0 #N/m - The force distribution \n",
+ "L = 3 # m - The length of the force applied\n",
+ "M = W*L/8.0 # KN.m The moment due to force distribution\n",
+ "o = 30 # the angle of force applid to horizantal\n",
+ "l = 150.0 #mm length of the crossection \n",
+ "b = 100.0 #mm - width of the crossection \n",
+ "import math \n",
+ "M_z = M*(math.cos(3.14/6))\n",
+ "M_y = M*(math.sin(math.pi/6))\n",
+ "I_z = b*(l**3)/12.0\n",
+ "I_y = l*(b**3)/12.0\n",
+ "#tanb = I_z /I_y *tan30\n",
+ "b = math.atan(math.radians(I_z*math.tan(3.14/6.0)/I_y ))\n",
+ "print \"The angle at which nuetral axis locates is\",b,\"radians\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.16 pagenumber 323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum tensile stress -76.1 Mpa\n",
+ "The maximum compressive stress 67.73 Mpa\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "M = 10 #KN.m - The moment applied\n",
+ "I_max = 23.95*(10**6) #mm4 - I_z The moment of inertia\n",
+ "I_min = 2.53*(10**6) #mm4 - I_y The moment of inertia\n",
+ "o = 14.34 # degress the principle axis rotated\n",
+ "#Coponents of M in Y,Z direction \n",
+ "M_z = M*(10**6)*math.cos(math.radians(o))\n",
+ "M_y = M*(10**6)*math.sin(math.radians(o))\n",
+ "#tanb = I_z /I_y *tan14.34\n",
+ "b = math.atan((I_max*math.tan(math.radians(o))/I_min ))\n",
+ "B = math.degrees(b) \n",
+ "y_p = 122.9 # mm - principle axis Y cordinate\n",
+ "z_p = -26.95 #mm - principle axis z cordinate\n",
+ "stress_B = - M_z*y_p/I_max + M_y*z_p/I_min #Mpa - Maximum tensile stress\n",
+ "y_f = -65.97 # mm - principle axis Y cordinate\n",
+ "z_f = 41.93 #mm - principle axis z cordinate\n",
+ "stress_f = - M_z*y_f/I_max + M_y*z_f/I_min #Mpa - Maximum compressive stress\n",
+ "print \"The maximum tensile stress\",round(stress_B,2) ,\"Mpa\"\n",
+ "print \"The maximum compressive stress\",round(stress_f,2),\"Mpa\"\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.18 page number 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 51,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum stress in the beam 3.332 Mpa \n"
+ ]
+ }
+ ],
+ "source": [
+ "l = 50 #mm - The length of the beam \n",
+ "b = 50 #mm - The width of the beam \n",
+ "A = l*b #mm2 - The area of the beam \n",
+ "p = 8.33 #KN - The force applied on the beam \n",
+ "stress_max = p*(10**3)/A #Mpa After cutting section A--b\n",
+ "print \"The maximum stress in the beam\",stress_max ,\"Mpa \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.24 page number 339"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "By sketching the line with angle 53.2 degrees The farthest point associated with B and F\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "M = 10 #KN.m - The moment applied\n",
+ "I_max = 23.95*(10**6) #mm4 - I_z The moment of inertia\n",
+ "I_min = 2.53*(10**6) #mm4 - I_y The moment of inertia\n",
+ "o = 14.34 # degress the principle axis rotated\n",
+ "#Coponents of M in Y,Z direction \n",
+ "M_z = M*(10**6)*math.cos(math.radians(o))\n",
+ "M_y = M*(10**6)*math.sin(math.radians(o))\n",
+ "#tanb = I_z /I_y *tan14.34\n",
+ "b = math.atan((I_max*math.tan(math.radians(o))/I_min ))\n",
+ "B = math.degrees(b) \n",
+ "y_p = 122.9 # mm - principle axis Y cordinate\n",
+ "z_p = -26.95 #mm - principle axis z cordinate\n",
+ "stress_B = - M_z*y_p/I_max + M_y*z_p/I_min #Mpa - Maximum tensile stress\n",
+ "y_f = -65.97 # mm - principle axis Y cordinate\n",
+ "z_f = 41.93 #mm - principle axis z cordinate\n",
+ "stress_f = - M_z*y_f/I_max + M_y*z_f/I_min #Mpa - Maximum compressive stress\n",
+ "#location of nuetral axis To show these stresses are max and minimum \n",
+ "#tanB = MzI_z + MzI_yz/MyI_y +M_YI_yz\n",
+ "I_z = 22.64 *(10**6) #mm4 moment of inertia in Z direction\n",
+ "I_y = 3.84 *(10**6) #mm4 moment of inertia in Y direction\n",
+ "I_yz =5.14 *(10**6) #mm4 moment of inertia in YZ direction \n",
+ "M_y = M #KN.m bending moment in Y dorection \n",
+ "M_z = M #KN.m bending moment in Y dorection \n",
+ "B = math.atan(( M_z*I_yz)/(M_z*I_y )) #radians location on neutral axis\n",
+ "beta = math.degrees(B)\n",
+ "print \"By sketching the line with angle\",round(beta,1),\"degrees The farthest point associated with B and F\" "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter7_4.ipynb b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter7_4.ipynb
new file mode 100644
index 00000000..68f90e5d
--- /dev/null
+++ b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter7_4.ipynb
@@ -0,0 +1,275 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# chapter 7:Shear stress in Beams and Related Problems "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.1 page number 365"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The minimal space between the nails 42.0 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "shear_v = 3000 #N - Transmitted vetical shear \n",
+ "shear_al = 700 #N - The maximum allowable \n",
+ "#We will divide this into two parts\n",
+ "l_1 = 50.0 #mm \n",
+ "l_2 = 200.0 #mm \n",
+ "b_1 = 200.0 #mm \n",
+ "b_2 = 50.0 #mm\n",
+ "A_1 = l_1* b_1 #mm2 - area of part_1\n",
+ "y_1 = 25.0 #mm com distance \n",
+ "A_2 =l_2*b_2 #mm2 - area of part_1\n",
+ "y_2 = 150.0 #in com distance \n",
+ "y_net = (A_1*y_1 +A_2*y_2)/(A_1+A_2) #mm - The com of the whole system\n",
+ "c_max = (4-y_net) #mm - The maximum distace from com to end\n",
+ "c_min = y_net #mm - the minimum distance from com to end\n",
+ "I_1 = b_1*(l_1**3)/12 + A_1*((y_1-y_net)**2) #Parallel axis theorm\n",
+ "I_2 = b_2*(l_2**3)/12 + A_2*((y_2-y_net)**2)\n",
+ "I_net = I_1 + I_2 #mm4 - the total moment of inertia\n",
+ "Q = A_1*(-y_1+y_net) #mm3\n",
+ "q = shear_v*Q/I_net #N/mm - Shear flow\n",
+ "d = shear_al/q # The space between the nails \n",
+ "print \"The minimal space between the nails \",round(d,0) ,\"mm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.2 pagenumber 365"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The minimal space between the nails 123.0 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "l = 6 #m -length of the beam \n",
+ "p = 3 #KN-m _ the load applied\n",
+ "R_a = l*p/2 #KN -The reaction at a, Since the system is symmetry \n",
+ "R_b = l*p/2 #KN -The reaction at b \n",
+ "l_s = 10 #mm - The length of the screw \n",
+ "shear_al = 2 #KN - The maximum load the screw can take \n",
+ "I = 2.36*(10**9) #mm2 The moment of inertia of the whole system\n",
+ "#We will divide this into two parts\n",
+ "l_1 = 50.0 #mm \n",
+ "l_2 = 50.0 #mm \n",
+ "b_1 = 100.0 #mm \n",
+ "b_2 = 200.0 #mm\n",
+ "A_1 = l_1* b_1 #in2 - area of part_1\n",
+ "y_1 = 200.0 #mm com distance \n",
+ "A_2 =l_2*b_2 #mm2 - area of part_1\n",
+ "y_2 = 225.0 #in com distance\n",
+ "Q = 2*A_1*y_1 + A_2*y_2 # mm3 For the whole system\n",
+ "q = R_a*Q*(10**3)/I #N/mm The shear flow \n",
+ "d = shear_al*(10**3)/q #mm The space between the nails\n",
+ "print \"The minimal space between the nails \",round(d,0),\"mm\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.6 page number 376"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The shear centre from outside vertical face is 1.825 in\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "#we will divide this into two equal parts and other part\n",
+ "l = 10.0 # in - The height \n",
+ "t = 0.1 # in - The width\n",
+ "b = 5.0 #mm- The width of the above part \n",
+ "A = t* b #in2 - area of part\n",
+ "y_net = l/2 # The com of the system \n",
+ "y_1 = l # The position of teh com of part_2\n",
+ "I_1 = t*(l**3)/12 #in4 The moment of inertia of part 1\n",
+ "I_2 = 2*A*((y_1-y_net)**2) #in4 The moment of inertia of part 2 \n",
+ "I = I_1 + I_2 #in4 The moment of inertia \n",
+ "e = (b**2)*(l**2)*t/(4*I) #in the formula of channels\n",
+ "l_sc = e - t/2 #in- The shear centre \n",
+ "print \"The shear centre from outside vertical face is \",l_sc ,\"in\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.8 page number 387"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The direct maximum stress 4.25 Mpa\n",
+ "The torsion maximum stress 101.91 Mpa\n",
+ "The total stress 106.16 Mpa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "dia = 10.0 #mm - The diameter of the cylinder \n",
+ "c = dia/2 #mm - the radius of the cylinder \n",
+ "A = 3.14*(c**2) #mm2 The area of the crossection \n",
+ "y = 4*c/(3*3.14) #mm The com of cylinder \n",
+ "I = 3.14*(c**4)/4 #mm4 - The moment of inertia of the cylinder\n",
+ "j = 3.14*(dia**4)/32 #mm4\n",
+ "T = 20.0 #N.m - The torque \n",
+ "V = 250.0 #N - The shear \n",
+ "M = 25.0 #N-m The bending moment \n",
+ "Q = A*y/2 #mm\n",
+ "stress_dmax = 4*V/(3*A) #V*Q/(I*d) #Mpa The direct maximum stress\n",
+ "stress_tmax = T*c*(10**3)/j #-Mpa The torsion maximum stress\n",
+ "stress_total = stress_dmax + stress_tmax #Mpa The total stress\n",
+ "print \"The direct maximum stress\",round(stress_dmax,2),\"Mpa\"\n",
+ "print \"The torsion maximum stress\",round(stress_tmax,2),\"Mpa\"\n",
+ "print \"The total stress\",round(stress_total,2),\"Mpa\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.9 page number 393"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum stress in the system 4.84 Mpa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "dia = 15 #mm - The diameter of the rod\n",
+ "h = 0.5 #mt - The freely falling height \n",
+ "A = 3.14*(dia**2)/4 #mm2 The area of the crossection\n",
+ "E = 200 #Gpa -Youngs modulus\n",
+ "L = 750 #mm - The total length of the rod\n",
+ "G = 80 #gpa - Shear modulus \n",
+ "N = 10 #number of live coils\n",
+ "d = 5 #mm the diameter of live coil \n",
+ "m = 3 # the mass of freely falling body\n",
+ "H = 500 #mm -from mass to spring \n",
+ "F= m*9.81 #Kg the force due to that mass\n",
+ "p = 3 #KN-m _ the load applied\n",
+ "#e = e_rod + e_spr\n",
+ "#e_rod\n",
+ "e_rod = p*L*(10**-3)/(A*E) #mm The elongation due to freely falling body\n",
+ "#e_spr\n",
+ "e_spr = 64*F*(dia**3)*N*(10**-3)/(G*(d**4)) #mm The elongation due to spring\n",
+ "e = e_rod + e_spr #mm The total elongation \n",
+ "p_dyn =F*(1+pow((1+(2*H/e)),0.5))\n",
+ "Stress_max = p_dyn/A #MPa - The maximum stress in the system \n",
+ "print \"The maximum stress in the system \",round(Stress_max,2),\"Mpa\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter8_4.ipynb b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter8_4.ipynb
new file mode 100644
index 00000000..eb3f21c5
--- /dev/null
+++ b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter8_4.ipynb
@@ -0,0 +1,363 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 8:Transformation of stress and strain and Yield and Fracture criteria "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.1 page number 405 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The stress action in normal direction on AB 1.29 Mpa\n",
+ "The stress action in tangential direction on AB 2.12 Mpa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "import math \n",
+ "from math import radians\n",
+ "o = 22.5 #degrees , The angle of infetisimal wedge \n",
+ "A = 1 #mm2 The area of the element \n",
+ "A_ab = 1*(math.cos(radians(o))) #mm2 - The area corresponds to AB\n",
+ "A_bc = 1*(math.sin(radians(o))) #mm2 - The area corresponds to BC\n",
+ "S_1 = 3 #MN The stresses applying on the element \n",
+ "S_2 = 2 #MN\n",
+ "S_3 = 2 #MN\n",
+ "S_4 = 1 #MN \n",
+ "F_1 = S_1*A_ab # The Forces obtained by multiplying stress by their areas \n",
+ "F_2 = S_2*A_ab\n",
+ "F_3 = S_3*A_bc\n",
+ "F_4 = S_4*A_bc\n",
+ "#sum of F_N = 0 equilibrim in normal direction \n",
+ "N = (F_1-F_3)*(math.cos(radians(o))) + (F_4 - F_2)*(math.sin(radians(o)))\n",
+ "\n",
+ "#sum of F_s = 0 equilibrim in tangential direction \n",
+ "\n",
+ "S = (F_2-F_4)*(math.cos(radians(o))) + (F_1 - F_3)*(math.sin(radians(o)))\n",
+ "\n",
+ "Stress_Normal = N/A #Mpa - The stress action in normal direction on AB\n",
+ "Stress_tan = S/A #Mpa - The stress action in tangential direction on AB\n",
+ "print \"The stress action in normal direction on AB\",round(Stress_Normal,2),\"Mpa\"\n",
+ "print \"The stress action in tangential direction on AB\",round(Stress_tan,2),\"Mpa\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.2 page number 413"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a) The stress action in normal direction on AB 4.12 Mpa\n",
+ "a) The stress action in tangential direction on AB 0.71 Mpa\n",
+ "b) The principle stress 4.2 Mpa tension\n",
+ "b) The principle stress -0.06 Mpa compression\n",
+ "b) The principle plane angles are 32.0 , 122.0 degrees\n",
+ "c) The maximum shear is -2.24 Mpa\n",
+ "a) [ 4.2 -0.1 0. ] Mpa\n",
+ "b) [ 2. -2.24 -2.24 2. ] Mpa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "o = -22.5 #degrees , The angle of infetisimal wedge \n",
+ "A = 1 #mm2 The area of the element \n",
+ "import math \n",
+ "from math import radians\n",
+ "from numpy import array\n",
+ "A_ab = 1*(math.cos(radians(o))) #mm2 - The area corresponds to AB\n",
+ "A_bc = 1*(math.sin(radians(o))) #mm2 - The area corresponds to BC\n",
+ "S_1 = 3.0 #MN The stresses applying on the element \n",
+ "S_2 = 2.0 #MN\n",
+ "S_3 = 2.0 #MN\n",
+ "S_4 = 1.0 #MN\n",
+ "#Caliculations \n",
+ "\n",
+ "F_1 = S_1*A_ab # The Forces obtained by multiplying stress by their areas \n",
+ "F_2 = S_2*A_ab\n",
+ "F_3 = S_3*A_bc\n",
+ "F_4 = S_4*A_bc\n",
+ "#sum of F_N = 0 equilibrim in normal direction \n",
+ "N = (F_1-F_3)*(math.cos(radians(o))) + (F_4 - F_2)*(math.sin(radians(o)))\n",
+ "\n",
+ "#sum of F_s = 0 equilibrim in tangential direction \n",
+ "\n",
+ "S = (F_2-F_4)*(math.cos(radians(o))) + (F_1 - F_3)*(math.sin(radians(o)))\n",
+ "\n",
+ "Stress_Normal = N/A #Mpa - The stress action in normal direction on AB\n",
+ "Stress_tan = S/A #Mpa - The stress action in tangential direction on AB\n",
+ "print \"a) The stress action in normal direction on AB\",round(Stress_Normal,2),\"Mpa\"\n",
+ "print \"a) The stress action in tangential direction on AB\",round(Stress_tan,2),\"Mpa\"\n",
+ "\n",
+ "#Part- b\n",
+ "\n",
+ "S_max = (S_4+S_1)/2 + (((((S_4-S_1)/2)**2) + S_3**2)**0.5) #Mpa - The maximum stress\n",
+ "S_min = (S_4+S_1)/2.0 - (((((S_4-S_1/2))**2) + S_3**2)**0.5) #Mpa - The minumum stress\n",
+ "k = 0.5*math.atan(S_3/((S_1-S_4)/2)) #radians The angle of principle axis\n",
+ "k_1 = math.degrees(k)\n",
+ "k_2 = k_1+90 #The principle plane angles\n",
+ "print \"b) The principle stress \",round(S_max,1),\"Mpa tension\"\n",
+ "print \"b) The principle stress \",round(S_min,2),\"Mpa compression\"\n",
+ "print \"b) The principle plane angles are\",round(k_1,0),\",\",round(k_2,0),\"degrees\"\n",
+ "\n",
+ "#part-c\n",
+ "#The maximum shear stress case\n",
+ "t_xy = (((((S_4-S_1)/2)**2) + S_3**2)**0.5) #Mpa - The maximum shear stress case\n",
+ "K = 0.5*math.atan((-(S_1-S_4)/(2*S_3))) #radians The angle of principle axis\n",
+ "K_0 = math.degrees(K)\n",
+ "if K_0<0:\n",
+ " K_1 = K_0+90\n",
+ "else:\n",
+ " K_1 = K_0\n",
+ "K_2 = K_1+90 #PRinciple plain angles\n",
+ "T_xy = -((S_1-S_4)/2)*(math.sin(radians(2*K_1))) + ((S_4+S_1)/2)*(math.cos(radians(2*K_1))) # Shear stress\n",
+ "print \"c) The maximum shear is \",round(T_xy,2),\"Mpa\" \n",
+ "S_mat_a = array([round(S_max,1),round(S_min,1),0]) #MPa maximum stress matrix\n",
+ "S_mat_b = array([(S_4+S_1)/2,round(T_xy,2),round(T_xy,2),(S_4+S_1)/2]) #MPa maximum stress matrix at maximum shear\n",
+ "print \"a)\",S_mat_a,\"Mpa\"\n",
+ "print \"b)\",S_mat_b,\"Mpa\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.3 page number 421"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The principle stresses are 6.0 Mpa -4.0 Mpa\n",
+ "The maximum shear stress 5.0 Mpa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "import math \n",
+ "from math import radians \n",
+ "S_x = -2 #Mpa _ the noraml stress in x direction\n",
+ "S_y = 4 #Mpa _ the noraml stress in Y direction\n",
+ "c = (S_x + S_y)/2 #Mpa - The centre of the mohr circle \n",
+ "point_x = -2 #The x coordinate of a point on mohr circle\n",
+ "point_y = 4 #The y coordinate of a point on mohr circle\n",
+ "Radius = pow((point_x-c)**2 + point_y**2,0.5) # The radius of the mohr circle\n",
+ "S_1 = Radius +1#MPa The principle stress\n",
+ "S_2 = -Radius +1 #Mpa The principle stress\n",
+ "S_xy_max = Radius #Mpa The maximum shear stress\n",
+ "print \"The principle stresses are\",S_1 ,\"Mpa\",S_2,\"Mpa\"\n",
+ "print \"The maximum shear stress\",S_xy_max,\"Mpa\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.4 page number 423"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The normal stress on the 221/2 plane 4.82 Mpa\n",
+ "The tangential stress on the 221/2 plane 1.43 Mpa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "import math \n",
+ "S_x = 3.0 #Mpa _ the noraml stress in x direction\n",
+ "S_y = 1.0 #Mpa _ the noraml stress in Y direction\n",
+ "c = (S_x + S_y)/2 #Mpa - The centre of the mohr circle \n",
+ "point_x = 1 #The x coordinate of a point on mohr circle\n",
+ "point_y = 3 #The y coordinate of a point on mohr circle\n",
+ "#Caliculations \n",
+ "\n",
+ "Radius = pow((point_x-c)**2 + point_y**2,0.5) # The radius of the mohr circle\n",
+ "#22.5 degrees line is drawn \n",
+ "o = 22.5 #degrees \n",
+ "a = 71.5 - 2*o #Degrees, from diagram \n",
+ "stress_n = c + Radius*math.sin(math.degrees(o)) #Mpa The normal stress on the plane \n",
+ "stress_t = Radius*math.cos(math.degrees(o)) #Mpa The tangential stress on the plane\n",
+ "print \"The normal stress on the 221/2 plane \",round(stress_n,2),\"Mpa\"\n",
+ "print \"The tangential stress on the 221/2 plane \",round(stress_t,2),\"Mpa\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.7 page number 437"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The principle strains are 400 um/m -600 um/m\n",
+ "The angle of principle plane 18.43 degrees\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "e_x = -500 #10-6 m/m The contraction in X direction\n",
+ "e_y = 300 #10-6 m/m The contraction in Y direction\n",
+ "e_xy = -600 #10-6 m/m discorted angle\n",
+ "centre = (e_x + e_y)/2 #10-6 m/m \n",
+ "point_x = -500 #The x coordinate of a point on mohr circle\n",
+ "point_y = 300 #The y coordinate of a point on mohr circle\n",
+ "Radius = 500 #10-6 m/m - from mohr circle\n",
+ "e_1 = Radius +centre #MPa The principle strain\n",
+ "e_2 = -Radius +centre #Mpa The principle strain\n",
+ "k = math.atan(300.0/900) # from geometry\n",
+ "k_1 = math.degrees(k)\n",
+ "print \"The principle strains are\",e_1,\"um/m\",e_2,\"um/m\"\n",
+ "print \"The angle of principle plane\",round(k_1,2) ,\"degrees\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.8 page number 441"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The principle stresses are 48.35 Mpa -105.49 MPa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "e_0 = -500 #10-6 m/m \n",
+ "e_45 = 200 #10-6 m/m \n",
+ "e_90 = 300 #10-6 m/m\n",
+ "E = 200 #Gpa - youngs modulus of steel \n",
+ "v = 0.3 # poissions ratio \n",
+ "#Caliculations \n",
+ "\n",
+ "e_xy = 2*e_45 - (e_0 +e_90 ) #10-6 m/m from equation 8-40 in text\n",
+ "# from example 8.7\n",
+ "e_x = -500 #10-6 m/m The contraction in X direction\n",
+ "e_y = 300 #10-6 m/m The contraction in Y direction\n",
+ "e_xy = -600 #10-6 m/m discorted angle\n",
+ "centre = (e_x + e_y)/2 #10-6 m/m \n",
+ "point_x = -500 #The x coordinate of a point on mohr circle\n",
+ "point_y = 300 #The y coordinate of a point on mohr circle\n",
+ "Radius = 500 #10-6 m/m - from mohr circle\n",
+ "e_1 = Radius +centre #MPa The principle strain\n",
+ "e_2 = -Radius +centre #Mpa The principle strain\n",
+ "\n",
+ "stress_1 = E*(10**-3)*(e_1+v*e_2)/(1-v**2) #Mpa the stress in this direction \n",
+ "stress_2 = E*(10**-3)*(e_2+v*e_1)/(1-v**2) #Mpa the stress in this direction \n",
+ "print\"The principle stresses are \",round(stress_1,2),\"Mpa\",round(stress_2,2),\"MPa\" "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter9_4.ipynb b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter9_4.ipynb
new file mode 100644
index 00000000..b5115257
--- /dev/null
+++ b/Engineering_Mechanics_of_Solids_by_Popov_E_P/chapter9_4.ipynb
@@ -0,0 +1,256 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 9:Elastic stress analysis and design"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.4 pagenumber 465"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)The principle stresses are 16.67 MPa, -16.67 Mpa\n",
+ "b)The stresses on inclines plane 11.11 Mpa noraml, -7.06 Mpa shear \n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given \n",
+ "import math \n",
+ "b = 40.0 #mm - The width of the beam crossection\n",
+ "h = 300.0 #mm - The length of the beam crossection \n",
+ "V = 40.0 #KN - The shear stress in teh crossection\n",
+ "M = 10.0 #KN-m - The bending moment on K----K crossection \n",
+ "c = h/2 #mm -The position at which maximum stress occurs on the crossection\n",
+ "I = b*(h**3)/12 #mmm4 - the moment of inertia \n",
+ "#Caliculations \n",
+ "\n",
+ "stress_max_1 = M*c*(10**6)/I #The maximum stress occurs at the end\n",
+ "stress_max_2 = -M*c*(10**6)/I #The maximum stress occurs at the end\n",
+ "y = 140 #mm The point of interest, the distance of element from com\n",
+ "n = y/(c) # The ratio of the distances from nuetral axis to the elements\n",
+ "stress_L_1 = n*stress_max_1 #The normal stress on elements L--L\n",
+ "stress_L_2 = -n*stress_max_1 #The normal stress on elements L--L\n",
+ "x = 10 #mm The length of the element\n",
+ "A = b*x #mm3 The area of the element \n",
+ "y_1 = y+x/2 # the com of element from com of whole system\n",
+ "stress_xy = V*A*y_1*(10**3)/(I*b) #Mpa - The shear stress on the element \n",
+ "#stresses acting in plane 30 degrees \n",
+ "o = 60 #degrees - the plane angle\n",
+ "stress_theta = stress_L_1/2 + stress_L_1*(math.cos(math.radians(o)))/2 - stress_xy*(math.sin(math.radians(o))) #Mpa by direct application of equations\n",
+ "stress_shear = -stress_L_1*(math.sin(math.radians(o)))/2 - stress_xy*(math.cos(math.radians(o))) #Mpa Shear stress\n",
+ " \n",
+ "print \"a)The principle stresses are \",round(stress_max_1,2),\"MPa,\",round(stress_max_2,2),\"Mpa\"\n",
+ "print \"b)The stresses on inclines plane \",round(stress_theta,2),\"Mpa noraml, \",round(stress_shear,2),\"Mpa shear \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.5 page number 476"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The stress developed 0.4 is in allowable ranges for 30077.85 mm2 area\n",
+ "The minimum area is 5714.28571429 mm2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "M = 10 #KN-m moment\n",
+ "v = 8.0 #KN - shear Stress \n",
+ "stress_allow = 8 #MPa - The maximum allowable stress\n",
+ "shear_allow_per = 1.4 #Mpa - The allowable stress perpendicular to grain\n",
+ "stress_allow_shear = 0.7 #MPa - The maximum allowable shear stress\n",
+ "#Caliculations \n",
+ "\n",
+ "S = M*(10**6)/stress_allow #mm3 \n",
+ "#lets arbitarly assume h = 2b\n",
+ "#S = b*(h**2)/6\n",
+ "h = pow(12*S,0.333) #The depth of the beam\n",
+ "b = h/2 #mm The width of the beam\n",
+ "A = h*b #mm2 The area of the crossection , assumption\n",
+ "stress_shear = 3*v*(10**3)/(2*A) #Mpa The strear stress \n",
+ "if stress_shear<stress_allow_shear:\n",
+ " print \"The stress developed \",round(stress_shear,2),\" is in allowable ranges for \",round(A,2),\"mm2 area\"\n",
+ "else:\n",
+ " print \"The stress developed\",stress_shear,\" is in non allowable ranges\",A,\"area\"\n",
+ "Area_allow = v*(10**3)/shear_allow_per #mm - the allowable area\n",
+ "print \"The minimum area is \",Area_allow ,\"mm2\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.6 page number 478"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "W8x24 gives the allowable ranges of shear stress\n",
+ "lengths of the bearing at A 0.092 in\n",
+ "lengths of the bearing at B 2.12 in\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "stress_allow = 24 #ksi - The maximum allowable stress\n",
+ "stress_allow_shear = 14.5 #ksi- The maximum allowable shear stress\n",
+ "M_max = 36 #k-ft The maximum moment\n",
+ "l = 16 #in-The length of the rod\n",
+ "w = 2 #k/ft - The force distribution on the rod\n",
+ "A = l*w\n",
+ "R_A = 6.4 #k - The reaction at A\n",
+ "R_B = 25.6 #k - the reaction at B\n",
+ "v_max = R_B-l*w #kips the maximum stress, from diagram\n",
+ "#W8x24 is used from the appendix table 3 and 4 \n",
+ "l =0.245 #in - W8x24 crossesction length\n",
+ "#Caliculations \n",
+ "\n",
+ "stress_xy = v_max/A #ksi the approximate shear stress \n",
+ "if stress_xy < stress_allow_shear:\n",
+ " print \"W8x24 gives the allowable ranges of shear stress\"\n",
+ "else:\n",
+ " print \"W8x24 doesnot gives the allowable ranges of shear stress\"\n",
+ "k = 7.0/8 #in the distance from the outer face of the flange to the webfillet\n",
+ "#at+kt should not exceed 0.75 of yeild stress\n",
+ "#a1t+2kt should not exceed 0.75 of yeild stress\n",
+ "Stress_yp = 36 #Ksi - The yeild stress\n",
+ "t = 0.245 #in thickness of the web\n",
+ "#support a \n",
+ "a = R_A/(0.75*Stress_yp*t)-k #in lengths of the bearings\n",
+ "#support b\n",
+ "a_1 = R_B/(0.75*Stress_yp*t)-2*k #in lengths of the bearings\n",
+ "print \"lengths of the bearing at A \",round(a,3),\"in\"\n",
+ "print \"lengths of the bearing at B\",round(a_1,3),\"in\"\n",
+ " \n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.8 page number 483"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The suggested diameter is 2.66 in\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given \n",
+ "hp = 63000 #horse power\n",
+ "T = hp*20*(10**-3)/63 #k-in the torsion implies due to horse power\n",
+ "stress_allow_shear = 6 #ksi- The maximum allowable shear stress\n",
+ "M_ver = 6.72/2 #k-in the vertical component of the moment \n",
+ "M_hor = 9.10 #k-in the horizantal component of the moment \n",
+ "#Caliculations \n",
+ "\n",
+ "M = pow(((M_ver**2)+(M_hor**2)),0.5) #K-in The resultant \n",
+ "d = pow((16*(((M**2)+(T**2))**0.5)/(stress_allow_shear*3.14)),0.333) #in, The suggested diameter from derivation\n",
+ "print \"The suggested diameter is\",round(d,2),\"in\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Engineering_Mechanics_of_Solids_by_Popov_E_P/charpter_3_5.ipynb b/Engineering_Mechanics_of_Solids_by_Popov_E_P/charpter_3_5.ipynb
new file mode 100644
index 00000000..2db38e12
--- /dev/null
+++ b/Engineering_Mechanics_of_Solids_by_Popov_E_P/charpter_3_5.ipynb
@@ -0,0 +1,300 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chaper 3:Generalized hooke's law, Pressure vessels and Thick walled cylinders"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.1 page number 141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the stiffness constant is 64.0 N/mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "from numpy.random import randn\n",
+ "th = 8 #mm - thickness \n",
+ "G = 0.64 #N/mm2 -shear modulus\n",
+ " \n",
+ "a = 40 #mm length\n",
+ "b = 20 #mm width \\\n",
+ "Area = a*b #mm2\n",
+ "e = randn() # lets say any random vale\n",
+ "strain = e/th # strain in shearing case\n",
+ "#caliculations\n",
+ "\n",
+ "stress =G*strain\n",
+ "F = stress*Area\n",
+ "#stiffness = froce/displacement\n",
+ "k = F/e #N/mm\n",
+ "print \"the stiffness constant is \",k,\"N/mm\"\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.2 page number 149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The change in the dimension between parallel faces is -0.025 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "a = 50 #mm - length of a cube\n",
+ "E = 200 # Gpa - the youngs modulus \n",
+ "v = 0.25 # no units- poissions ratio \n",
+ "pressure = 200 # Mpa - pressure acting on all sides \n",
+ "#pressure is a compressive stress \n",
+ "S_x = -200 # Gpa - The stress in X direction \n",
+ "S_y = -200 # Gpa - The stress in Y direction\n",
+ "S_z = -200 # Gpa - The stress in Z direction\n",
+ "#Caliculations\n",
+ "\n",
+ "e = S_x*pow(10,-3)/E - v*S_y*pow(10,-3)/E-v*S_z*pow(10,-3)/E#mm - considering all three directions \n",
+ "x = e*a #mmThe change in the dimension between parallel faces\n",
+ "print \"The change in the dimension between parallel faces is \",x,\"mm\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.3 page number 154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The Hoop stress is 80.0 mm\n",
+ "The longitudinal stress is 40.0 mm\n",
+ "The change in daimeter of the cylinder is 0.35 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "R = 1000 # mm - radius of the cylinder \n",
+ "t = 10 #mm - thickness of the cylinder\n",
+ "p_in = 0.80 #Mpa- Internal pressure \n",
+ "E = 200 #Mpa- youngs modulus \n",
+ "v = 0.25 # poission ratio\n",
+ "#caliculations\n",
+ "\n",
+ "Stress_1 = p_in*R/t #Mpa -Hoop stress #From derived expressions \n",
+ "Stress_2 = p_in*R/(2*t) #Mpa- Longitudinal stress \n",
+ "e = Stress_1*pow(10,-3)/E-v*Stress_2*pow(10,-3)/E\n",
+ "dia_change = e*R #mm- The change in daimeter of the cylinder \n",
+ "print \"The Hoop stress is \",Stress_1,\"mm\"\n",
+ "print \"The longitudinal stress is \",Stress_2, \"mm\"\n",
+ "print \"The change in daimeter of the cylinder is\",dia_change,\"mm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.4 page number 156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The maximum stress is 40.0 mm\n",
+ "The change in daimeter of the cylinder is 0.15 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "R = 1000 #mm - radius of the cylinder\n",
+ "th = 10 #mm - thickness of the cylinder\n",
+ "E = 200 #Mpa- youngs modulus \n",
+ "v = 0.25 # poission ratio\n",
+ "p_in = 0.80 #Mpa- Internal pressure\n",
+ "t = 10 #mm - thickness of the cylinder\n",
+ "#caliculations\n",
+ "\n",
+ "Stress_1 = p_in*R/(2*t) #Mpa -Hoop stress #From derived expressions \n",
+ "Stress_2 = p_in*R/(2*t) #Mpa- Longitudinal stress\n",
+ "# Hoop stress and Longitudinal stress are same in this case\n",
+ "e = Stress_1*pow(10,-3)/E-v*Stress_2*pow(10,-3)/E\n",
+ "dia_change = e*R #mm- The change in daimeter of the cylinder\n",
+ "print \"The maximum stress is \",Stress_2, \"mm\"\n",
+ "print \"The change in daimeter of the cylinder is\",dia_change,\"mm\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.5 page number 156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The diameter of each bolt is 1.41985914794 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "p_in = 0.7 #Mpa - internal pressure \n",
+ "n_bolts = 20 # number of bolts \n",
+ "dia = 650 #mm - bolt circle diameter \n",
+ "stress_allow = 125 #mm Maximum alowable stress\n",
+ "Stress_conc = 2 #stress concentration\n",
+ "d = 25 #mm \n",
+ "#caliculations\n",
+ "\n",
+ "F = p_in*3.14*pow(((dia-2*d)/2),2)*pow(10,6) #N\n",
+ "F_each = F/n_bolts #N- force per each Bolt\n",
+ "A = Stress_conc*F_each/(stress_allow*pow(10,-6)) #mm2 The bolt area \n",
+ "Bolt_dia = 2*pow((round(A,3)/3.14),0.5)*pow(10,-7) #mm the bolt daimeter\n",
+ "print \"The diameter of each bolt is\",Bolt_dia,\"mm\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.6 page number 166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "ename": "ImportError",
+ "evalue": "No module named randn",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[1;31mImportError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m<ipython-input-3-f3772d92c540>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;31m#Given\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mrandn\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3\u001b[0m \u001b[0mr_1\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mrandn\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;31m# let r_1 is a random number\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[0mt\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m0.1\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mr_1\u001b[0m \u001b[1;31m#Thickness\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[0mr_2\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mr_1\u001b[0m\u001b[1;33m+\u001b[0m\u001b[0mt\u001b[0m \u001b[1;31m#Outer Radius\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
+ "\u001b[1;31mImportError\u001b[0m: No module named randn"
+ ]
+ }
+ ],
+ "source": [
+ "#Given\n",
+ "from numpy.random import randn\n",
+ "r_1 = randn()# let r_1 is a random number \n",
+ "t = 0.1*r_1 #Thickness\n",
+ "r_2 = r_1+t #Outer Radius\n",
+ "#caliculations\n",
+ "\n",
+ "stress_1_a= ((r_1**2)/((r_2**2)-(r_1**2)))*(1+((r_2**2)/(r_1**2)))#p -r =r_2\n",
+ "stress_2_a= ((r_1**2)/((r_2**2)-(r_1**2)))*(1+((r_2**2)/(r_2**2)))#p -r =r_1\n",
+ "stress_avg_a=(stress_1_a+stress_2_a)/2 #p\n",
+ "print \"The average stress in case a is\",stress_avg_a,\"p\"\n",
+ "\n",
+ "#Case-B\n",
+ "#Given\n",
+ "r_1 = randn()# let r_1 is a random number \n",
+ "r_2_b= 4*r_1 \n",
+ "#caliculations\n",
+ "\n",
+ "stress_1_b = ((r_1**2)/((r_2_b**2)-(r_1**2)))*(1+((r_2_b**2)/(r_1**2)))#p -r =r_2\n",
+ "stress_2_b= ((r_1**2)/((r_2_b**2)-(r_1**2)))*(1+((r_2_b**2)/(r_2_b**2)))#p -r =r_1\n",
+ "stress_avg_b=(stress_1_b+stress_2_b)/2 #p\n",
+ "print \"The average stress in case b is\",stress_2_b,\"p\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Engineering_Mechanics_of_Solids_by_Popov_E_P/screenshots/1_2.PNG b/Engineering_Mechanics_of_Solids_by_Popov_E_P/screenshots/1_2.PNG
new file mode 100644
index 00000000..3e77324d
--- /dev/null
+++ b/Engineering_Mechanics_of_Solids_by_Popov_E_P/screenshots/1_2.PNG
Binary files differ
diff --git a/Engineering_Mechanics_of_Solids_by_Popov_E_P/screenshots/2_2.PNG b/Engineering_Mechanics_of_Solids_by_Popov_E_P/screenshots/2_2.PNG
new file mode 100644
index 00000000..9dea04e5
--- /dev/null
+++ b/Engineering_Mechanics_of_Solids_by_Popov_E_P/screenshots/2_2.PNG
Binary files differ
diff --git a/Engineering_Mechanics_of_Solids_by_Popov_E_P/screenshots/3_2.PNG b/Engineering_Mechanics_of_Solids_by_Popov_E_P/screenshots/3_2.PNG
new file mode 100644
index 00000000..4ff04bf3
--- /dev/null
+++ b/Engineering_Mechanics_of_Solids_by_Popov_E_P/screenshots/3_2.PNG
Binary files differ
diff --git a/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/Chapter9_9.ipynb b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/Chapter9_9.ipynb
new file mode 100644
index 00000000..dc9cf7f9
--- /dev/null
+++ b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/Chapter9_9.ipynb
@@ -0,0 +1,421 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:48cb33cf6ef13f754e173ca6c35bca3909b876e2908bcec42f91faa51efd7e7e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter09:Numerical Solution of Partial Differential Equations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9.1:pg-350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#standard five point formula\n",
+ "#example 9.1\n",
+ "#page 350\n",
+ "\n",
+ "u2=5.0\n",
+ "u3=1.0\n",
+ "for i in range(0,3):\n",
+ " u1=(u2+u3+6.0)/4.0\n",
+ " u2=(u1/2.0)+(5.0/2.0)\n",
+ " u3=(u1/2.0)+(1.0/2.0)\n",
+ " print\" the values are u1=%d\\t u2=%d\\t u3=%d\\t\\n\\n\" %(u1,u2,u3)\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the values are u1=3\t u2=4\t u3=2\t\n",
+ "\n",
+ "\n",
+ " the values are u1=3\t u2=4\t u3=2\t\n",
+ "\n",
+ "\n",
+ " the values are u1=3\t u2=4\t u3=2\t\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9.2:pg-351"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#solution of laplace equation by jacobi method,gauss-seidel method and SOR method\n",
+ "#example 9.2\n",
+ "#page 351\n",
+ "u1=0.25\n",
+ "u2=0.25\n",
+ "u3=0.5\n",
+ "u4=0.5 #initial values\n",
+ "print \"jacobis iteration process\\n\\n\"\n",
+ "print\"u1\\t u2\\t u3\\t u4\\t \\n\\n\"\n",
+ "print \"%f\\t %f\\t %f\\t %f\\t \\n\" %(u1,u2,u3,u4)\n",
+ "for i in range(0,7):\n",
+ " u11=(0+u2+0+u4)/4\n",
+ " u22=(u1+0+0+u3)/4\n",
+ " u33=(1+u2+0+u4)/4\n",
+ " u44=(1+0+u3+u1)/4\n",
+ " u1=u11\n",
+ " u2=u22\n",
+ " u3=u33\n",
+ " u4=u44\n",
+ " print \"%f\\t %f\\t %f\\t %f\\t \\n\" %(u11,u22,u33,u44) \n",
+ "print \" gauss seidel process\\n\\n\"\n",
+ "u1=0.25\n",
+ "u2=0.3125\n",
+ "u3=0.5625\n",
+ "u4=0.46875 #initial values\n",
+ "print \"u1\\t u2\\t u3\\t u4\\t \\n\\n\"\n",
+ "print \"%f\\t %f\\t %f\\t %f\\t \\n\" %(u1,u2,u3,u4)\n",
+ "for i in range(0,4):\n",
+ "\n",
+ " u1=(0.0+u2+0.0+u4)/4.0\n",
+ " u2=(u1+0.0+0.0+u3)/4.0\n",
+ " u3=(1.0+u2+0.0+u4)/4.0\n",
+ " u4=(1.0+0.0+u3+u1)/4.0\n",
+ " print \"%f\\t %f\\t %f\\t %f\\t \\n\" %(u1,u2,u3,u4) \n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "jacobis iteration process\n",
+ "\n",
+ "\n",
+ "u1\t u2\t u3\t u4\t \n",
+ "\n",
+ "\n",
+ "0.250000\t 0.250000\t 0.500000\t 0.500000\t \n",
+ "\n",
+ "0.187500\t 0.187500\t 0.437500\t 0.437500\t \n",
+ "\n",
+ "0.156250\t 0.156250\t 0.406250\t 0.406250\t \n",
+ "\n",
+ "0.140625\t 0.140625\t 0.390625\t 0.390625\t \n",
+ "\n",
+ "0.132812\t 0.132812\t 0.382812\t 0.382812\t \n",
+ "\n",
+ "0.128906\t 0.128906\t 0.378906\t 0.378906\t \n",
+ "\n",
+ "0.126953\t 0.126953\t 0.376953\t 0.376953\t \n",
+ "\n",
+ "0.125977\t 0.125977\t 0.375977\t 0.375977\t \n",
+ "\n",
+ " gauss seidel process\n",
+ "\n",
+ "\n",
+ "u1\t u2\t u3\t u4\t \n",
+ "\n",
+ "\n",
+ "0.250000\t 0.312500\t 0.562500\t 0.468750\t \n",
+ "\n",
+ "0.195312\t 0.189453\t 0.414551\t 0.402466\t \n",
+ "\n",
+ "0.147980\t 0.140633\t 0.385775\t 0.383439\t \n",
+ "\n",
+ "0.131018\t 0.129198\t 0.378159\t 0.377294\t \n",
+ "\n",
+ "0.126623\t 0.126196\t 0.375872\t 0.375624\t \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9.4:pg-354"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#poisson equation\n",
+ "#exaample 9.4\n",
+ "#page 354\n",
+ "u2=0.0\n",
+ "u4=0.0\n",
+ "print \" u1\\t u2\\t u3\\t u4\\t\\n\\n\"\n",
+ "for i in range(0,6):\n",
+ " u1=(u2/2.0)+30.0\n",
+ " u2=(u1+u4+150.0)/4.0\n",
+ " u4=(u2/2.0)+45.0\n",
+ " print \"%0.2f\\t %0.2f\\t %0.2f\\t %0.2f\\n\" %(u1,u2,u2,u4)\n",
+ "print \" from last two iterates we conclude u1=67 u2=75 u3=75 u4=83\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " u1\t u2\t u3\t u4\t\n",
+ "\n",
+ "\n",
+ "30.00\t 45.00\t 45.00\t 67.50\n",
+ "\n",
+ "52.50\t 67.50\t 67.50\t 78.75\n",
+ "\n",
+ "63.75\t 73.12\t 73.12\t 81.56\n",
+ "\n",
+ "66.56\t 74.53\t 74.53\t 82.27\n",
+ "\n",
+ "67.27\t 74.88\t 74.88\t 82.44\n",
+ "\n",
+ "67.44\t 74.97\t 74.97\t 82.49\n",
+ "\n",
+ " from last two iterates we conclude u1=67 u2=75 u3=75 u4=83\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9.6:pg-362"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#bender-schmidt formula\n",
+ "#example 9.6\n",
+ "#page 362\n",
+ "def f(x):\n",
+ " return (4*x)-(x*x)\n",
+ "#u=[f(0),f(1),f(2),f(3),f(4)]\n",
+ "u1=f(0);u2=f(1);u3=f(2);u4=f(3);u5=f(4);\n",
+ "u11=(u1+u3)/2\n",
+ "u12=(u2+u4)/2\n",
+ "u13=(u3+u5)/2\n",
+ "print \"u11=%0.2f\\t u12=%0.2f\\t u13=%0.2f\\t \\n\" %(u11,u12,u13)\n",
+ "u21=(u1+u12)/2.0\n",
+ "u22=(u11+u13)/2.0\n",
+ "u23=(u12+0)/2.0\n",
+ "print \"u21=%0.2f\\t u22=%0.2f\\t u23=%0.2f\\t \\n\" %(u21,u22,u23)\n",
+ "u31=(u1+u22)/2.0\n",
+ "u32=(u21+u23)/2.0\n",
+ "u33=(u22+u1)/2.0\n",
+ "print \"u31=%0.2f\\t u32=%0.2f\\t u33=%0.2f\\t \\n\" % (u31,u32,u33)\n",
+ "u41=(u1+u32)/2.0\n",
+ "u42=(u31+u33)/2.0\n",
+ "u43=(u32+u1)/2.0\n",
+ "print \"u41=%0.2f\\t u42=%0.2f\\t u43=%0.2f\\t \\n\" % (u41,u42,u43)\n",
+ "u51=(u1+u42)/2.0\n",
+ "u52=(u41+u43)/2.0\n",
+ "u53=(u42+u1)/2.0\n",
+ "print \"u51=%0.2f\\t u52=%0.2f\\t u53=%0.2f\\t \\n\" % (u51,u52,u53)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "u11=2.00\t u12=3.00\t u13=2.00\t \n",
+ "\n",
+ "u21=1.50\t u22=2.00\t u23=1.50\t \n",
+ "\n",
+ "u31=1.00\t u32=1.50\t u33=1.00\t \n",
+ "\n",
+ "u41=0.75\t u42=1.00\t u43=0.75\t \n",
+ "\n",
+ "u51=0.50\t u52=0.75\t u53=0.50\t \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 77
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9.7:pg-363"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#bender-schimdt's formula and crank-nicolson formula\n",
+ "#example 9.7\n",
+ "#page 363\n",
+ "#bender -schimdt's formula\n",
+ "import math\n",
+ "from numpy import matrix\n",
+ "z=math.pi\n",
+ "def f(x,t):\n",
+ " return math.exp(z*z*t*-1)*sin(z*x)\n",
+ "#u=[f(0,0),f(0.2,0),f(0.4,0),f(0.6,0),f(0.8,0),f(1,0)]\n",
+ "u1=f(0,0)\n",
+ "u2=f(0.2,0)\n",
+ "u3=f(0.4,0)\n",
+ "u4=f(0.6,0)\n",
+ "u5=f(0.8,0)\n",
+ "u6=f(1.0,0)\n",
+ "u11=u3/2\n",
+ "u12=(u2+u4)/2\n",
+ "u13=u12\n",
+ "u14=u11\n",
+ "print \"u11=%f\\t u12=%f\\t u13=%f\\t u14=%f\\n\\n\" % (u11,u12,u13,u14)\n",
+ "u21=u12/2\n",
+ "u22=(u12+u14)/2\n",
+ "u23=u22\n",
+ "u24=u21\n",
+ "print \"u21=%f\\t u22=%f\\t u23=%f\\t u24=%f\\n\\n\" % (u21,u22,u23,u24)\n",
+ "print \"the error in the solution is: %f\\n\\n\" % (math.fabs(u22-f(0.6,0.04)))\n",
+ "#crank-nicolson formula\n",
+ "#by putting i=1,2,3,4 we obtain four equation\n",
+ "A=matrix([[4, -1, 0, 0] ,[-1, 4, -1, 0],[0, -1, 4, -1],[0, 0, -1, 4]])\n",
+ "C=matrix([[0.9510],[1.5388],[1.5388],[0.9510]])\n",
+ "X=A.I*C\n",
+ "print \"u00=%f\\t u10=%f\\t u20=%f\\t u30=%f\\t\\n\\n\" %(X[0][0],X[1][0],X[2][0],X[3][0])\n",
+ "print \"the error in the solution is: %f\\n\\n\" %(abs(X[1][0]-f(0.6,0.04)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "u11=0.475528\t u12=0.769421\t u13=0.769421\t u14=0.475528\n",
+ "\n",
+ "\n",
+ "u21=0.384710\t u22=0.622475\t u23=0.622475\t u24=0.384710\n",
+ "\n",
+ "\n",
+ "the error in the solution is: 0.018372\n",
+ "\n",
+ "\n",
+ "u00=0.399255\t u10=0.646018\t u20=0.646018\t u30=0.399255\t\n",
+ "\n",
+ "\n",
+ "the error in the solution is: 0.005172\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9.8:pg-364"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#heat equation using crank-nicolson method\n",
+ "#example 9.8\n",
+ "#page 364\n",
+ "from numpy import matrix\n",
+ "import math\n",
+ "z=0.01878\n",
+ "#h=1/2 l=1/8,i=1\n",
+ "u01=0.0\n",
+ "u21=1.0/8.0\n",
+ "u11=(u21+u01)/6.0\n",
+ "print \" u11=%f\\n\\n\" % (u11)\n",
+ "print \"error is %f\\n\\n\" % (math.fabs(u11-z))\n",
+ "#h=1/4,l=1/8,i=1,2,3\n",
+ "A=matrix([[-3.0 ,-1.0 ,0.0],[1.0,-3.0,1.0],[0.0,1.0,-3.0]])\n",
+ "C=matrix([[0.0],[0.0],[-0.125]])\n",
+ "#here we found inverese of A then we multipy it with C\n",
+ "X=A.I*C\n",
+ "print \"u12=%f\\n\\n\" % (X[1][0])\n",
+ "print \"error is %f\\n\\n\" %(math.fabs(X[1][0]-z))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " u11=0.020833\n",
+ "\n",
+ "\n",
+ "error is 0.002053\n",
+ "\n",
+ "\n",
+ "u12=0.013889\n",
+ "\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "error is 0.004891\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter1_9.ipynb b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter1_9.ipynb
new file mode 100644
index 00000000..81bb2dc6
--- /dev/null
+++ b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter1_9.ipynb
@@ -0,0 +1,629 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:bd492601bf0cbf93169a7f4f37f7f64caba9f8e22a4fc5648e6c332b00f367f3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter01:Errors in Numerical Calculations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.1:pg-7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 1.1\n",
+ "#rounding off\n",
+ "#page 7\n",
+ "a1=1.6583\n",
+ "a2=30.0567\n",
+ "a3=0.859378\n",
+ "a4=3.14159\n",
+ "print \"\\nthe numbers after rounding to 4 significant figures are given below\\n\"\n",
+ "print \" %f %.4g\\n'\" %(a1,a1)\n",
+ "print \" %f %.4g\\n\" %(a2,a2)\n",
+ "print \" %f %.4g\\n\" %(a3,a3)\n",
+ "print \" %f %.4g\\n\" %(a4,a4)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "the numbers after rounding to 4 significant figures are given below\n",
+ "\n",
+ " 1.658300 1.658\n",
+ "'\n",
+ " 30.056700 30.06\n",
+ "\n",
+ " 0.859378 0.8594\n",
+ "\n",
+ " 3.141590 3.142\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.2:pg-9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 1.2\n",
+ "#percentage accuracy\n",
+ "#page 9\n",
+ "import math\n",
+ "x=0.51 # the number given\n",
+ "n=2 #correcting upto 2 decimal places\n",
+ "d=math.pow(10,-n)\n",
+ "d=d/2.0\n",
+ "p=(d/x)*100 #percentage accuracy\n",
+ "print \"the percentage accuracy of %f after correcting to two decimal places is %f\" %(x,p)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the percentage accuracy of 0.510000 after correcting to two decimal places is 0.980392\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.3:pg-9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 1.3\n",
+ "#absolute and relative errors\n",
+ "#page 9\n",
+ "X=3.1428571 #approximate value of pi\n",
+ "T_X=3.1415926 # true value of pi\n",
+ "A_E=T_X-X #absolute error\n",
+ "R_E=A_E/T_X #relative error\n",
+ "print \"Absolute Error = %0.7f \\n Relative Error = %0.7f\" %(A_E,R_E)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Absolute Error = -0.0012645 \n",
+ " Relative Error = -0.0004025\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.4:pg-10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 1.4\n",
+ "#best approximation\n",
+ "#page 10\n",
+ "import math\n",
+ "X=1/3 #the actual number\n",
+ "X1=0.30\n",
+ "X2=0.33\n",
+ "X3=0.34\n",
+ "E1=abs(X-X1)\n",
+ "E2=abs(X-X2)\n",
+ "E3=abs(X-X3)\n",
+ "if E1<E2:\n",
+ " if E1<E3:\n",
+ " B_A=X1\n",
+ "elif E2<E1:\n",
+ " if E2<E3:\n",
+ " B_A=X2\n",
+ "elif E3<E2:\n",
+ " if E3<E1:\n",
+ " B_A=X3\n",
+ "print \"the best approximation of 1/3 is %f\" %(B_A)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the best approximation of 1/3 is 0.300000\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.5:pg-10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#relative error\n",
+ "#example 1.5\n",
+ "#page 10\n",
+ "import math\n",
+ "n=8.6 # the corrected number\n",
+ "N=1 #the no is rounded to one decimal places\n",
+ "E_A=math.pow(10,-N)/2\n",
+ "E_R=E_A/n\n",
+ "print \"the relative error of the number is:%0.4f\" %(E_R)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the relative error of the number is:0.0058\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.6:pg-10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 1.6\n",
+ "#absolute error and relative error\n",
+ "#page 10\n",
+ "import math\n",
+ "s=math.sqrt(3)+math.sqrt(5)+math.sqrt(7) #the sum square root of 3,5,7\n",
+ "n=4\n",
+ "Ea=3*(math.pow(10,-n)/2) #absolute error\n",
+ "R_E=Ea/s\n",
+ "print \"the sum of square roots is %0.4g \\n\" %(s)\n",
+ "print \"the absolute error is %f \\n\" %(Ea)\n",
+ "print \"the relative error is %f\" %(R_E)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the sum of square roots is 6.614 \n",
+ "\n",
+ "the absolute error is 0.000150 \n",
+ "\n",
+ "the relative error is 0.000023\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.7:pg-10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#absolute error\n",
+ "#example 1.7\n",
+ "#page 10\n",
+ "import math\n",
+ "n=[0.1532, 15.45, 0.0000354, 305.1, 8.12, 143.3, 0.0212, 0.643, 0.1734] #original numbers\n",
+ "#rounding all numbers to 2 decimal places\n",
+ "n=[305.1, 143.3, 0.15,15.45, 0.00, 8.12, 0.02, 0.64, 0.17] \n",
+ "sum=0;\n",
+ "#l=length(n);\n",
+ "for i in range(len(n)):\n",
+ " sum=sum+n[i];\n",
+ "\n",
+ "E_A=2*math.pow(10,-1)/2+7*math.pow(10,-2)/2\n",
+ "print \"the absolute error is:%0.2f\" %(E_A)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the absolute error is:0.14\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.8:pg-11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#difference in 3 significant figures\n",
+ "#example 1.8\n",
+ "#page 11\n",
+ "import math\n",
+ "X1=math.sqrt(6.37)\n",
+ "X2=math.sqrt(6.36)\n",
+ "d=X1-X2 #difference between two numbers\n",
+ "print \"the difference corrected to 3 significant figures is %0.3g\" %(d)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the difference corrected to 3 significant figures is 0.00198\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.9:pg-12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#relative error\n",
+ "#example 1.10\n",
+ "#page 12\n",
+ "import math\n",
+ "a=6.54\n",
+ "b=48.64\n",
+ "c=13.5\n",
+ "da=0.01\n",
+ "db=0.02\n",
+ "dc=0.03\n",
+ "s=math.pow(a,2)*math.sqrt(b)/math.pow(c,3)\n",
+ "print \"s=%f\" %(s)\n",
+ "r_err=2*(da/a)+(db/b)/2+3*(dc/c)\n",
+ "print \"the relative error is :%f\" %(r_err)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "s=0.121241\n",
+ "the relative error is :0.009930\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.11:pg-13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#relative error\n",
+ "#example 1.11\n",
+ "#page 13\n",
+ "import math\n",
+ "x=1\n",
+ "y=1\n",
+ "z=1\n",
+ "u=(5*x*math.pow(y,3))/math.pow(z,3)\n",
+ "dx=0.001\n",
+ "dy=0.001\n",
+ "dz=0.001\n",
+ "max=((5*math.pow(y,2))/math.pow(z,3))*dx+((10*x*y)/math.pow(z,3))*dy+((15*x*math.pow(y,2))/math.pow(z,4))*dz\n",
+ "e=max/u\n",
+ "print \" the relative error is :%f\" %(e)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the relative error is :0.006000\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.12:pg-12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#taylor series\n",
+ "#example 1.12\n",
+ "#page 12\n",
+ "import math\n",
+ "def f(x):\n",
+ " return math.pow(x,3)+5*x-10\n",
+ "def f1(x):\n",
+ " return 3*math.pow(x,2)-6*x+5\n",
+ "def f2(x):\n",
+ " return 6*x-6\n",
+ "def f3(x):\n",
+ " return 6\n",
+ "D=[0,f(0), f1(0), f2(0), f3(0)]\n",
+ "S1=0;\n",
+ "h=1;\n",
+ "for i in range(1,5):\n",
+ " S1=S1+math.pow(h,i-1)*D[i]/math.factorial(i-1)\n",
+ " \n",
+ "print \"the third order taylors series approximation of f(1) is :%d\" %(S1)\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the third order taylors series approximation of f(1) is :-7\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.13:pg-16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#taylor series\n",
+ "#example 1.13\n",
+ "#page 16\n",
+ "import math\n",
+ "def f(x):\n",
+ " return math.sin(x)\n",
+ "def f1(x):\n",
+ " return math.cos(x)\n",
+ "def f2(x):\n",
+ " return -1*math.sin(x)\n",
+ "def f3(x):\n",
+ " return -1*math.cos(x)\n",
+ "def f4(x):\n",
+ " return math.sin(x)\n",
+ "def f5(x):\n",
+ " return math.cos(x)\n",
+ "def f6(x):\n",
+ " return -1*math.sin(x)\n",
+ "def f7(x):\n",
+ " return -1*math.cos(x)\n",
+ "D=[0,f(math.pi/6), f1(math.pi/6), f2(math.pi/6), f3(math.pi/6), f4(math.pi/6), f5(math.pi/6), f6(math.pi/6), f7(math.pi/6)]\n",
+ "S1=0\n",
+ "h=math.pi/6\n",
+ "print \"order of approximation computed value of sin(pi/3) absolute eror\\n\\n\"\n",
+ "for j in range(1,10):\n",
+ " for i in range(1,j):\n",
+ " S1=S1+math.pow(h,i-1)*D[i]/math.factorial(i-1) \n",
+ " print \"%d %0.9f %0.9f\\n\" %(j,S1,abs(math.sin(math.pi/3)-S1))\n",
+ " S1=0\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "order of approximation computed value of sin(pi/3) absolute eror\n",
+ "\n",
+ "\n",
+ "1 0.000000000 0.866025404\n",
+ "\n",
+ "2 0.500000000 0.366025404\n",
+ "\n",
+ "3 0.953449841 0.087424437\n",
+ "\n",
+ "4 0.884910922 0.018885518\n",
+ "\n",
+ "5 0.864191614 0.001833790\n",
+ "\n",
+ "6 0.865757475 0.000267929\n",
+ "\n",
+ "7 0.866041490 0.000016087\n",
+ "\n",
+ "8 0.866027181 0.000001777\n",
+ "\n",
+ "9 0.866025327 0.000000077\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.14:pg-18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#maclaurins expansion\n",
+ "#example 1.14\n",
+ "#page 18\n",
+ "import math\n",
+ "n=8 #correct to 8 decimal places\n",
+ "x=1\n",
+ "for i in range(1,50):\n",
+ " if x/math.factorial(i)<math.pow(10,-8)/2:\n",
+ " c=i\n",
+ " break \n",
+ "print \"no. of terms needed to correct to 8 decimal places is : %d \" %(c)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "no. of terms needed to correct to 8 decimal places is : 2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.15:pg-18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#series apprixamation\n",
+ "#example 1.15\n",
+ "#page 18\n",
+ "import math\n",
+ "x=.09090909 # 1/11 =.09090909\n",
+ "S1=0\n",
+ "for i in range(1,5,2):\n",
+ " S1=S1+math.pow(x,i)/i\n",
+ "print \"value of log(1.2) is : %0.8f\\n\\n\" %(2*S1)\n",
+ "c=0\n",
+ "for i in range(1,50):\n",
+ " if math.pow(.09090909,i)/i<2*math.pow(10,-7):\n",
+ " c=i\n",
+ " break\n",
+ "print \"min no of terms needed to get value wuth same accuracy is :%d\" %(c)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "value of log(1.2) is : 0.18231906\n",
+ "\n",
+ "\n",
+ "min no of terms needed to get value wuth same accuracy is :6\n"
+ ]
+ }
+ ],
+ "prompt_number": 74
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter2_(1).ipynb b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter2_(1).ipynb
new file mode 100644
index 00000000..eedd9e7d
--- /dev/null
+++ b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter2_(1).ipynb
@@ -0,0 +1,2188 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:dc70a89f56576070d6e170e43234641fb7b9652a8d7eff402826fb543d9ee1c5"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter02:Solution of Algebric and Transcendental Equations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.1:pg-24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.1\n",
+ "#bisection method\n",
+ "#page 24\n",
+ "import math\n",
+ "def f(x):\n",
+ " return math.pow(x,3)-x-1\n",
+ "x1=1\n",
+ "x2=2 #f(1) is negative and f(2) is positive\n",
+ "d=0.0001 #for accuracy of root\n",
+ "c=1\n",
+ "print \"Succesive approximations \\t x1\\t \\tx2\\t \\tm\\t \\tf(m)\\n\"\n",
+ "while abs(x1-x2)>d:\n",
+ " \n",
+ " m=(x1+x2)/2.0\n",
+ " print \" \\t%f\\t%f\\t%f\\t%f\\n\" %(x1,x2,m,f(m))\n",
+ " if f(m)*f(x1)>0.0:\n",
+ " x1=m\n",
+ " else:\n",
+ " x2=m \n",
+ " c=c+1 # to count number of iterations \n",
+ "print \"the solution of equation after %i iteration is %g\" %(c,m)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Succesive approximations \t x1\t \tx2\t \tm\t \tf(m)\n",
+ "\n",
+ " \t1.000000\t2.000000\t1.500000\t0.875000\n",
+ "\n",
+ " \t1.000000\t1.500000\t1.250000\t-0.296875\n",
+ "\n",
+ " \t1.250000\t1.500000\t1.375000\t0.224609\n",
+ "\n",
+ " \t1.250000\t1.375000\t1.312500\t-0.051514\n",
+ "\n",
+ " \t1.312500\t1.375000\t1.343750\t0.082611\n",
+ "\n",
+ " \t1.312500\t1.343750\t1.328125\t0.014576\n",
+ "\n",
+ " \t1.312500\t1.328125\t1.320312\t-0.018711\n",
+ "\n",
+ " \t1.320312\t1.328125\t1.324219\t-0.002128\n",
+ "\n",
+ " \t1.324219\t1.328125\t1.326172\t0.006209\n",
+ "\n",
+ " \t1.324219\t1.326172\t1.325195\t0.002037\n",
+ "\n",
+ " \t1.324219\t1.325195\t1.324707\t-0.000047\n",
+ "\n",
+ " \t1.324707\t1.325195\t1.324951\t0.000995\n",
+ "\n",
+ " \t1.324707\t1.324951\t1.324829\t0.000474\n",
+ "\n",
+ " \t1.324707\t1.324829\t1.324768\t0.000214\n",
+ "\n",
+ "the solution of equation after 15 iteration is 1.32477'\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.2:pg-25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.2\n",
+ "#bisection method\n",
+ "#page 25\n",
+ "import math\n",
+ "def f(x):\n",
+ " return math.pow(x,3)-2*x-5\n",
+ "x1=2 \n",
+ "x2=3 #f(2) is negative and f(3) is positive\n",
+ "d=0.0001 #for accuracy of root\n",
+ "c=1\n",
+ "print \"Succesive approximations \\t x1\\t \\tx2\\t \\tm\\t \\tf(m)\\n\"\n",
+ "while abs(x1-x2)>d:\n",
+ " m=(x1+x2)/2.0\n",
+ " print \" \\t%f\\t%f\\t%f\\t%f\\n\" %(x1,x2,m,f(m))\n",
+ " if f(m)*f(x1)>0:\n",
+ " x1=m\n",
+ " else:\n",
+ " x2=m \n",
+ " c=c+1;# to count number of iterations \n",
+ "print \"the solution of equation after %i iteration is %0.4g\" %(c,m)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Succesive approximations \t x1\t \tx2\t \tm\t \tf(m)\n",
+ "\n",
+ " \t2.000000\t3.000000\t2.500000\t5.625000\n",
+ "\n",
+ " \t2.000000\t2.500000\t2.250000\t1.890625\n",
+ "\n",
+ " \t2.000000\t2.250000\t2.125000\t0.345703\n",
+ "\n",
+ " \t2.000000\t2.125000\t2.062500\t-0.351318\n",
+ "\n",
+ " \t2.062500\t2.125000\t2.093750\t-0.008942\n",
+ "\n",
+ " \t2.093750\t2.125000\t2.109375\t0.166836\n",
+ "\n",
+ " \t2.093750\t2.109375\t2.101562\t0.078562\n",
+ "\n",
+ " \t2.093750\t2.101562\t2.097656\t0.034714\n",
+ "\n",
+ " \t2.093750\t2.097656\t2.095703\t0.012862\n",
+ "\n",
+ " \t2.093750\t2.095703\t2.094727\t0.001954\n",
+ "\n",
+ " \t2.093750\t2.094727\t2.094238\t-0.003495\n",
+ "\n",
+ " \t2.094238\t2.094727\t2.094482\t-0.000771\n",
+ "\n",
+ " \t2.094482\t2.094727\t2.094604\t0.000592\n",
+ "\n",
+ " \t2.094482\t2.094604\t2.094543\t-0.000090\n",
+ "\n",
+ "the solution of equation after 15 iteration is 2.095\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.3:pg-26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.3\n",
+ "#bisection method\n",
+ "#page 26\n",
+ "import math\n",
+ "def f(x):\n",
+ " return math.pow(x,3)+math.pow(x,2)+x+7\n",
+ "x1=-3\n",
+ "x2=-2 #f(-3) is negative and f(-2) is positive\n",
+ "d=0.0001 #for accuracy of root\n",
+ "c=1\n",
+ "print \"Succesive approximations \\t x1\\t \\tx2\\t \\tm\\t \\tf(m)\\n\"\n",
+ "while abs(x1-x2)>d:\n",
+ " m=(x1+x2)/2.0\n",
+ " print \" \\t%f\\t%f\\t%f\\t%f\\n\" %(x1,x2,m,f(m))\n",
+ " if f(m)*f(x1)>0:\n",
+ " x1=m\n",
+ " else:\n",
+ " x2=m \n",
+ " c=c+1 # to count number of iterations \n",
+ "print \"the solution of equation after %i iteration is %0.4g\" %(c,m)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Succesive approximations \t x1\t \tx2\t \tm\t \tf(m)\n",
+ "\n",
+ " \t-3.000000\t-2.000000\t-2.500000\t-4.875000\n",
+ "\n",
+ " \t-2.500000\t-2.000000\t-2.250000\t-1.578125\n",
+ "\n",
+ " \t-2.250000\t-2.000000\t-2.125000\t-0.205078\n",
+ "\n",
+ " \t-2.125000\t-2.000000\t-2.062500\t0.417725\n",
+ "\n",
+ " \t-2.125000\t-2.062500\t-2.093750\t0.111481\n",
+ "\n",
+ " \t-2.125000\t-2.093750\t-2.109375\t-0.045498\n",
+ "\n",
+ " \t-2.109375\t-2.093750\t-2.101562\t0.033315\n",
+ "\n",
+ " \t-2.109375\t-2.101562\t-2.105469\t-0.006010\n",
+ "\n",
+ " \t-2.105469\t-2.101562\t-2.103516\t0.013673\n",
+ "\n",
+ " \t-2.105469\t-2.103516\t-2.104492\t0.003836\n",
+ "\n",
+ " \t-2.105469\t-2.104492\t-2.104980\t-0.001086\n",
+ "\n",
+ " \t-2.104980\t-2.104492\t-2.104736\t0.001376\n",
+ "\n",
+ " \t-2.104980\t-2.104736\t-2.104858\t0.000145\n",
+ "\n",
+ " \t-2.104980\t-2.104858\t-2.104919\t-0.000470\n",
+ "\n",
+ "the solution of equation after 15 iteration is -2.105\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.4:pg-26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.4\n",
+ "#bisection method\n",
+ "#page 26\n",
+ "import math\n",
+ "def f(x):\n",
+ " return x*math.exp(x)-1\n",
+ "x1=0 \n",
+ "x2=1 #f(0) is negative and f(1) is positive\n",
+ "d=0.0005 #maximun tolerance value\n",
+ "c=1\n",
+ "print \"Succesive approximations \\t x1\\t \\tx2\\t \\tm\\t \\ttol\\t \\tf(m)\\n\"\n",
+ "while abs((x2-x1)/x2)>d:\n",
+ " m=(x1+x2)/2.0 #tolerance value for each iteration\n",
+ " tol=((x2-x1)/x2)*100\n",
+ " print \" \\t%f\\t%f\\t%f\\t%f\\t%f\\n\" %(x1,x2,m,tol,f(m))\n",
+ " if f(m)*f(x1)>0:\n",
+ " x1=m\n",
+ " else:\n",
+ " x2=m \n",
+ " c=c+1 # to count number of iterations \n",
+ "print \"the solution of equation after %i iteration is %0.4g\" %(c,m)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Succesive approximations \t x1\t \tx2\t \tm\t \ttol\t \tf(m)\n",
+ "\n",
+ " \t0.000000\t1.000000\t0.500000\t100.000000\t-0.175639\n",
+ "\n",
+ " \t0.500000\t1.000000\t0.750000\t50.000000\t0.587750\n",
+ "\n",
+ " \t0.500000\t0.750000\t0.625000\t33.333333\t0.167654\n",
+ "\n",
+ " \t0.500000\t0.625000\t0.562500\t20.000000\t-0.012782\n",
+ "\n",
+ " \t0.562500\t0.625000\t0.593750\t10.000000\t0.075142\n",
+ "\n",
+ " \t0.562500\t0.593750\t0.578125\t5.263158\t0.030619\n",
+ "\n",
+ " \t0.562500\t0.578125\t0.570312\t2.702703\t0.008780\n",
+ "\n",
+ " \t0.562500\t0.570312\t0.566406\t1.369863\t-0.002035\n",
+ "\n",
+ " \t0.566406\t0.570312\t0.568359\t0.684932\t0.003364\n",
+ "\n",
+ " \t0.566406\t0.568359\t0.567383\t0.343643\t0.000662\n",
+ "\n",
+ " \t0.566406\t0.567383\t0.566895\t0.172117\t-0.000687\n",
+ "\n",
+ " \t0.566895\t0.567383\t0.567139\t0.086059\t-0.000013\n",
+ "\n",
+ "the solution of equation after 13 iteration is 0.5671\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.5:pg-27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.5\n",
+ "#bisection method\n",
+ "#page 27\n",
+ "import math\n",
+ "def f(x):\n",
+ " return 4*math.exp(-x)*math.sin(x)-1\n",
+ "x1=0 \n",
+ "x2=0.5 #f(0) is negative and f(1) is positive\n",
+ "d=0.0001 #for accuracy of root\n",
+ "c=1 \n",
+ "print \"Succesive approximations \\t x1\\t \\tx2\\t \\tm\\t \\t \\tf(m)\\n\"\n",
+ "while abs(x2-x1)>d:\n",
+ " m=(x1+x2)/2.0\n",
+ " print \" \\t%f\\t%f\\t%f\\t%f\\n\" %(x1,x2,m,f(m))\n",
+ " if f(m)*f(x1)>0:\n",
+ " x1=m\n",
+ " else:\n",
+ " x2=m \n",
+ " c=c+1 # to count number of iterations \n",
+ "print \"the solution of equation after %i iteration is %0.3g\" %(c,m)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Succesive approximations \t x1\t \tx2\t \tm\t \t \tf(m)\n",
+ "\n",
+ " \t0.000000\t0.500000\t0.250000\t-0.229286\n",
+ "\n",
+ " \t0.250000\t0.500000\t0.375000\t0.006941\n",
+ "\n",
+ " \t0.250000\t0.375000\t0.312500\t-0.100293\n",
+ "\n",
+ " \t0.312500\t0.375000\t0.343750\t-0.044068\n",
+ "\n",
+ " \t0.343750\t0.375000\t0.359375\t-0.017925\n",
+ "\n",
+ " \t0.359375\t0.375000\t0.367188\t-0.005334\n",
+ "\n",
+ " \t0.367188\t0.375000\t0.371094\t0.000842\n",
+ "\n",
+ " \t0.367188\t0.371094\t0.369141\t-0.002236\n",
+ "\n",
+ " \t0.369141\t0.371094\t0.370117\t-0.000694\n",
+ "\n",
+ " \t0.370117\t0.371094\t0.370605\t0.000075\n",
+ "\n",
+ " \t0.370117\t0.370605\t0.370361\t-0.000310\n",
+ "\n",
+ " \t0.370361\t0.370605\t0.370483\t-0.000118\n",
+ "\n",
+ " \t0.370483\t0.370605\t0.370544\t-0.000022\n",
+ "\n",
+ "the solution of equation after 14 iteration is 0.371\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.6:pg-28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.6\n",
+ "#false position method\n",
+ "#page 28\n",
+ "import math\n",
+ "def f(x):\n",
+ " return x**3-2*x-5\n",
+ "a=2.0\n",
+ "b=3.0 #f(2) is negative and f(3)is positive\n",
+ "d=0.00001\n",
+ "print \"succesive iterations \\ta\\t b\\t f(a)\\t f(b)\\t\\ x1\\n\"\n",
+ "for i in range(1,25):\n",
+ " x1=b*f(a)/(f(a)-f(b))+a*f(b)/(f(b)-f(a))\n",
+ " if(f(a)*f(x1))>0:\n",
+ " b=x1\n",
+ " else:\n",
+ " a=x1\n",
+ " if abs(f(x1))<d:\n",
+ " break\n",
+ " print \" \\t%f %f %f %f %f\\n\" %(a,b,f(a),f(b),x1)\n",
+ "print \"the root of the equation is %f\" %(x1)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "succesive iterations \ta\t b\t f(a)\t f(b)\t\\ x1\n",
+ "\n",
+ " \t2.000000 2.058824 -1.000000 -0.390800 2.058824\n",
+ "\n",
+ " \t2.096559 2.058824 0.022428 -0.390800 2.096559\n",
+ "\n",
+ " \t2.094511 2.058824 -0.000457 -0.390800 2.094511\n",
+ "\n",
+ "the root of the equation is 2.094552\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.7:pg-29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.7\n",
+ "#false position method\n",
+ "#page 29\n",
+ "def f(x):\n",
+ " return x**2.2-69\n",
+ "a=5.0\n",
+ "b=6.0 #f(5) is negative and f(6)is positive\n",
+ "d=0.00001\n",
+ "print \"succesive iterations \\ta\\t b\\t f(a)\\t f(b)\\t\\ x1\\n\"\n",
+ "for i in range(1,25):\n",
+ " x1=b*f(a)/(f(a)-f(b))+a*f(b)/(f(b)-f(a));\n",
+ " if(f(a)*f(x1))>0:\n",
+ " b=x1\n",
+ " else:\n",
+ " a=x1\n",
+ " if abs(f(x1))<d:\n",
+ " break\n",
+ " print \" \\t%f %f %f %f %f\\n\" %(a,b,f(a),f(b),x1)\n",
+ "print \"the root of the equation is %f\" %(x1)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "succesive iterations \ta\t b\t f(a)\t f(b)\t\\ x1\n",
+ "\n",
+ " \t7.027228 6.000000 3.933141 -17.485113 7.027228\n",
+ "\n",
+ " \t6.838593 6.000000 -0.304723 -17.485113 6.838593\n",
+ "\n",
+ " \t6.853467 6.000000 0.024411 -17.485113 6.853467\n",
+ "\n",
+ " \t6.852277 6.000000 -0.001950 -17.485113 6.852277\n",
+ "\n",
+ " \t6.852372 6.000000 0.000156 -17.485113 6.852372\n",
+ "\n",
+ " \t6.852365 6.000000 -0.000012 -17.485113 6.852365\n",
+ "\n",
+ "the root of the equation is 6.852365\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.8:pg-29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.8\n",
+ "#false position method\n",
+ "#page 29\n",
+ "import math\n",
+ "def f(x):\n",
+ " return 2*x-log10(x)-7\n",
+ "a=3.0\n",
+ "b=4.0 #f(3) is negative and f(4)is positive\n",
+ "d=0.00001\n",
+ "print \"succesive iterations \\ta \\t b\\t f(a)\\t f(b)\\t x1\\n\"\n",
+ "for i in range(1,25):\n",
+ " x1=b*f(a)/(f(a)-f(b))+a*f(b)/(f(b)-f(a))\n",
+ " if(f(a)*f(x1))>0:\n",
+ " b=x1\n",
+ " else:\n",
+ " a=x1\n",
+ " if abs(f(x1))<d:\n",
+ " break\n",
+ " print \" \\t%f %f %f %f %f\\n\" %(a,b,f(a),f(b),x1)\n",
+ "print \"the root of the equation is %0.4g\" %(x1)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "succesive iterations \ta \t b\t f(a)\t f(b)\t x1\n",
+ "\n",
+ " \t3.000000 3.787772 -1.477121 -0.002839 3.787772\n",
+ "\n",
+ " \t3.789289 3.787772 0.000021 -0.002839 3.789289\n",
+ "\n",
+ "the root of the equation is 3.789\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.9:pg-30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.9\n",
+ "#false position method\n",
+ "#page 30\n",
+ "import math\n",
+ "def f(x):\n",
+ " return 4*math.exp(-x)*math.sin(x)-1\n",
+ "a=0.0\n",
+ "b=0.5 #f(0) is negative and f(0.5)is positive\n",
+ "d=0.00001\n",
+ "print \"succesive iterations \\ta\\t b\\t f(a)\\t f(b)\\t\\ x1\\n\"\n",
+ "for i in range(1,25):\n",
+ " x1=b*f(a)/(f(a)-f(b))+a*f(b)/(f(b)-f(a))\n",
+ " if(f(a)*f(x1))>0:\n",
+ " b=x1\n",
+ " else:\n",
+ " a=x1\n",
+ " if abs(f(x1))<d:\n",
+ " break\n",
+ " print \" \\t%f %f %f %f %f\\n\" %(a,b,f(a),f(b),x1)\n",
+ "print \"the root of the equation is %f\" %(x1)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "succesive iterations \ta\t b\t f(a)\t f(b)\t\\ x1\n",
+ "\n",
+ " \t0.429869 0.500000 0.084545 0.163145 0.429869\n",
+ "\n",
+ " \t0.354433 0.500000 -0.026054 0.163145 0.354433\n",
+ "\n",
+ " \t0.374479 0.500000 0.006132 0.163145 0.374479\n",
+ "\n",
+ " \t0.369577 0.500000 -0.001547 0.163145 0.369577\n",
+ "\n",
+ " \t0.370802 0.500000 0.000384 0.163145 0.370802\n",
+ "\n",
+ " \t0.370497 0.500000 -0.000096 0.163145 0.370497\n",
+ "\n",
+ " \t0.370573 0.500000 0.000024 0.163145 0.370573\n",
+ "\n",
+ "the root of the equation is 0.370554\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.10:pg-33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.10\n",
+ "#iteration method\n",
+ "#page 33\n",
+ "import math\n",
+ "def f(x):\n",
+ " return 1/(math.sqrt(x+1))\n",
+ "x1=0.75\n",
+ "x2=0.0\n",
+ "n=1\n",
+ "d=0.0001 #accuracy opto 10^-4\n",
+ "c=0 #to count no of iterations \n",
+ "print \"successive iterations \\t\\x01\\tf(x1)\\n\"\n",
+ "while abs(x1-x2)>d:\n",
+ " print \" \\t%f %f\\n\" %(x1,f(x1))\n",
+ " x2=x1\n",
+ " x1=f(x1)\n",
+ " c=c+1\n",
+ "print \" the root of the eqaution after %i iteration is %0.4g\" %(c,x1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "successive iterations \t\u0001\tf(x1)\n",
+ "\n",
+ " \t0.750000 0.755929\n",
+ "\n",
+ " \t0.755929 0.754652\n",
+ "\n",
+ " \t0.754652 0.754926\n",
+ "\n",
+ " \t0.754926 0.754867\n",
+ "\n",
+ " the root of the eqaution after 4 iteration is 0.7549\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.11:pg-34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.11\n",
+ "#iteration method\n",
+ "#page34\n",
+ "import math\n",
+ "def f(x):\n",
+ " return cos(x)/2.0+3.0/2.0\n",
+ "x1=1.5 # as roots lies between 3/2 and pi/2\n",
+ "x2=0\n",
+ "d=0.0001 # accuracy opto 10^-4\n",
+ "c=0 # to count no of iterations \n",
+ "print \"successive iterations \\t\\x01\\tf(x1)\\n\"\n",
+ "while abs(x2-x1)>d:\n",
+ " \n",
+ " print \" \\t%f %f\\n\" %(x1,f(x1))\n",
+ " x2=x1\n",
+ " x1=f(x1)\n",
+ " c=c+1\n",
+ "print \" the root of the eqaution after %i iteration is %0.4g\" %(c,x1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "successive iterations \t\u0001\tf(x1)\n",
+ "\n",
+ " \t1.500000 1.535369\n",
+ "\n",
+ " \t1.535369 1.517710\n",
+ "\n",
+ " \t1.517710 1.526531\n",
+ "\n",
+ " \t1.526531 1.522126\n",
+ "\n",
+ " \t1.522126 1.524326\n",
+ "\n",
+ " \t1.524326 1.523227\n",
+ "\n",
+ " \t1.523227 1.523776\n",
+ "\n",
+ " \t1.523776 1.523502\n",
+ "\n",
+ " \t1.523502 1.523639\n",
+ "\n",
+ " \t1.523639 1.523570\n",
+ "\n",
+ " the root of the eqaution after 10 iteration is 1.524\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.12:pg-35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.12\n",
+ "#iteration method\n",
+ "#page 35\n",
+ "import math\n",
+ "def f(x):\n",
+ " return math.exp(-x)\n",
+ "x1=1.5 # as roots lies between 0 and 1\n",
+ "x2=0\n",
+ "d=0.0001 # accuracy opto 10^-4\n",
+ "c=0 # to count no of iterations \n",
+ "print \"successive iterations \\t x1 \\t f(x1)\\n\"\n",
+ "while abs(x2-x1)>d:\n",
+ " \n",
+ " print \" \\t%f %f\\n\" %(x1,f(x1))\n",
+ " x2=x1\n",
+ " x1=f(x1)\n",
+ " c=c+1\n",
+ "print \" the root of the eqaution after %i iteration is %0.4g\" %(c,x1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "successive iterations \t x1 \t f(x1)\n",
+ "\n",
+ " \t1.500000 0.223130\n",
+ "\n",
+ " \t0.223130 0.800011\n",
+ "\n",
+ " \t0.800011 0.449324\n",
+ "\n",
+ " \t0.449324 0.638059\n",
+ "\n",
+ " \t0.638059 0.528317\n",
+ "\n",
+ " \t0.528317 0.589597\n",
+ "\n",
+ " \t0.589597 0.554551\n",
+ "\n",
+ " \t0.554551 0.574330\n",
+ "\n",
+ " \t0.574330 0.563082\n",
+ "\n",
+ " \t0.563082 0.569451\n",
+ "\n",
+ " \t0.569451 0.565836\n",
+ "\n",
+ " \t0.565836 0.567885\n",
+ "\n",
+ " \t0.567885 0.566723\n",
+ "\n",
+ " \t0.566723 0.567382\n",
+ "\n",
+ " \t0.567382 0.567008\n",
+ "\n",
+ " \t0.567008 0.567220\n",
+ "\n",
+ " \t0.567220 0.567100\n",
+ "\n",
+ " \t0.567100 0.567168\n",
+ "\n",
+ " the root of the eqaution after 18 iteration is 0.5672\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.13:pg-35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.13\n",
+ "#iteration method\n",
+ "#page 35\n",
+ "import math\n",
+ "def f(x):\n",
+ " return 1+math.sin(x)/10\n",
+ "x1=1.0 # as roots lies between 1 and pi evident from graph\n",
+ "x2=0\n",
+ "d=0.0001 # accuracy opto 10^-4\n",
+ "c=0 # to count no of iterations \n",
+ "print \"successive iterations \\t x1 \\t f(x1)\\n\"\n",
+ "while abs(x2-x1)>d:\n",
+ " print \" \\t%f %f\\n\" %(x1,f(x1))\n",
+ " x2=x1\n",
+ " x1=f(x1)\n",
+ " c=c+1\n",
+ "print \" the root of the eqaution after %i iteration is %0.4g\" %(c,x1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "successive iterations \t x1 \t f(x1)\n",
+ "\n",
+ " \t1.000000 1.084147\n",
+ "\n",
+ " \t1.084147 1.088390\n",
+ "\n",
+ " \t1.088390 1.088588\n",
+ "\n",
+ " \t1.088588 1.088597\n",
+ "\n",
+ " the root of the eqaution after 4 iteration is 1.089\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.14:pg-36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.14\n",
+ "#aitken's process\n",
+ "#page 36\n",
+ "import math\n",
+ "def f(x):\n",
+ " return 1.5+math.cos(x)/2.0\n",
+ "x0=1.5\n",
+ "y=0\n",
+ "e=0.0001\n",
+ "c=0\n",
+ "print \"successive iterations \\t x0 \\t x1 \\t x2 \\t x3 \\t y\\n\"\n",
+ "for i in range(1,10):\n",
+ " x1=f(x0)\n",
+ " x2=f(x1)\n",
+ " x3=f(x2)\n",
+ " y=x3-((x3-x2)**2)/(x3-2*x2+x1)\n",
+ " d=y-x0\n",
+ " x0=y\n",
+ " if abs(f(x0))<e:\n",
+ " break\n",
+ " c=c+1\n",
+ " print \" \\t%f %f %f %f %f\\n\" %(x0,x1,x2,x3,y)\n",
+ "print \"the root of the equation after %i iteration is %f\" %(c,y)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "successive iterations \t x0 \t x1 \t x2 \t x3 \t y\n",
+ "\n",
+ " \t1.523592 1.535369 1.517710 1.526531 1.523592\n",
+ "\n",
+ " \t1.523593 1.523593 1.523593 1.523593 1.523593\n",
+ "\n",
+ " \t1.523593 1.523593 1.523593 1.523593 1.523593\n",
+ "\n",
+ " \t1.523593 1.523593 1.523593 1.523593 1.523593\n",
+ "\n",
+ " \t1.523593 1.523593 1.523593 1.523593 1.523593\n",
+ "\n",
+ " \t1.523593 1.523593 1.523593 1.523593 1.523593\n",
+ "\n",
+ " \t1.523593 1.523593 1.523593 1.523593 1.523593\n",
+ "\n",
+ " \t1.523593 1.523593 1.523593 1.523593 1.523593\n",
+ "\n",
+ " \t1.523593 1.523593 1.523593 1.523593 1.523593\n",
+ "\n",
+ "the root of the equation after 9 iteration is 1.523593\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.15:pg-39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.15\n",
+ "#newton-raphson method\n",
+ "#page 39\n",
+ "import math\n",
+ "def f(x):\n",
+ " return x**3-2*x-5\n",
+ "def f1(x):\n",
+ " return 3*x**2-2 # first derivative of the function\n",
+ "x0=2.0 # initial value\n",
+ "d=0.0001\n",
+ "c=0\n",
+ "n=1\n",
+ "print \"successive iterations \\t x0 \\t f(x0) \\t f1(x0)\\n\"\n",
+ "while n==1:\n",
+ " x2=x0\n",
+ " x1=x0-(f(x0)/f1(x0))\n",
+ " x0=x1\n",
+ " print \" \\t%f \\t%f \\t%f \\n\" %(x2,f(x1),f1(x1))\n",
+ " c=c+1\n",
+ " if abs(f(x0))<d:\n",
+ " break\n",
+ "print \"the root of %i iteration is:%f\" %(c,x0)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "successive iterations \t x0 \t f(x0) \t f1(x0)\n",
+ "\n",
+ " \t2.000000 \t0.061000 \t11.230000 \n",
+ "\n",
+ " \t2.100000 \t0.000186 \t11.161647 \n",
+ "\n",
+ " \t2.094568 \t0.000000 \t11.161438 \n",
+ "\n",
+ "the root of 3 iteration is:2.094551\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.16:pg-40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.16\n",
+ "#newton-raphson method\n",
+ "#page 40\n",
+ "import math\n",
+ "def f(x):\n",
+ " return x*math.sin(x)+math.cos(x)\n",
+ "def f1(x):\n",
+ " return x*math.cos(x) #first derivation of the function\n",
+ "x0=math.pi # initial value\n",
+ "d=0.0001\n",
+ "c=0 \n",
+ "n=1\n",
+ "print \"successive iterations \\tx0\\t f(x0)\\t f1(x0)\\n\"\n",
+ "while n==1:\n",
+ " x2=x0\n",
+ " x1=x0-(f(x0)/f1(x0))\n",
+ " x0=x1\n",
+ " print \" \\t%f \\t%f \\t%f\\n\" %(x2,f(x1),f1(x1))\n",
+ " c=c+1\n",
+ " if abs(f(x0))<d:\n",
+ " break\n",
+ "print \"the root of %i iteration is:%f\" %(c,x0)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "successive iterations \tx0\t f(x0)\t f1(x0)\n",
+ "\n",
+ " \t3.141593 \t-0.066186 \t-2.681457\n",
+ "\n",
+ " \t2.823283 \t-0.000564 \t-2.635588\n",
+ "\n",
+ " \t2.798600 \t-0.000000 \t-2.635185\n",
+ "\n",
+ "the root of 3 iteration is:2.798386\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.17:pg-40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.17\n",
+ "#newton-raphson method\n",
+ "#page 40\n",
+ "import math\n",
+ "def f(x):\n",
+ " return x*math.exp(x)-1\n",
+ "def f1(x):\n",
+ " return math.exp(x)+x*math.exp(x) #first derivative of the function\n",
+ "x0=0 # initial value\n",
+ "d=0.0001 \n",
+ "c=0\n",
+ "n=1\n",
+ "print \"successive iterations \\tx0\\t f(x0)\\t f1(x0)\\n\"\n",
+ "while n==1:\n",
+ " x2=x0\n",
+ " x1=x0-(f(x0)/f1(x0))\n",
+ " x0=x1\n",
+ " print \" \\t%f \\t%f \\t%f\\n\" %(x2,f(x1),f1(x1))\n",
+ " c=c+1\n",
+ " if abs(f(x0))<d:\n",
+ " break\n",
+ "print \"the root of %i iteration is:%f\" %(c,x0)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "successive iterations \tx0\t f(x0)\t f1(x0)\n",
+ "\n",
+ " \t0.000000 \t1.718282 \t5.436564\n",
+ "\n",
+ " \t1.000000 \t0.355343 \t3.337012\n",
+ "\n",
+ " \t0.683940 \t0.028734 \t2.810232\n",
+ "\n",
+ " \t0.577454 \t0.000239 \t2.763614\n",
+ "\n",
+ " \t0.567230 \t0.000000 \t2.763223\n",
+ "\n",
+ "the root of 5 iteration is:0.567143\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.18:pg-41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.18\n",
+ "#newton-raphson method\n",
+ "#page 41\n",
+ "import math\n",
+ "def f(x):\n",
+ " return math.sin(x)-x/2.0\n",
+ "def f1(x):\n",
+ " return math.cos(x)-0.5\n",
+ "x0=math.pi/2.0 # initial value\n",
+ "d=0.0001\n",
+ "c=0\n",
+ "n=1\n",
+ "print \"successive iterations \\t x0 \\t f(x0)\\t f1(x0)\\n\"\n",
+ "while n==1:\n",
+ " x2=x0\n",
+ " x1=x0-(f(x0)/f1(x0))\n",
+ " x0=x1\n",
+ " print \" \\t%f\\t%f\\t%f\\n\" %(x2,f(x1),f1(x1))\n",
+ " c=c+1\n",
+ " if abs(f(x0))<d:\n",
+ " break\n",
+ "print \"the root of %i iteration is: %0.4g\" %(c,x0)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "successive iterations \t x0 \t f(x0)\t f1(x0)\n",
+ "\n",
+ " \t1.570796\t-0.090703\t-0.916147\n",
+ "\n",
+ " \t2.000000\t-0.004520\t-0.824232\n",
+ "\n",
+ " \t1.900996\t-0.000014\t-0.819039\n",
+ "\n",
+ "the root of 3 iteration is: 1.896\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.19:pg-41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.19\n",
+ "#newton-raphson method\n",
+ "#page 41\n",
+ "import math\n",
+ "def f(x):\n",
+ " return 4*math.exp(-x)*math.sin(x)-1\n",
+ "def f1(x):\n",
+ " return math.cos(x)*4*math.exp(-x)-4*math.exp(-x)*math.sin(x)\n",
+ "x0=0.2 # initial value\n",
+ "d=0.0001\n",
+ "c=0 \n",
+ "n=1\n",
+ "print \"successive iterations \\t x0 \\t f(x0)\\t f1(x0)\\n\"\n",
+ "while n==1:\n",
+ " x2=x0\n",
+ " x1=x0-(f(x0)/f1(x0))\n",
+ " x0=x1\n",
+ " print \" \\t%f \\t%f \\t%f\\n\" %(x2,f(x1),f1(x1))\n",
+ " c=c+1\n",
+ " if abs(f(x0))<d:\n",
+ " break \n",
+ "print \"the root of %i iteration is: %0.3g\" %(c,x0)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "successive iterations \t x0 \t f(x0)\t f1(x0)\n",
+ "\n",
+ " \t0.200000 \t-0.056593 \t1.753325\n",
+ "\n",
+ " \t0.336526 \t-0.002769 \t1.583008\n",
+ "\n",
+ " \t0.368804 \t-0.000008 \t1.573993\n",
+ "\n",
+ "the root of 3 iteration is: 0.371\n"
+ ]
+ }
+ ],
+ "prompt_number": 54
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.20:pg-42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.20\n",
+ "#generalized newton-raphson method\n",
+ "#page 42\n",
+ "import math\n",
+ "def f(x):\n",
+ " return x**3-x**2-x+1\n",
+ "def f1(x):\n",
+ " return 3*x**2-2*x-1\n",
+ "def f2(x):\n",
+ " return 6*x-2\n",
+ "x0=0.8 # initial value to finf double root\n",
+ "n=1 \n",
+ "print \"successive iterations \\t x0 \\t x1\\t x2\\n\"\n",
+ "while n==1:\n",
+ " x1=x0-(f(x0)/f1(x0));\n",
+ " x2=x0-(f1(x0)/f2(x0));\n",
+ " if abs(x1-x2)<0.000000001:\n",
+ " x0=(x1+x2)/2.0\n",
+ " break\n",
+ " else:\n",
+ " x0=(x1+x2)/2;\n",
+ " print \" %f\\t %f\\t %f\\n\" %(x0,x1,x2)\n",
+ "print \"\\n \\nthe double root is at: %f\" %(x0)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "successive iterations \t x0 \t x1\t x2\n",
+ "\n",
+ " 0.974370\t 0.905882\t 1.042857\n",
+ "\n",
+ " 0.993890\t 0.987269\t 1.000512\n",
+ "\n",
+ " 0.998489\t 0.996950\t 1.000028\n",
+ "\n",
+ " 0.999623\t 0.999245\t 1.000002\n",
+ "\n",
+ " 0.999906\t 0.999812\t 1.000000\n",
+ "\n",
+ " 0.999976\t 0.999953\t 1.000000\n",
+ "\n",
+ " 0.999994\t 0.999988\t 1.000000\n",
+ "\n",
+ " 0.999999\t 0.999997\t 1.000000\n",
+ "\n",
+ " 1.000000\t 0.999999\t 1.000000\n",
+ "\n",
+ " 1.000000\t 1.000000\t 1.000000\n",
+ "\n",
+ " 1.000000\t 1.000000\t 1.000000\n",
+ "\n",
+ " 1.000000\t 1.000000\t 1.000000\n",
+ "\n",
+ " 1.000000\t 1.000000\t 1.000000\n",
+ "\n",
+ "\n",
+ " \n",
+ "the double root is at: 1.000000\n"
+ ]
+ }
+ ],
+ "prompt_number": 57
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.21:pg-45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#ramanujan's method\n",
+ "#example 2.21\n",
+ "#page 45\n",
+ "def f(x):\n",
+ " return 1-(13.0/12.0)*x-(3.0/8.0)*x**2+(1.0/24.0)*x**3\n",
+ "a1=13.0/12.0\n",
+ "a2=-3.0/8.0\n",
+ "a3=1.0/24.0\n",
+ "b1=1\n",
+ "b2=a1\n",
+ "b3=a1*b2+a2*b1\n",
+ "b4=a1*b3+a2*b2+a3*b1\n",
+ "b5=a1*b4+a2*b3+a3*b2\n",
+ "b6=a1*b5+a2*b4+a3*b3\n",
+ "b7=a1*b6+a2*b5+a3*b4\n",
+ "b8=a1*b7+a2*b6+a3*b5\n",
+ "b9=a1*b8+a2*b7+a3*b6\n",
+ "print \"\\n\\n%f\" %(b1/b2)\n",
+ "print \"\\n%f\" %(b2/b3)\n",
+ "print \"\\n%f\" %(b3/b4)\n",
+ "print \"\\n%f\" %(b4/b5)\n",
+ "print \"\\n%f\" %(b5/b6)\n",
+ "print \"\\n%f\" %(b6/b7)\n",
+ "print \"\\n%f\" %(b7/b8)\n",
+ "print \"\\n%f\" %(b8/b9)\n",
+ "print \"\\n it appears as if the roots are converging at 2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ "0.923077\n",
+ "\n",
+ "1.356522\n",
+ "\n",
+ "1.595376\n",
+ "\n",
+ "1.738402\n",
+ "\n",
+ "1.828184\n",
+ "\n",
+ "1.886130\n",
+ "\n",
+ "1.924153\n",
+ "\n",
+ "1.949345\n",
+ "\n",
+ " it appears as if the roots are converging at 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.22:pg-46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#ramanujan's method\n",
+ "#example 2.22\n",
+ "#page 46\n",
+ "def f(x):\n",
+ " return x+x**2+(x**3)/2.0+(x**4)/6.0+(x**5)/24.0\n",
+ "a1=1.0\n",
+ "a2=1.0\n",
+ "a3=1.0/2.0\n",
+ "a4=1.0/6.0\n",
+ "a5=1.0/24.0\n",
+ "b1=1\n",
+ "b2=a2\n",
+ "b3=a1*b2+a2*b1\n",
+ "b4=a1*b3+a2*b2+a3*b1\n",
+ "b5=a1*b4+a2*b3+a3*b2\n",
+ "b6=a1*b5+a2*b4+a3*b3\n",
+ "print \"\\n%f\" %(b1/b2)\n",
+ "print \"\\n%f\" %(b2/b3)\n",
+ "print \"\\n%f\" %(b3/b4)\n",
+ "print \"\\n%f\" %(b4/b5)\n",
+ "print \"\\n%f\" %(b5/b6)\n",
+ "print \"\\n it appears as if the roots are converging at around %f\" %(b5/b6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "1.000000\n",
+ "\n",
+ "0.500000\n",
+ "\n",
+ "0.571429\n",
+ "\n",
+ "0.583333\n",
+ "\n",
+ "0.571429\n",
+ "\n",
+ " it appears as if the roots are converging at around 0.571429\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.23:pg-47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#ramanujan's method\n",
+ "#example 2.23\n",
+ "#page 47\n",
+ "from __future__ import division\n",
+ "def f(x):\n",
+ " return 1-2*((3*x/2.0+(x**2)/4.0-(x**4)/48.0+(x**6)/1440.0)-(x**8)*2/80640.0)\n",
+ "a1=3/2\n",
+ "a2=1/4\n",
+ "a3=0\n",
+ "a4=1/48\n",
+ "a5=0\n",
+ "a6=1/1440\n",
+ "a7=0\n",
+ "a8=-1/80640\n",
+ "b1=1\n",
+ "b2=a1\n",
+ "b3=a1*b2+a2*b1\n",
+ "b4=a1*b3+a2*b2+a3*b1\n",
+ "b5=a1*b4+a2*b3+a3*b2\n",
+ "b6=a1*b5+a2*b4+a3*b3\n",
+ "b7=a1*b6+a2*b5+a3*b4\n",
+ "b8=a1*b7+a2*b6+a3*b5\n",
+ "b9=a1*b8+a2*b7+a3*b6\n",
+ "print \"\\n%f\" %(b1/b2)\n",
+ "print \"\\n%f\" %(b2/b3)\n",
+ "print \"\\n%f\" %(b3/b4)\n",
+ "print \"\\n%f\" %(b4/b5)\n",
+ "print \"\\n%f\" %(b5/b6)\n",
+ "print \"\\n%f\" %(b6/b7)\n",
+ "print \"\\n%f\" %(b7/b8)\n",
+ "print \"\\n it appears as if the roots are converging at around %f\" %(b7/b8)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "0.666667\n",
+ "\n",
+ "0.600000\n",
+ "\n",
+ "0.606061\n",
+ "\n",
+ "0.605505\n",
+ "\n",
+ "0.605556\n",
+ "\n",
+ "0.605551\n",
+ "\n",
+ "0.605551\n",
+ "\n",
+ " it appears as if the roots are converging at around 0.605551\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.24:pg-47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#ramanujan's method\n",
+ "#example 2.24\n",
+ "#page 47\n",
+ "import math\n",
+ "def f(x):\n",
+ " return 1-(x-x**2.0/math.factorial(2.0)**2.0+x**3.0/math.factorial(3.0)**2.0-x**4.0/math.factorial(4.0)**2.0)\n",
+ "a1=1\n",
+ "a2=-1/math.factorial(2.0)**2.0\n",
+ "a3=1/math.factorial(3.0)**2.0\n",
+ "a4=-1/math.factorial(4.0)**2.0\n",
+ "a5=-1/math.factorial(5.0)**2.0\n",
+ "a6=1/math.factorial(6.0)**2.0\n",
+ "b1=1\n",
+ "b2=a1\n",
+ "b3=a1*b2+a2*b1\n",
+ "b4=a1*b3+a2*b2+a3*b1\n",
+ "b5=a1*b4+a2*b3+a3*b2\n",
+ "print \"\\n\\n%f\" %(b1/b2)\n",
+ "print \"\\n\\n%f\" %(b2/b3)\n",
+ "print \"\\n%f\" %(b3/b4)\n",
+ "print \"\\n%f\" %(b4/b5)\n",
+ "print \"\\n it appears as if the roots are converging at around %f\" %(b4/b5)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ "1.000000\n",
+ "\n",
+ "\n",
+ "1.333333\n",
+ "\n",
+ "1.421053\n",
+ "\n",
+ "1.433962\n",
+ "\n",
+ " it appears as if the roots are converging at around 1.433962\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.25:pg-49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.25\n",
+ "#secant method\n",
+ "#page 49\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "def f(x):\n",
+ " return x**3-2*x-5\n",
+ "x1=2\n",
+ "x2=3 # initial values\n",
+ "n=1\n",
+ "c=0\n",
+ "print \"successive iterations \\t x1 \\t x2 \\t x3 \\t f(x3)\\n\"\n",
+ "while n==1:\n",
+ " x3=(x1*f(x2)-x2*f(x1))/(f(x2)-f(x1)) \n",
+ " print \" \\t%f \\t%f \\t%f \\t%f\\n\" %(x1,x2,x3,f(x3))\n",
+ " if f(x3)*f(x1)>0:\n",
+ " x2=x3;\n",
+ " else:\n",
+ " x1=x3 \n",
+ " if abs(f(x3))<0.000001: \n",
+ " break\n",
+ " c=c+1\n",
+ "print \"the root of the equation after %i iteration is: %f\" %(c,x3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "successive iterations \t x1 \t x2 \t x3 \t f(x3)\n",
+ "\n",
+ " \t2.000000 \t3.000000 \t2.058824 \t-0.390800\n",
+ "\n",
+ " \t2.000000 \t2.058824 \t2.096559 \t0.022428\n",
+ "\n",
+ " \t2.096559 \t2.058824 \t2.094511 \t-0.000457\n",
+ "\n",
+ " \t2.094511 \t2.058824 \t2.094552 \t0.000009\n",
+ "\n",
+ " \t2.094552 \t2.058824 \t2.094551 \t-0.000000\n",
+ "\n",
+ "the root of the equation after 4 iteration is: 2.094551\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.26:pg-50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.26\n",
+ "#secant method\n",
+ "#page 50\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "def f(x):\n",
+ " return x*math.exp(x)-1\n",
+ "x1=0\n",
+ "x2=1 # initial values\n",
+ "n=1\n",
+ "c=0 \n",
+ "print \"successive iterations \\t x1 \\t x2 \\t x3 \\t f(x3)\\n\"\n",
+ "while n==1:\n",
+ " x3=(x1*f(x2)-x2*f(x1))/(f(x2)-f(x1)) \n",
+ " print \" \\t%f \\t%f \\t%f \\t%f\\n\" %(x1,x2,x3,f(x3))\n",
+ " if f(x3)*f(x1)>0:\n",
+ " x2=x3\n",
+ " else:\n",
+ " x1=x3 \n",
+ " if abs(f(x3))<0.0001:\n",
+ " break\n",
+ " c=c+1\n",
+ "print \"the root of the equation after %i iteration is: %0.4g\" %(c,x3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "successive iterations \t x1 \t x2 \t x3 \t f(x3)\n",
+ "\n",
+ " \t0.000000 \t1.000000 \t0.367879 \t-0.468536\n",
+ "\n",
+ " \t0.000000 \t0.367879 \t0.692201 \t0.383091\n",
+ "\n",
+ " \t0.692201 \t0.367879 \t0.546310 \t-0.056595\n",
+ "\n",
+ " \t0.546310 \t0.367879 \t0.570823 \t0.010200\n",
+ "\n",
+ " \t0.570823 \t0.367879 \t0.566500 \t-0.001778\n",
+ "\n",
+ " \t0.566500 \t0.367879 \t0.567256 \t0.000312\n",
+ "\n",
+ " \t0.567256 \t0.367879 \t0.567124 \t-0.000055\n",
+ "\n",
+ "the root of the equation after 6 iteration is: 0.5671\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.27:pg-52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# example 2.27\n",
+ "#mulller's method\n",
+ "#page 52\n",
+ "from __future__ import division\n",
+ "import math\n",
+ "def f(x):\n",
+ " return x**3-x-1\n",
+ "x0=0\n",
+ "x1=1\n",
+ "x2=2 # initial values\n",
+ "n=1\n",
+ "c=0\n",
+ "print \"successive iterations \\t x0 \\t x1 \\t x2 \\t f(x0)\\t f(x1)\\t f(x2)\\n\"\n",
+ "while n==1: \n",
+ " c=c+1\n",
+ " y0=f(x0)\n",
+ " y1=f(x1)\n",
+ " y2=f(x2)\n",
+ " h2=x2-x1\n",
+ " h1=x1-x0\n",
+ " d2=f(x2)-f(x1)\n",
+ " d1=f(x1)-f(x0)\n",
+ " print \" \\t%f\\t %f\\t %f\\t %f\\t %f\\t %f\\n\" %(x0,x1,x2,f(x0),f(x1),f(x2))\n",
+ " A=(d2/h2-d1/h1)/(h1+h2)\n",
+ " B=d2/h2+A*h2\n",
+ " S=math.sqrt(B**2-4*A*f(x2))\n",
+ " x3=x2-(2*f(x2))/(B+S)\n",
+ " E=abs((x3-x2)/x2)*100\n",
+ " if E<0.003:\n",
+ " break\n",
+ " else:\n",
+ " if c==1:\n",
+ " x2=x3\n",
+ " if c==2:\n",
+ " x1=x2\n",
+ " x2=x3\n",
+ " if c==3:\n",
+ " x0=x1\n",
+ " x1=x2\n",
+ " x2=x3\n",
+ " if c==3:\n",
+ " c=0\n",
+ "print \"the required root is : %0.4f\" %(x3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "successive iterations \t x0 \t x1 \t x2 \t f(x0)\t f(x1)\t f(x2)\n",
+ "\n",
+ " \t0.000000\t 1.000000\t 2.000000\t -1.000000\t -1.000000\t 5.000000\n",
+ "\n",
+ " \t0.000000\t 1.000000\t 1.263763\t -1.000000\t -1.000000\t -0.245412\n",
+ "\n",
+ " \t0.000000\t 1.263763\t 1.331711\t -1.000000\t -0.245412\t 0.030015\n",
+ "\n",
+ " \t1.263763\t 1.331711\t 1.324583\t -0.245412\t 0.030015\t -0.000574\n",
+ "\n",
+ " \t1.263763\t 1.331711\t 1.324718\t -0.245412\t 0.030015\t -0.000000\n",
+ "\n",
+ "the required root is : 1.3247\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.28:pg-55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#graeffe's method\n",
+ "#example 2.28\n",
+ "#page 55\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "def f(x):\n",
+ " return x**3-6*(x**2)+11*x-6\n",
+ "print \"the equation is:\\n\"\n",
+ "A=[1, 14, 49, 36] #coefficients of the above equation\n",
+ "print \"%0.4g\\n\" %(math.sqrt(A[3]/A[2]))\n",
+ "print \"%0.4g\\n\" %(math.sqrt(A[2]/A[1]))\n",
+ "print \"%0.4g\\n\" %(math.sqrt(A[1]/A[0]))\n",
+ "print \"the equation is:\\n\"\n",
+ "B=[1, 98, 1393, 1296]\n",
+ "print \"%0.4g\\n\" %((B[3]/B[2])**(1/4))\n",
+ "print \"%0.4g\\n\" %((B[2]/B[1])**(1/4))\n",
+ "print \"%0.4g\\n\" %((B[1]/B[0])**(1/4))\n",
+ "print \"It is apparent from the outputs that the roots converge at 1 2 3\"\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the equation is:\n",
+ "\n",
+ "0.8571\n",
+ "\n",
+ "1.871\n",
+ "\n",
+ "3.742\n",
+ "\n",
+ "the equation is:\n",
+ "\n",
+ "0.9821\n",
+ "\n",
+ "1.942\n",
+ "\n",
+ "3.146\n",
+ "\n",
+ "It is apparent from the outputs that the roots converge at 1 2 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.29:pg-57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#quadratic factor by lin's--bairsttow method\n",
+ "#example 2.29\n",
+ "#page 57\n",
+ "from numpy import matrix\n",
+ "from __future__ import division\n",
+ "def f(x):\n",
+ " return x**3-x-1\n",
+ "a=[-1, -1, 0, 1]\n",
+ "r1=1\n",
+ "s1=1\n",
+ "b4=a[3]\n",
+ "def f3(r):\n",
+ " return a[2]-r*a[3]\n",
+ "def f2(r,s):\n",
+ " return a[1]-r*a[2]+r**2*a[3]-s*a[3]\n",
+ "def f1(r,s):\n",
+ " return a[0]-s*a[2]+s*r*a[3]\n",
+ "A=matrix([[1,1],[2,-1]])\n",
+ "C=matrix([[0],[1]])\n",
+ "X=A.I*C\n",
+ "X1=[[ 0.33333333],[-0.33333333]]\n",
+ "dr=X1[0][0]\n",
+ "ds=X1[1][0]\n",
+ "r2=r1+dr\n",
+ "s2=s1+ds\n",
+ "#second pproximation\n",
+ "r1=r2\n",
+ "s1=s2\n",
+ "b11=f1(r2,s2)\n",
+ "b22=f2(r2,s2)\n",
+ "h=0.001\n",
+ "dr_b1=(f1(r1+h,s1)-f1(r1,s1))/h\n",
+ "ds_b1=(f1(r1,s1+h)-f1(r1,s1))/h\n",
+ "dr_b2=(f2(r1+h,s1)-f2(r1,s1))/h\n",
+ "ds_b2=(f2(r1,s1+h)-f2(r1,s1))/h\n",
+ "A=matrix([[dr_b1,ds_b1],[dr_b2,ds_b2]])\n",
+ "C=matrix([[-f1(r1,s1)],[-f2(r1,s2)]])\n",
+ "X=A.I*C\n",
+ "r2=r1+X[0][0]\n",
+ "s2=s1+X[1][0]\n",
+ "print \"roots correct to 3 decimal places are : %0.3f %0.3f\" %(r2,s2)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "roots correct to 3 decimal places are : 1.325 0.754\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.31:pg-62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#method of iteration\n",
+ "#example 2.31\n",
+ "#page 62\n",
+ "from __future__ import division\n",
+ "def f(x,y):\n",
+ " return (3*y*x**2+7)/10\n",
+ "def g(x,y):\n",
+ " return (y**2+4)/5\n",
+ "h=0.0001\n",
+ "x0=0.5\n",
+ "y0=0.5\n",
+ "f1_dx=(f(x0+h,y0)-f(x0,y0))/h\n",
+ "f1_dy=(f(x0,y0+h)-f(x0,y0))/h\n",
+ "g1_dx=(g(x0+h,y0)-g(x0,y0))/h\n",
+ "g1_dy=(g(x0+h,y0)-g(x0,y0))/h\n",
+ "if (f1_dx+f1_dy<1) and (g1_dx+g1_dy<1): \n",
+ " print \"coditions for convergence is satisfied\\n\\n\"\n",
+ "print \"X \\t Y\\t\\n\\n\"\n",
+ "for i in range(0,10):\n",
+ " X=(3*y0*x0**2+7)/10\n",
+ " Y=(y0**2+4)/5\n",
+ " print \"%f\\t %f\\t\\n\" %(X,Y)\n",
+ " x0=X\n",
+ " y0=Y\n",
+ "print \"\\n\\n CONVERGENCE AT (1 1) IS OBVIOUS\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "coditions for convergence is satisfied\n",
+ "\n",
+ "\n",
+ "X \t Y\t\n",
+ "\n",
+ "\n",
+ "0.737500\t 0.850000\t\n",
+ "\n",
+ "0.838696\t 0.944500\t\n",
+ "\n",
+ "0.899312\t 0.978416\t\n",
+ "\n",
+ "0.937391\t 0.991460\t\n",
+ "\n",
+ "0.961360\t 0.996598\t\n",
+ "\n",
+ "0.976320\t 0.998642\t\n",
+ "\n",
+ "0.985572\t 0.999457\t\n",
+ "\n",
+ "0.991247\t 0.999783\t\n",
+ "\n",
+ "0.994707\t 0.999913\t\n",
+ "\n",
+ "0.996807\t 0.999965\t\n",
+ "\n",
+ "\n",
+ "\n",
+ " CONVERGENCE AT (1 1) IS OBVIOUS\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.32:pg-65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#newton raphson metho\n",
+ "#example 2.32\n",
+ "#page 65\n",
+ "import numpy\n",
+ "def f(x,y):\n",
+ " return 3*y*x**2-10*x+7\n",
+ "def g(y):\n",
+ " return y**2-5*y+4\n",
+ "hh=0.0001\n",
+ "x0=0.5\n",
+ "y0=0.5 #initial values\n",
+ "f0=f(x0,y0)\n",
+ "g0=g(y0)\n",
+ "df_dx=(f(x0+hh,y0)-f(x0,y0))/hh\n",
+ "df_dy=(f(x0,y0+hh)-f(x0,y0))/hh\n",
+ "dg_dx=(g(y0)-g(y0))/hh\n",
+ "dg_dy=(g(y0+hh)-g(y0))/hh\n",
+ "d=[[df_dx,df_dy],[dg_dx,dg_dy]]\n",
+ "D1=numpy.linalg.det(d)\n",
+ "dd=[[-f0,df_dy],[-g0,dg_dy]]\n",
+ "h=numpy.linalg.det(dd)/D1\n",
+ "ddd=[[df_dx,-f0],[dg_dx,-g0]]\n",
+ "k=numpy.linalg.det(ddd)/D1;\n",
+ "x1=x0+h\n",
+ "y1=y0+k\n",
+ "f0=f(x1,y1)\n",
+ "g0=g(y1)\n",
+ "df_dx=(f(x1+hh,y1)-f(x1,y1))/hh\n",
+ "df_dy=(f(x1,y1+hh)-f(x1,y1))/hh\n",
+ "dg_dx=(g(y1)-g(y1))/hh\n",
+ "dg_dy=(g(y1+hh)-g(y1))/hh\n",
+ "dddd=[[df_dx,df_dy],[dg_dx,dg_dy]]\n",
+ "D2=numpy.linalg.det(dddd)\n",
+ "ddddd=[[-f0,df_dy],[-g0,dg_dy]]\n",
+ "h=numpy.linalg.det(ddddd)/D2\n",
+ "d6=[[df_dx,-f0],[dg_dx,-g0]]\n",
+ "k=numpy.linalg.det(d6)/D2\n",
+ "x2=x1+h\n",
+ "y2=y1+k\n",
+ "print \" the roots of the equation are x2=%f and y2=%f\" %(x2,y2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the roots of the equation are x2=0.970803 and y2=0.998752\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.33:pg-66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#newton raphson method\n",
+ "#example 2.33\n",
+ "#page 66\n",
+ "import math\n",
+ "import numpy\n",
+ "def f(x,y):\n",
+ " return x**2+y**2-1\n",
+ "def g(x,y):\n",
+ " return y-x**2\n",
+ "hh=0.0001\n",
+ "x0=0.7071\n",
+ "y0=0.7071 #initial values\n",
+ "f0=f(x0,y0)\n",
+ "g0=g(x0,y0)\n",
+ "df_dx=(f(x0+hh,y0)-f(x0,y0))/hh\n",
+ "df_dy=(f(x0,y0+hh)-f(x0,y0))/hh\n",
+ "dg_dx=(g(x0+hh,y0)-g(x0,y0))/hh\n",
+ "dg_dy=(g(x0,y0+hh)-g(x0,y0))/hh\n",
+ "D1=numpy.linalg.det([[df_dx,df_dy],[dg_dx,dg_dy]])\n",
+ "h=numpy.linalg.det([[-f0,df_dy],[-g0,dg_dy]])/D1\n",
+ "k=numpy.linalg.det([[df_dx,-f0],[dg_dx,-g0]])/D1\n",
+ "x1=x0+h\n",
+ "y1=y0+k\n",
+ "f0=f(x1,y1)\n",
+ "g0=g(x1,y1)\n",
+ "df_dx=(f(x1+hh,y1)-f(x1,y1))/hh\n",
+ "df_dy=(f(x1,y1+hh)-f(x1,y1))/hh\n",
+ "dg_dx=(g(x1+hh,y1)-g(x1,y1))/hh\n",
+ "dg_dy=(g(x1,y1+hh)-g(x1,y1))/hh\n",
+ "D2=numpy.linalg.det([[df_dx,df_dy],[dg_dx,dg_dy]])\n",
+ "h=numpy.linalg.det([[-f0,df_dy],[-g0,dg_dy]])/D2\n",
+ "k=numpy.linalg.det([[df_dx,-f0],[dg_dx,-g0]])/D2\n",
+ "x2=x1+h\n",
+ "y2=y1+k\n",
+ "print \"the roots of the equation are x2=%f and y2=%f \" %(x2,y2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the roots of the equation are x2=0.786184 and y2=0.618039 \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.34:pg-67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#newton raphson method\n",
+ "#example 2.34\n",
+ "#page 67\n",
+ "import math\n",
+ "import numpy\n",
+ "def f(x,y):\n",
+ " return math.sin(x)-y+0.9793\n",
+ "def g(x,y):\n",
+ " return math.cos(y)-x+0.6703\n",
+ "hh=0.0001\n",
+ "x0=0.5\n",
+ "y0=1.5 #initial values\n",
+ "f0=f(x0,y0)\n",
+ "g0=g(x0,y0)\n",
+ "df_dx=(f(x0+hh,y0)-f(x0,y0))/hh\n",
+ "df_dy=(f(x0,y0+hh)-f(x0,y0))/hh\n",
+ "dg_dx=(g(x0+hh,y0)-g(x0,y0))/hh\n",
+ "dg_dy=(g(x0,y0+hh)-g(x0,y0))/hh\n",
+ "d1=[[df_dx,df_dy],[dg_dx,dg_dy]]\n",
+ "D1=numpy.linalg.det(d1)\n",
+ "d2=[[-f0,df_dy],[-g0,dg_dy]]\n",
+ "h=numpy.linalg.det(d2)/D1\n",
+ "d3=[[df_dx,-f0],[dg_dx,-g0]]\n",
+ "k=numpy.linalg.det(d3)/D1\n",
+ "x1=x0+h\n",
+ "y1=y0+k\n",
+ "f0=f(x1,y1)\n",
+ "g0=g(x1,y1)\n",
+ "df_dx=(f(x1+hh,y1)-f(x1,y1))/hh\n",
+ "df_dy=(f(x1,y1+hh)-f(x1,y1))/hh\n",
+ "dg_dx=(g(x1+hh,y1)-g(x1,y1))/hh\n",
+ "dg_dy=(g(x1,y1+hh)-g(x1,y1))/hh\n",
+ "d4=[[df_dx,df_dy],[dg_dx,dg_dy]]\n",
+ "D2=numpy.linalg.det(d4)\n",
+ "h=numpy.linalg.det([[-f0,df_dy],[-g0,dg_dy]])/D2\n",
+ "k=numpy.linalg.det([[df_dx,-f0],[dg_dx,-g0]])/D2\n",
+ "x2=x1+h\n",
+ "y2=y1+k\n",
+ "print \"the roots of the equation are x2=%0.4f and y2=%0.4f\" %(x2,y2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the roots of the equation are x2=0.6537 and y2=1.5874\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter3_(1).ipynb b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter3_(1).ipynb
new file mode 100644
index 00000000..e32d12d6
--- /dev/null
+++ b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter3_(1).ipynb
@@ -0,0 +1,1130 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:015160847087ed6879696359da8f3bf9f55e4d5e926aa29f46b690e2815a2fa2"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter03:Interpolation"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.4:pg-86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.4\n",
+ "#interpolation\n",
+ "#page 86\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "x=[1, 3, 5, 7]\n",
+ "y=[24, 120, 336, 720]\n",
+ "d1=[0,0,0]\n",
+ "d2=[0,0,0]\n",
+ "d3=[0,0,0]\n",
+ "h=2 #interval between values of x\n",
+ "c=0\n",
+ "for i in range(0,3):\n",
+ " d1[c]=y[i+1]-y[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,2):\n",
+ " d2[c]=d1[i+1]-d1[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,1):\n",
+ " d3[c]=d2[i+1]-d2[i]\n",
+ " c=c+1\n",
+ "d=[0,d1[0],d2[0],d3[0]]\n",
+ "x0=8 #value at 8\n",
+ "pp=1\n",
+ "y_x=y[0]\n",
+ "p=(x0-1)/2\n",
+ "for i in range(1,4):\n",
+ " pp=1\n",
+ " for j in range(0,i):\n",
+ " pp=pp*(p-(j)) \n",
+ " y_x=y_x+(pp*d[i])/math.factorial(i)\n",
+ "print \"value of function at %f is :%f\" %(x0,y_x)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "value of function at 8.000000 is :990.000000\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.6:pg-87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.6\n",
+ "#interpolation\n",
+ "#page 87\n",
+ "import math\n",
+ "x=[15, 20, 25, 30, 35, 40]\n",
+ "y=[0.2588190, 0.3420201, 0.4226183, 0.5, 0.5735764, 0.6427876]\n",
+ "d1=[0,0,0,0,0]\n",
+ "d2=[0,0,0,0]\n",
+ "d3=[0,0,0]\n",
+ "d4=[0,0]\n",
+ "d5=[0]\n",
+ "h=5 #interval between values of x\n",
+ "c=0\n",
+ "for i in range(0,5):\n",
+ " d1[c]=y[i+1]-y[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,4):\n",
+ " d2[c]=d1[i+1]-d1[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,3):\n",
+ " d3[c]=d2[i+1]-d2[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,2):\n",
+ " d4[c]=d3[i+1]-d3[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,1):\n",
+ " d5[c]=d4[i+1]-d4[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "d=[0,d1[0], d2[0], d3[0], d4[0], d5[0]]\n",
+ "x0=38 #value at 38 degree\n",
+ "pp=1\n",
+ "y_x=y[0]\n",
+ "p=(x0-x[0])/h\n",
+ "for i in range(1,6):\n",
+ " pp=1\n",
+ " for j in range(0,i):\n",
+ " pp=pp*(p-(j)) \n",
+ " y_x=y_x+((pp*d[i])/math.factorial(i));\n",
+ "print \"value of function at %i is :%f\" %(x0,y_x)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "value of function at 38 is :0.615661\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.7:pg-89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.7\n",
+ "#interpolation\n",
+ "#page 89\n",
+ "x=[0, 1, 2, 4]\n",
+ "y=[1, 3, 9, 81]\n",
+ "#equation is y(5)-4*y(4)+6*y(2)-4*y(2)+y(1)\n",
+ "y3=(y[3]+6*y[2]-4*y[1]+y[0])/4\n",
+ "print \"the value of missing term of table is :%d\" %(y3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the value of missing term of table is :31\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.8:pg-89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.8\n",
+ "#interpolation\n",
+ "#page 89\n",
+ "import math\n",
+ "x=[0.10, 0.15, 0.20, 0.25, 0.30]\n",
+ "y=[0.1003, 0.1511, 0.2027, 0.2553, 0.3093]\n",
+ "d1=[0,0,0,0,0]\n",
+ "d2=[0,0,0,0,0]\n",
+ "d3=[0,0,0,0,0]\n",
+ "d4=[0,0,0,0,0]\n",
+ "h=0.05 #interval between values of x\n",
+ "c=0\n",
+ "for i in range(0,4):\n",
+ " d1[c]=y[i+1]-y[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,3):\n",
+ " d2[c]=d1[i+1]-d1[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,2):\n",
+ " d3[c]=d2[i+1]-d2[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,4):\n",
+ " d4[c]=d3[i+1]-d3[i]\n",
+ " c=c+1\n",
+ "d=[0,d1[0], d2[0], d3[0], d4[0]]\n",
+ "x0=0.12 #value at 0.12;\n",
+ "pp=1\n",
+ "y_x=y[0]\n",
+ "p=(x0-x[0])/h\n",
+ "for i in range(1,5):\n",
+ " pp=1;\n",
+ " for j in range(0,i):\n",
+ " pp=pp*(p-(j)) \n",
+ " y_x=y_x+(pp*d[i])/math.factorial(i)\n",
+ "print \"value of function at %f is :%0.4g\\n \\n\" %(x0,y_x)\n",
+ "x0=0.26 #value at 0.26;\n",
+ "pp=1\n",
+ "y_x=y[0]\n",
+ "p=(x0-x[0])/h\n",
+ "for i in range(1,5):\n",
+ " pp=1\n",
+ " for j in range(0,i):\n",
+ " pp=pp*(p-(j)) \n",
+ " y_x=y_x+(pp*d[i])/math.factorial(i);\n",
+ "print \"value of function at %f is :%0.4g\\n \\n\" %(x0,y_x)\n",
+ "x0=0.40 #value at 0.40;\n",
+ "pp=1\n",
+ "y_x=y[0]\n",
+ "p=(x0-x[0])/h\n",
+ "for i in range(1,5):\n",
+ " pp=1\n",
+ " for j in range(0,i):\n",
+ " pp=pp*(p-(j)) \n",
+ " y_x=y_x+(pp*d[i])/math.factorial(i)\n",
+ "print \"value of function at %f is :%0.4g\\n \\n\" %(x0,y_x)\n",
+ "x0=0.50 #value at 0.50;\n",
+ "pp=1\n",
+ "y_x=y[0]\n",
+ "p=(x0-x[0])/h\n",
+ "for i in range(1,5):\n",
+ " pp=1\n",
+ " for j in range(0,i):\n",
+ " pp=pp*(p-(j)) \n",
+ " y_x=y_x+(pp*d[i])/math.factorial(i)\n",
+ "print \"value of function at %f is :%0.5g\\n \\n\" %(x0,y_x)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "value of function at 0.120000 is :0.1205\n",
+ " \n",
+ "\n",
+ "value of function at 0.260000 is :0.266\n",
+ " \n",
+ "\n",
+ "value of function at 0.400000 is :0.4241\n",
+ " \n",
+ "\n",
+ "value of function at 0.500000 is :0.5543\n",
+ " \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.9:pg-93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.9\n",
+ "#Gauss' forward formula\n",
+ "#page 93\n",
+ "import math\n",
+ "x=[1.0, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30];\n",
+ "y=[2.7183, 2.8577, 3.0042, 3.1582, 3.3201, 3.4903, 3.66693]\n",
+ "d1=[0,0,0,0,0,0]\n",
+ "d2=[0,0,0,0,0]\n",
+ "d3=[0,0,0,0]\n",
+ "d4=[0,0,0]\n",
+ "d5=[0,0]\n",
+ "d6=[0]\n",
+ "h=0.05 #interval between values of x\n",
+ "c=0\n",
+ "for i in range(0,6):\n",
+ " d1[c]=y[i+1]-y[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,5):\n",
+ " d2[c]=d1[i+1]-d1[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,4):\n",
+ " d3[c]=d2[i+1]-d2[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,3):\n",
+ " d4[c]=d3[i+1]-d3[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,2):\n",
+ " d5[c]=d4[i+1]-d4[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,1):\n",
+ " d6[c]=d5[i+1]-d5[i]\n",
+ " c=c+1\n",
+ "d=[0,d1[3], d2[2], d3[2], d4[1], d5[0], d6[0]]\n",
+ "x0=1.17 #value at 1.17;\n",
+ "pp=1\n",
+ "y_x=y[3]\n",
+ "p=(x0-x[3])/h\n",
+ "for i in range(1,6):\n",
+ " pp=1;\n",
+ " for j in range(0,i):\n",
+ " pp=pp*(p-(j)) \n",
+ " y_x=y_x+(pp*d[i])/math.factorial(i)\n",
+ "print \"value of function at %f is :%0.4g\\n \\n\" %(x0,y_x)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "value of function at 1.170000 is :3.222\n",
+ " \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.10:pg-97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#practical interpolation\n",
+ "#example 3.10\n",
+ "#page 97\n",
+ "import math\n",
+ "x=[0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67]\n",
+ "y=[1.840431, 1.858928,1.877610, 1.896481, 1.915541, 1.934792, 1.954237]\n",
+ "d1=[0,0,0,0,0,0]\n",
+ "d2=[0,0,0,0,0]\n",
+ "d3=[0,0,0,0]\n",
+ "d4=[0,0,0]\n",
+ "h=0.01 #interval between values of x\n",
+ "c=0\n",
+ "for i in range(0,6):\n",
+ " d1[c]=y[i+1]-y[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,5):\n",
+ " d2[c]=d1[i+1]-d1[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,4):\n",
+ " d3[c]=d2[i+1]-d2[i];\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,3):\n",
+ " d4[c]=d3[i+1]-d3[i];\n",
+ " c=c+1\n",
+ "d=[d1[0], d2[0], d3[0], d4[0]]\n",
+ "x0=0.644\n",
+ "p=(x0-x[3])/h;\n",
+ "y_x=y[3]\n",
+ "y_x=y_x+p*(d1[2]+d1[3])/2+p**2*(d2[1])/2 #stirling formula\n",
+ "print \"the value at %f by stirling formula is : %f\\n\\n\" %(x0,y_x)\n",
+ "y_x=y[3]\n",
+ "y_x=y_x+p*d1[3]+p*(p-1)*(d2[2]+d2[3])/2\n",
+ "print \" the value at %f by bessels formula is : %f\\n\\n\" %(x0,y_x)\n",
+ "y_x=y[3]\n",
+ "q=1-p\n",
+ "y_x=q*y[3]+q*(q**2-1)*d2[2]/2+p*y[4]+p*(q**2-1)*d2[4]/2\n",
+ "print \"the value at %f by everrets formula is : %f\\n\\n\" %(x0,y_x)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the value at 0.644000 by stirling formula is : 1.904082\n",
+ "\n",
+ "\n",
+ " the value at 0.644000 by bessels formula is : 1.904059\n",
+ "\n",
+ "\n",
+ "the value at 0.644000 by everrets formula is : 1.904044\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.11:pg-99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#practical interpolation\n",
+ "#example 3.11\n",
+ "#page 99\n",
+ "x=[0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67]\n",
+ "y=[1.840431, 1.858928, 1.877610, 1.896481, 1.915541, 1.934792, 1.954237]\n",
+ "d1=[0,0,0,0,0,0]\n",
+ "d2=[0,0,0,0,0]\n",
+ "d3=[0,0,0,0]\n",
+ "d4=[0,0,0]\n",
+ "h=0.01 #interval between values of x\n",
+ "c=0\n",
+ "for i in range(0,6):\n",
+ " d1[c]=y[i+1]-y[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,5):\n",
+ " d2[c]=d1[i+1]-d1[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,4):\n",
+ " d3[c]=d2[i+1]-d2[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,3):\n",
+ " d4[c]=d3[i+1]-d3[i]\n",
+ " c=c+1\n",
+ "d=[d1[0], d2[0], d3[0], d4[0]]\n",
+ "x0=0.638\n",
+ "p=(x0-x[3])/h\n",
+ "y_x=y[3]\n",
+ "y_x=y_x+p*(d1[2]+d1[3])/2+p**2*(d2[1])/2 #stirling formula\n",
+ "print \"value at %f by stirling formula is : %f\\n\\n\" %(x0,y_x)\n",
+ "y_x=y[2]\n",
+ "p=(x0-x[2])/h\n",
+ "y_x=y_x+p*d1[2]+p*(p-1)*(d2[1])/2\n",
+ "print \"the value at %f by bessels formula is : %f\\n\\n\" %(x0,y_x)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "value at 0.638000 by stirling formula is : 1.892692\n",
+ "\n",
+ "\n",
+ "the value at 0.638000 by bessels formula is : 1.892692\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.12:pg-99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#practical interpolation\n",
+ "#example 3.12\n",
+ "#page 99\n",
+ "x=[1.72, 1.73, 1.74, 1.75, 1.76, 1.77, 1.78]\n",
+ "y=[0.1790661479, 0.1772844100, 0.1755204006, 0.1737739435, 0.1720448638, 0.1703329888, 0.1686381473]\n",
+ "d1=[0,0,0,0,0,0]\n",
+ "d2=[0,0,0,0,0]\n",
+ "d3=[0,0,0,0]\n",
+ "d4=[0,0,0]\n",
+ "h=0.01 #interval between values of x\n",
+ "c=0\n",
+ "for i in range(0,6):\n",
+ " d1[c]=y[i+1]-y[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,5):\n",
+ " d2[c]=d1[i+1]-d1[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,4):\n",
+ " d3[c]=d2[i+1]-d2[i]\n",
+ " c=c+1\n",
+ "c=0\n",
+ "for i in range(0,3):\n",
+ " d4[c]=d3[i+1]-d3[i]\n",
+ " c=c+1\n",
+ "x0=1.7475\n",
+ "y_x=y[2]\n",
+ "p=(x0-x[2])/h\n",
+ "y_x=y_x+p*d1[2]+p*(p-1)*((d2[1]+d2[2])/2)/2\n",
+ "print \"the value at %f by bessels formula is : %0.10f\\n\\n\" %(x0,y_x)\n",
+ "y_x=y[3]\n",
+ "q=1-p\n",
+ "y_x=q*y[2]+q*(q**2-1)*d2[1]/6+p*y[3]+p*(p**2-1)*d2[1]/6\n",
+ "print \"the value at %f by everrets formula is : %0.10f\\n\\n\" %(x0,y_x)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the value at 1.747500 by bessels formula is : 0.1742089204\n",
+ "\n",
+ "\n",
+ "the value at 1.747500 by everrets formula is : 0.1742089122\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.13:pg-104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.13\n",
+ "#lagrange's interpolation formula\n",
+ "#page 104\n",
+ "x=[300, 304, 305, 307]\n",
+ "y=[2.4771, 2.4829, 2.4843, 2.4871]\n",
+ "x0=301\n",
+ "log_301=(-3*-4*-6*2.4771)/(-4*-5*-7)+(-4*-6*2.4829)/(4*-1*-3)+(-3*-6*2.4843)/(5*-2)+(-3*-4*2.4871)/(7*3*2)\n",
+ "print \"valie of log x at 301 is =%f\" %(log_301)\n",
+ "\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "valie of log x at 301 is =2.478597\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.14:pg-105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.14\n",
+ "#lagrange's interpolation formula\n",
+ "#page 105\n",
+ "y=[4, 12, 19]\n",
+ "x=[1, 3, 4];\n",
+ "y_x=7\n",
+ "Y_X=(-5*-12)/(-8*-15)+(3*3*-12)/(8*-7)+(3*-5*4)/(15*7)\n",
+ "print \"values is %f\" %(Y_X)\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "values is 1.857143\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.15:pg-105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.15\n",
+ "#lagrange's interpolation formula\n",
+ "#page 105\n",
+ "import math\n",
+ "x=[2, 2.5, 3.0]\n",
+ "y=[0.69315, 0.91629, 1.09861]\n",
+ "def l0(x):\n",
+ " return (x-2.5)*(x-3.0)/(-0.5)*(-1.0)\n",
+ "def l1(x):\n",
+ " return ((x-2.0)*(x-3.0))/((0.5)*(-0.5))\n",
+ "def l2(x):\n",
+ " return ((x-2.0)*(x-2.5))/((1.0)*(0.5))\n",
+ "f_x=l0(2.7)*y[0]+l1(2.7)*y[1]+l2(2.7)*y[2];\n",
+ "print \"the calculated value is %f:\" %(f_x)\n",
+ "print \"\\n\\n the error occured in the value is %0.9f\" %(abs(f_x-log(2.7)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the calculated value is 0.994116:\n",
+ "\n",
+ "\n",
+ " the error occured in the value is 0.000864627\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.16:pg-106"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.16\n",
+ "#lagrange's interpolation formula\n",
+ "#page 106\n",
+ "import math\n",
+ "x=[0, math.pi/4,math.pi/2]\n",
+ "y=[0, 0.70711, 1.0];\n",
+ "x0=math.pi/6\n",
+ "sin_x0=0\n",
+ "for i in range(0,3):\n",
+ " p=y[i]\n",
+ " for j in range(0,3):\n",
+ " if j!=i:\n",
+ " p=p*((x0-x[j])/( x[i]-x[j]))\n",
+ " sin_x0=sin_x0+p\n",
+ "print \"sin_x0=%f\" %(sin_x0)\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "sin_x0=0.517431\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.18:pg-107"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#error in lagrange's interpolation formula\n",
+ "#example 3.18\n",
+ "#page 107\n",
+ "import math\n",
+ "x=[2, 2.5, 3.0]\n",
+ "y=[0.69315, 0.91629, 1.09861]\n",
+ "def l0(x):\n",
+ " return (x-2.5)*(x-3.0)/(-0.5)*(-1.0)\n",
+ "def l1(x):\n",
+ " return ((x-2.0)*(x-3.0))/((0.5)*(-0.5))\n",
+ "def l2(x):\n",
+ " return ((x-2.0)*(x-2.5))/((1.0)*(0.5))\n",
+ "f_x=l0(2.7)*y[0]+l1(2.7)*y[1]+l2(2.7)*y[2]\n",
+ "print \"the calculated value is %f:\" %(f_x)\n",
+ "err=math.fabs(f_x-math.log10(2.7))\n",
+ "def R_n(x):\n",
+ " return (((x-2)*(x-2.5)*(x-3))/6)\n",
+ "est_err=abs(R_n(2.7)*(2/8))\n",
+ "if est_err<err:\n",
+ " print \"\\n\\n the error agrees with the actual error\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the calculated value is 0.994116:\n",
+ "\n",
+ "\n",
+ " the error agrees with the actual error\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.19:pg-107"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#error in lagrenge's interpolation\n",
+ "#example 3.19\n",
+ "#page 107\n",
+ "import math\n",
+ "x=[0, math.pi/4 ,math.pi/2]\n",
+ "y=[0, 0.70711, 1.0]\n",
+ "def l0(x):\n",
+ " return ((x-0)*(x-math.pi/2))/((math.pi/4)*(-1*math.pi/4))\n",
+ "def l1(x):\n",
+ " return ((x-0)*(x-math.pi/4))/((math.pi/2)*(math.pi/4))\n",
+ "f_x=l0(math.pi/6)*y[1]+l1(math.pi/6)*y[2]\n",
+ "err=abs(f_x-math.sin(math.pi/6))\n",
+ "def f(x):\n",
+ " return ((x-0)*(x-math.pi/4)*(x-math.pi/2))/6\n",
+ "if abs(f(math.pi/6))>err:\n",
+ " print \"\\n\\n the error agrees with the actual error\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " the error agrees with the actual error\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.21:pg-110"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#hermite's interpolation formula\n",
+ "#exammple 3.21\n",
+ "#page 110\n",
+ "from __future__ import division\n",
+ "import math\n",
+ "x=[2.0, 2.5, 3.0]\n",
+ "y=[0.69315, 0.91629, 1.09861]\n",
+ "y1=[0,0,0]\n",
+ "def f(x):\n",
+ " return math.log(x)\n",
+ "h=0.0001\n",
+ "for i in range(0,3):\n",
+ " y1[i]=(f(x[i]+h)-f(x[i]))/h\n",
+ "def l0(x):\n",
+ " return (x-2.5)*(x-3.0)/(-0.5)*(-1.0)\n",
+ "def l1(x):\n",
+ " return ((x-2.0)*(x-3.0))/((0.5)*(-0.5))\n",
+ "def l2(x):\n",
+ " return ((x-2.0)*(x-2.5))/((1.0)*(0.5))\n",
+ "dl0=(l0(x[0]+h)-l0(x[0]))/h\n",
+ "dl1=(l1(x[1]+h)-l1(x[1]))/h\n",
+ "dl2=(l2(x[2]+h)-l2(x[2]))/h\n",
+ "x0=2.7\n",
+ "u0=(1-2*(x0-x[0])*dl0)*(l0(x0))**2\n",
+ "u1=(1-2*(x0-x[1])*dl1)*(l1(x0))**2\n",
+ "u2=(1-2*(x0-x[2])*dl2)*(l2(x0))**2\n",
+ "v0=(x0-x[0])*l0(x0)**2\n",
+ "v1=(x0-x[1])*l1(x0)**2\n",
+ "v2=(x0-x[2])*l2(x0)**2\n",
+ "H=u0*y[0]+u1*y[1]+u2*y[2]+v0*y1[0]+v1*y1[1]+v2*y1[2]\n",
+ "print \"the approximate value of ln(%0.2f) is %f:\" %(x0,H)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the approximate value of ln(2.70) is 0.993362:\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.22:pg-114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#newton's general interpolation formula\n",
+ "#example 3.22\n",
+ "#page 114\n",
+ "x=[300, 304, 305, 307]\n",
+ "y=[2.4771, 2.4829, 2.4843, 2.4871]\n",
+ "d1=[0,0,0]\n",
+ "d2=[0,0]\n",
+ "for i in range(0,3):\n",
+ " d1[i]=(y[i+1]-y[i])/(x[i+1]-x[i])\n",
+ "for i in range(0,2):\n",
+ " d2[i]=(d1[i+1]-d1[i])/(x[i+2]-x[i])\n",
+ "x0=301\n",
+ "log301=y[0]+(x0-x[0])*d1[0]+(x0-x[1])*d2[0]\n",
+ "print \"valure of log(%d) is :%0.4f\" %(x0,log301)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "valure of log(301) is :2.4786\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.23:pg-114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3.23\n",
+ "#newton's divided formula\n",
+ "#page 114\n",
+ "x=[-1, 0, 3, 6, 7]\n",
+ "y=[3, -6, 39, 822, 1611]\n",
+ "d1=[0,0,0,0,0]\n",
+ "d2=[0,0,0,0,0]\n",
+ "d3=[0,0,0,0,0]\n",
+ "d4=[0,0,0,0,0]\n",
+ "X=0\n",
+ "for i in range(0,3):\n",
+ " d1[i]=(y[i+1]-y[i])/(x[i+1]-x[i])\n",
+ "for i in range(0,3):\n",
+ " d2[i]=(d1[i+1]-d1[i])/(x[i+2]-x[i])\n",
+ "for i in range(0,2):\n",
+ " d3[i]=(d2[i+1]-d2[i])/(x[i+3]-x[i])\n",
+ "for i in range(0,1):\n",
+ " d4[i]=(d3[i+1]-d3[i])/(x[i+4]-x[i])\n",
+ "f_x=y[0]+(X-x[0])*d1[0]+(X-x[1])*(X-x[0])*d2[0]+(X-x[0])*(X-x[1])*(X-x[2])*d3[0]+(X-x[0])*(X-x[1])*(X-x[2])*(X-x[3])*d4[0]\n",
+ "print \"the polynomial equation is = -6 + 5X^2 -3X^3 +X^4\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the polynomial equation is = -6 + 5X^2 -3X^3 +X^4\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.24:pg-116"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#interpolation by iteration\n",
+ "#example 3.24\n",
+ "#page 116\n",
+ "import numpy\n",
+ "x=[300, 304, 305, 307]\n",
+ "y=[2.4771, 2.4829, 2.4843, 2.4871]\n",
+ "x0=301\n",
+ "d1=[0,0,0]\n",
+ "d2=[0,0]\n",
+ "d3=[0]\n",
+ "for i in range(0,3):\n",
+ " a=y[i]\n",
+ " b=x[i]-x0\n",
+ " c=y[i+1]\n",
+ " e=x[i+1]-x0\n",
+ " d=matrix([[a,b],[c,e]])\n",
+ " d11=numpy.linalg.det(d)\n",
+ " d1[i]=d11/(x[i+1]-x[i])\n",
+ "for i in range(0,2):\n",
+ " a=d1[i]\n",
+ " b=x[i+1]-x0\n",
+ " c=d1[i+1]\n",
+ " e=x[i+2]-x0\n",
+ " d=matrix([[a,b],[c,e]])\n",
+ " d22=numpy.linalg.det(d)\n",
+ " f=(x[i+2]-x[i+1])\n",
+ " d2[i]=d22/f\n",
+ "for i in range(0,1):\n",
+ " a=d2[i]\n",
+ " b=x[i+2]-x0\n",
+ " c=d2[i+1]\n",
+ " e=x[i+3]-x0\n",
+ " d=matrix([[a,b],[c,e]])\n",
+ " d33=numpy.linalg.det(d)\n",
+ " d3[i]=d33/(x[i+3]-x[i+2])\n",
+ "print \"the value of log(%d) is : %f\" %(x0,d3[0])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the value of log(301) is : 2.476900\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.25:pg-118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#inverse intrpolation\n",
+ "#example 3.25\n",
+ "#page 118\n",
+ "from __future__ import division\n",
+ "x=[2, 3, 4, 5]\n",
+ "y=[8, 27, 64, 125]\n",
+ "d1=[0,0,0]\n",
+ "d2=[0,0]\n",
+ "d3=[0]\n",
+ "for i in range(0,3):\n",
+ " d1[i]=y[i+1]-y[i]\n",
+ "for i in range(0,2):\n",
+ " d2[i]=d1[i+1]-d1[i]\n",
+ "for i in range(0,1):\n",
+ " d3[i]=d2[i+1]-d2[i]\n",
+ "yu=10 #square rooot of 10\n",
+ "y0=y[0]\n",
+ "d=[d1[0], d2[0] ,d3[0]]\n",
+ "u1=(yu-y0)/d1[0]\n",
+ "u2=((yu-y0-u1*(u1-1)*d2[0]/2)/d1[0])\n",
+ "u3=(yu-y0-u2*(u2-1)*d2[0]/2-u2*(u2-1)*(u2-2)*d3[0]/6)/d1[0]\n",
+ "u4=(yu-y0-u3*(u3-1)*d2[0]/2-u3*(u3-1)*(u3-2)*d3[0]/6)/d1[0]\n",
+ "u5=(yu-y0-u4*(u4-1)*d2[0]/2-u4*(u4-1)*(u4-2)*d3[0]/6)/d1[0]\n",
+ "print \"%f \\n %f \\n %f \\n %f \\n %f \\n \" %(u1,u2,u3,u4,u5)\n",
+ "print \"the approximate square root of %d is: %0.3f\" %(yu,x[0]+u5)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.105263 \n",
+ " 0.149876 \n",
+ " 0.153210 \n",
+ " 0.154107 \n",
+ " 0.154347 \n",
+ " \n",
+ "the approximate square root of 10 is: 2.154\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.26:pg-119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#double interpolation \n",
+ "#example 3.26\n",
+ "#page 119\n",
+ "y=[0, 1, 2, 3, 4]\n",
+ "z=[0,0,0,0,0]\n",
+ "x=[[0, 1, 4, 9, 16],[2, 3, 6, 11, 18],[6, 7, 10, 15, 22],[12, 13, 16, 21, 28],[18, 19, 22, 27, 34]]\n",
+ "print \"X=\"\n",
+ "print x\n",
+ "#for x=2.5\n",
+ "for i in range(0,5):\n",
+ " z[i]=(x[i][2]+x[i][3])/2\n",
+ "#y=1.5\n",
+ "Z=(z[1]+z[2])/2\n",
+ "print \"the interpolated value when x=2.5 and y=1.5 is : %f\" %(Z)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "X=\n",
+ "[[0, 1, 4, 9, 16], [2, 3, 6, 11, 18], [6, 7, 10, 15, 22], [12, 13, 16, 21, 28], [18, 19, 22, 27, 34]]\n",
+ "the interpolated value when x=2.5 and y=1.5 is : 10.500000\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter4_9.ipynb b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter4_9.ipynb
new file mode 100644
index 00000000..3cc767e6
--- /dev/null
+++ b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter4_9.ipynb
@@ -0,0 +1,880 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:4bd129a1095a40e7b77ec9dd303e159b079be83a90556977b8afeff8b76637f9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter04:Least Squares and Fourier Transforms"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.1:pg-128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 4.1\n",
+ "#least square curve fitting procedure\n",
+ "#page 128\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "x=[0,1, 2, 3, 4, 5]\n",
+ "x_2=[0,0,0,0,0,0]\n",
+ "x_y=[0,0,0,0,0,0]\n",
+ "y=[0,0.6, 2.4, 3.5, 4.8, 5.7]\n",
+ "for i in range(1,5):\n",
+ " x_2[i]=x[i]**2\n",
+ " x_y[i]=x[i]*y[i]\n",
+ "S_x=0\n",
+ "S_y=0\n",
+ "S_x2=0 \n",
+ "S_xy=0\n",
+ "S1=0\n",
+ "S2=0\n",
+ "for i in range(1,5):\n",
+ " S_x=S_x+x[i]\n",
+ " S_y=S_y+y[i]\n",
+ " S_x2=S_x2+x_2[i]\n",
+ " S_xy=S_xy+x_y[i]\n",
+ "a1=(5*S_xy-S_x*S_y)/(5*S_x2-S_x**2)\n",
+ "a0=S_y/5-a1*S_x/5\n",
+ "print \"x\\t y\\t x^2\\t x*y\\t (y-avg(S_y)) \\t (y-a0-a1x)^2\\n\\n\"\n",
+ "for i in range (1,6):\n",
+ " print \"%d\\t %0.2f\\t %d\\t %0.2f\\t %0.2f\\t %.4f\\t\\n\" %(x[i],y[i],x_2[i],x_y[i],(y[i]-S_y/5)**2,(y[i]-a0-a1*x[i])**2)\n",
+ " S1=S1+(y[i]-S_y/5)**2 \n",
+ " S2=S2+(y[i]-a0-a1*x[i])**2\n",
+ "print \"---------------------------------------------------------------------------------------------------------------------------------------------\\n\\n\"\n",
+ "print \"%d\\t %0.2f\\t %d\\t %0.2f\\t %0.2f\\t %0.4f\\t\\n\\n\" %(S_x,S_y,S_x2,S_xy,S1,S2)\n",
+ "cc=math.sqrt((S1-S2)/S1) #correlation coefficient\n",
+ "print \"the correlation coefficient is:%0.4f\" %(cc)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x\t y\t x^2\t x*y\t (y-avg(S_y)) \t (y-a0-a1x)^2\n",
+ "\n",
+ "\n",
+ "1\t 0.60\t 1\t 0.60\t 2.76\t 0.1681\t\n",
+ "\n",
+ "2\t 2.40\t 4\t 4.80\t 0.02\t 0.0196\t\n",
+ "\n",
+ "3\t 3.50\t 9\t 10.50\t 1.54\t 0.0001\t\n",
+ "\n",
+ "4\t 4.80\t 16\t 19.20\t 6.45\t 0.0016\t\n",
+ "\n",
+ "5\t 5.70\t 0\t 0.00\t 11.83\t 0.0961\t\n",
+ "\n",
+ "---------------------------------------------------------------------------------------------------------------------------------------------\n",
+ "\n",
+ "\n",
+ "10\t 11.30\t 30\t 35.10\t 22.60\t 0.2855\t\n",
+ "\n",
+ "\n",
+ "the correlation coefficient is:0.9937\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.2:pg-129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 4.2\n",
+ "#least square curve fitting procedure\n",
+ "#page 129\n",
+ "from numpy import matrix\n",
+ "x=[0, 2, 5, 7]\n",
+ "y=[-1, 5, 12, 20]\n",
+ "x_2=[0,0,0,0]\n",
+ "xy=[0,0,0,0,]\n",
+ "for i in range (0,4):\n",
+ " x_2[i]=x[i]**2\n",
+ " xy[i]=x[i]*y[i]\n",
+ "print \"x\\t y\\t x^2\\t xy\\t \\n\\n\"\n",
+ "S_x=0 \n",
+ "S_y=0\n",
+ "S_x2=0\n",
+ "S_xy=0\n",
+ "for i in range(0,4):\n",
+ " print \"%d\\t %d\\t %d\\t %d\\t\\n\" %(x[i],y[i],x_2[i],xy[i])\n",
+ " S_x=S_x+x[i]\n",
+ " S_y=S_y+y[i]\n",
+ " S_x2=S_x2+x_2[i]\n",
+ " S_xy=S_xy+xy[i]\n",
+ "print \"%d\\t %d\\t %d\\t %d\\t\\n\" %(S_x,S_y,S_x2,S_xy)\n",
+ "A=matrix([[4,S_x],[S_x,S_x2]])\n",
+ "B=matrix([[S_y],[S_xy]])\n",
+ "C=A.I*B\n",
+ "print \"Best straight line fit Y=%.4f+x(%.4f)\" %(C[0][0],C[1][0])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x\t y\t x^2\t xy\t \n",
+ "\n",
+ "\n",
+ "0\t -1\t 0\t 0\t\n",
+ "\n",
+ "2\t 5\t 4\t 10\t\n",
+ "\n",
+ "5\t 12\t 25\t 60\t\n",
+ "\n",
+ "7\t 20\t 49\t 140\t\n",
+ "\n",
+ "14\t 36\t 78\t 210\t\n",
+ "\n",
+ "Best straight line fit Y=-1.1379+x(2.8966)\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.3:pg-130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 4.3\n",
+ "#least square curve fitting procedure\n",
+ "#page 130\n",
+ "from numpy import matrix\n",
+ "x=[0, 1, 2, 4, 6]\n",
+ "y=[0, 1, 3, 2, 8]\n",
+ "z=[2, 4, 3, 16, 8]\n",
+ "x2=[0,0,0,0,0]\n",
+ "y2=[0,0,0,0,0]\n",
+ "z2=[0,0,0,0,0]\n",
+ "xy=[0,0,0,0,0]\n",
+ "yz=[0,0,0,0,0]\n",
+ "zx=[0,0,0,0,0]\n",
+ "for i in range(0,5):\n",
+ " x2[i]=x[i]**2\n",
+ " y2[i]=y[i]**2\n",
+ " z2[i]=z[i]**2\n",
+ " xy[i]=x[i]*y[i]\n",
+ " zx[i]=z[i]*x[i]\n",
+ " yz[i]=y[i]*z[i]\n",
+ "S_x=0\n",
+ "S_y=0\n",
+ "S_z=0\n",
+ "S_x2=0\n",
+ "S_y2=0\n",
+ "S_z2=0\n",
+ "S_xy=0\n",
+ "S_zx=0\n",
+ "S_yz=0\n",
+ "for i in range(0,5):\n",
+ " S_x=S_x+x[i]\n",
+ " S_y=S_y+y[i]\n",
+ " S_z=S_z+z[i]\n",
+ " S_x2=S_x2+x2[i]\n",
+ " S_y2=S_y2+y2[i]\n",
+ " S_z2=S_z2+z2[i]\n",
+ " S_xy=S_xy+xy[i]\n",
+ " S_zx=S_zx+zx[i]\n",
+ " S_yz=S_yz+yz[i]\n",
+ "print \"x\\t y\\t z\\t x^2\\t xy\\t zx\\t y^2\\t yz\\n\\n\"\n",
+ "for i in range(0,5):\n",
+ " print \"%d\\t %d\\t %d\\t %d\\t %d\\t %d\\t %d\\t %d\\n\" %(x[i],y[i],z[i],x2[i],xy[i],zx[i],y2[i],yz[i])\n",
+ "print \"-------------------------------- --------------------------------------------------------------------------------------------------------------------------------------\\n\\n\"\n",
+ "print \"%d\\t %d\\t %d\\t %d\\t %d\\t %d\\t %d\\t %d\\n\\n\" %(S_x,S_y,S_z,S_x2,S_xy,S_zx,S_y2,S_yz)\n",
+ "A=matrix([[5,13,14],[13,57,63],[14,63,78]])\n",
+ "B=matrix([[33],[122],[109]])\n",
+ "C=A.I*B\n",
+ "print \"solution of above equation is:a=%d b=%d c=%d\" %(C[0][0],C[1][0],C[2][0])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x\t y\t z\t x^2\t xy\t zx\t y^2\t yz\n",
+ "\n",
+ "\n",
+ "0\t 0\t 2\t 0\t 0\t 0\t 0\t 0\n",
+ "\n",
+ "1\t 1\t 4\t 1\t 1\t 4\t 1\t 4\n",
+ "\n",
+ "2\t 3\t 3\t 4\t 6\t 6\t 9\t 9\n",
+ "\n",
+ "4\t 2\t 16\t 16\t 8\t 64\t 4\t 32\n",
+ "\n",
+ "6\t 8\t 8\t 36\t 48\t 48\t 64\t 64\n",
+ "\n",
+ "-------------------------------- --------------------------------------------------------------------------------------------------------------------------------------\n",
+ "\n",
+ "\n",
+ "13\t 14\t 33\t 57\t 63\t 122\t 78\t 109\n",
+ "\n",
+ "\n",
+ "solution of above equation is:a=2 b=5 c=-3\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.4:pg-131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 4.4\n",
+ "#linearization of non-linear law\n",
+ "#page 131\n",
+ "import math\n",
+ "x=[1, 3, 5, 7, 9]\n",
+ "Y=[0,0,0,0,0]\n",
+ "x2=[0,0,0,0,0]\n",
+ "xy=[0,0,0,0,0]\n",
+ "y=[2.473, 6.722, 18.274, 49.673, 135.026]\n",
+ "for i in range(0,5):\n",
+ " Y[i]=math.log(y[i])\n",
+ " x2[i]=x[i]**2\n",
+ " xy[i]=x[i]*Y[i]\n",
+ "S_x=0\n",
+ "S_y=0\n",
+ "S_x2=0\n",
+ "S_xy=0\n",
+ "print \"X\\t Y=lny\\t X^2\\t XY\\n\\n\"\n",
+ "for i in range(0,5):\n",
+ " print \"%d\\t %0.3f\\t %d\\t %0.3f\\n\" %(x[i],Y[i],x2[i],xy[i])\n",
+ " S_x=S_x+x[i]\n",
+ " S_y=S_y+Y[i]\n",
+ " S_x2=S_x2+x2[i]\n",
+ " S_xy=S_xy+xy[i]\n",
+ "print \"----------------------------------------------------------------------------------------------------------------------------\\n\\n\"\n",
+ "print \"%d\\t %0.3f\\t %d\\t %0.3f\\t\\n\\n\" %(S_x,S_y,S_x2,S_xy)\n",
+ "A1=((S_x/5)*S_xy-S_x*S_y)/((S_x/5)*S_x2-S_x**2)\n",
+ "A0=(S_y/5)-A1*(S_x/5)\n",
+ "a=math.exp(A0)\n",
+ "print \"y=%0.3fexp(%0.2fx)\" %(a,A1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "X\t Y=lny\t X^2\t XY\n",
+ "\n",
+ "\n",
+ "1\t 0.905\t 1\t 0.905\n",
+ "\n",
+ "3\t 1.905\t 9\t 5.716\n",
+ "\n",
+ "5\t 2.905\t 25\t 14.527\n",
+ "\n",
+ "7\t 3.905\t 49\t 27.338\n",
+ "\n",
+ "9\t 4.905\t 81\t 44.149\n",
+ "\n",
+ "----------------------------------------------------------------------------------------------------------------------------\n",
+ "\n",
+ "\n",
+ "25\t 14.527\t 165\t 92.636\t\n",
+ "\n",
+ "\n",
+ "y=1.500exp(0.50x)\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.5:pg-131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 4.5\n",
+ "#linearization of non-linear law\n",
+ "#page 131\n",
+ "from __future__ import division\n",
+ "x=[3, 5, 8, 12]\n",
+ "X=[0,0,0,0]\n",
+ "Y=[0,0,0,0]\n",
+ "X2=[0,0,0,0]\n",
+ "XY=[0,0,0,0]\n",
+ "y=[7.148, 10.231, 13.509, 16.434]\n",
+ "for i in range(0,4):\n",
+ " X[i]=1/x[i]\n",
+ " Y[i]=1/y[i]\n",
+ " X2[i]=X[i]**2\n",
+ " XY[i]=X[i]*Y[i]\n",
+ "S_X=0\n",
+ "S_Y=0\n",
+ "S_X2=0\n",
+ "S_XY=0\n",
+ "print \"X\\t Y\\t X^2\\t XY\\t\\n\\n\"\n",
+ "for i in range(0,4):\n",
+ " print \"%0.3f\\t %0.3f\\t %0.3f\\t %0.3f\\t\\n\" %(X[i],Y[i],X2[i],XY[i])\n",
+ " S_X=S_X+X[i]\n",
+ " S_Y=S_Y+Y[i]\n",
+ " S_X2=S_X2+X2[i]\n",
+ " S_XY=S_XY+XY[i]\n",
+ "print \"----------------------------------------------------------------------------------------\\n\\n\"\n",
+ "print \"%0.3f\\t %0.3f\\t %0.3f\\t %0.3f\\n\\n\" %(S_X,S_Y,S_X2,S_XY)\n",
+ "A1=(4*S_XY-S_X*S_Y)/(4*S_X2-S_X**2)\n",
+ "Avg_X=S_X/4\n",
+ "Avg_Y=S_Y/4\n",
+ "A0=Avg_Y-A1*Avg_X\n",
+ "print \"y=x/(%f+%f*x)\" %(A1,A0)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "X\t Y\t X^2\t XY\t\n",
+ "\n",
+ "\n",
+ "0.333\t 0.140\t 0.111\t 0.047\t\n",
+ "\n",
+ "0.200\t 0.098\t 0.040\t 0.020\t\n",
+ "\n",
+ "0.125\t 0.074\t 0.016\t 0.009\t\n",
+ "\n",
+ "0.083\t 0.061\t 0.007\t 0.005\t\n",
+ "\n",
+ "----------------------------------------------------------------------------------------\n",
+ "\n",
+ "\n",
+ "0.742\t 0.373\t 0.174\t 0.081\n",
+ "\n",
+ "\n",
+ "y=x/(0.316200+0.034500*x)\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.6:pg-134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 4.6\n",
+ "#curve fitting by polynomial\n",
+ "#page 134\n",
+ "from numpy import matrix\n",
+ "x=[0, 1, 2]\n",
+ "y=[1, 6, 17]\n",
+ "x2=[0,0,0]\n",
+ "x3=[0,0,0]\n",
+ "x4=[0,0,0]\n",
+ "xy=[0,0,0]\n",
+ "x2y=[0,0,0]\n",
+ "for i in range(0,3):\n",
+ " x2[i]=x[i]**2\n",
+ " x3[i]=x[i]**3\n",
+ " x4[i]=x[i]**4\n",
+ " xy[i]=x[i]*y[i]\n",
+ " x2y[i]=x2[i]*y[i]\n",
+ "print \"x\\t y\\t x^2\\t x^3\\t x^4\\t x*y\\t x^2*y\\t\\n\\n\"\n",
+ "S_x=0\n",
+ "S_y=0\n",
+ "S_x2=0\n",
+ "S_x3=0\n",
+ "S_x4=0\n",
+ "S_xy=0\n",
+ "S_x2y=0\n",
+ "for i in range(0,3):\n",
+ " print \"%d\\t %d\\t %d\\t %d\\t %d\\t %d\\t %d\\n\" %(x[i],y[i],x2[i],x3[i],x4[i],xy[i],x2y[i])\n",
+ " S_x=S_x+x[i]\n",
+ " S_y=S_y+y[i]\n",
+ " S_x2=S_x2+x2[i]\n",
+ " S_x3=S_x3+x3[i]\n",
+ " S_x4=S_x4+x4[i]\n",
+ " S_xy=S_xy+xy[i]\n",
+ " S_x2y=S_x2y+x2y[i]\n",
+ "print \"--------------------------------------------------------------------------------------------------------------------------------\\n\\n\"\n",
+ "print \"%d\\t %d\\t %d\\t %d\\t %d\\t %d\\t %d\\n \" %(S_x,S_y,S_x2,S_x3,S_x4,S_xy,S_x2y)\n",
+ "A=matrix([[3,S_x,S_x2],[S_x,S_x2,S_x3],[S_x2,S_x3,S_x4]])\n",
+ "B=matrix([[S_y],[S_xy],[S_x2y]])\n",
+ "C=A.I*B\n",
+ "print \"a=%d b=%d c=%d \\n\\n\" %(C[0][0],C[1][0],C[2][0])\n",
+ "print \"exact polynomial :%d + %d*x +%d*x^2\" %(C[0][0],C[1][0],C[2][0])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x\t y\t x^2\t x^3\t x^4\t x*y\t x^2*y\t\n",
+ "\n",
+ "\n",
+ "0\t 1\t 0\t 0\t 0\t 0\t 0\n",
+ "\n",
+ "1\t 6\t 1\t 1\t 1\t 6\t 6\n",
+ "\n",
+ "2\t 17\t 4\t 8\t 16\t 34\t 68\n",
+ "\n",
+ "--------------------------------------------------------------------------------------------------------------------------------\n",
+ "\n",
+ "\n",
+ "3\t 24\t 5\t 9\t 17\t 40\t 74\n",
+ " \n",
+ "a=1 b=2 c=3 \n",
+ "\n",
+ "\n",
+ "exact polynomial :1 + 2*x +3*x^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.7:pg-134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 4.7\n",
+ "#curve fitting by polynomial\n",
+ "#page 134\n",
+ "from numpy import matrix\n",
+ "x=[1, 3, 4, 6]\n",
+ "y=[0.63, 2.05, 4.08, 10.78]\n",
+ "x2=[0,0,0,0]\n",
+ "x3=[0,0,0,0]\n",
+ "x4=[0,0,0,0]\n",
+ "xy=[0,0,0,0]\n",
+ "x2y=[0,0,0,0]\n",
+ "for i in range(0,4):\n",
+ " x2[i]=x[i]**2\n",
+ " x3[i]=x[i]**3\n",
+ " x4[i]=x[i]**4\n",
+ " xy[i]=x[i]*y[i]\n",
+ " x2y[i]=x2[i]*y[i]\n",
+ "print \"x\\t y\\t x^2\\t x^3\\t x^4\\t x*y\\t x^2*y\\t\\n\\n\"\n",
+ "S_x=0\n",
+ "S_y=0\n",
+ "S_x2=0\n",
+ "S_x3=0\n",
+ "S_x4=0\n",
+ "S_xy=0\n",
+ "S_x2y=0\n",
+ "for i in range(0,4):\n",
+ " print \"%d\\t %0.3f\\t %d\\t %d\\t %d\\t %0.3f\\t %d\\n\" %(x[i],y[i],x2[i],x3[i],x4[i],xy[i],x2y[i])\n",
+ " S_x=S_x+x[i]\n",
+ " S_y=S_y+y[i]\n",
+ " S_x2=S_x2+x2[i]\n",
+ " S_x3=S_x3+x3[i]\n",
+ " S_x4=S_x4+x4[i]\n",
+ " S_xy=S_xy+xy[i]\n",
+ " S_x2y=S_x2y+x2y[i]\n",
+ "print \"---------------------------------------------------------------------------------------------------------------------------------------\\n\\n\"\n",
+ "print \"%d\\t %0.3f\\t %d\\t %d\\t %d\\t %0.3f\\t %0.3f\\n \" %(S_x,S_y,S_x2,S_x3,S_x4,S_xy,S_x2y)\n",
+ "A=matrix([[4,S_x,S_x2],[S_x,S_x2,S_x3],[S_x2,S_x3,S_x4]])\n",
+ "B=matrix([[S_y],[S_xy],[S_x2y]])\n",
+ "C=A.I*B\n",
+ "print \"a=%0.2f b=%0.2f c=%0.2f \\n\\n\" %(C[0][0],C[1][0],C[2][0])\n",
+ "print \"exact polynomial :%0.2f + %0.2f*x +%0.2f*x^2\" %(C[0][0],C[1][0],C[2][0])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x\t y\t x^2\t x^3\t x^4\t x*y\t x^2*y\t\n",
+ "\n",
+ "\n",
+ "1\t 0.630\t 1\t 1\t 1\t 0.630\t 0\n",
+ "\n",
+ "3\t 2.050\t 9\t 27\t 81\t 6.150\t 18\n",
+ "\n",
+ "4\t 4.080\t 16\t 64\t 256\t 16.320\t 65\n",
+ "\n",
+ "6\t 10.780\t 36\t 216\t 1296\t 64.680\t 388\n",
+ "\n",
+ "---------------------------------------------------------------------------------------------------------------------------------------\n",
+ "\n",
+ "\n",
+ "14\t 17.540\t 62\t 308\t 1634\t 87.780\t 472.440\n",
+ " \n",
+ "a=1.24 b=-1.05 c=0.44 \n",
+ "\n",
+ "\n",
+ "exact polynomial :1.24 + -1.05*x +0.44*x^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.8:pg-137"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#curve fitting by sum of exponentials\n",
+ "#example 4.8\n",
+ "#page 137\n",
+ "import math\n",
+ "from numpy import matrix\n",
+ "x=[1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8]\n",
+ "y=[1.54, 1.67, 1.81, 1.97, 2.15, 2.35, 2.58, 2.83, 3.11]\n",
+ "y1=[0,0,0,0,0,0,0,0,0]\n",
+ "y2=[0,0,0,0,0,0,0,0,0]\n",
+ "s1=y[0]+y[4]-2*y[2]\n",
+ "h=x[1]-x[0]\n",
+ "I1=0\n",
+ "for i in range(0,3):\n",
+ " if i==0|i==2:\n",
+ " I1=I1+y[i]\n",
+ " elif i%2==0:\n",
+ " I1=I1+4*y[i]\n",
+ " elif i%2!=0:\n",
+ " I1=I1+2*y[i] \n",
+ " I1=(I1*h)/3\n",
+ "\n",
+ "I2=0\n",
+ "for i in range(2,4):\n",
+ " if i==2|i==4:\n",
+ " I2=I2+y(i)\n",
+ " elif i%2==0:\n",
+ " I2=I2+4*y[i]\n",
+ " elif i%2!=0:\n",
+ " I2=I2+2*y[i] \n",
+ " \n",
+ " I2=(I2*h)/3\n",
+ " for i in range(0,4):\n",
+ " y1[i]=(1.0-x[i])*y[i]\n",
+ " for i in range(4,8):\n",
+ " y2[i]=(1.4-x[i])*y[i]\n",
+ "I3=0\n",
+ "for i in range(0,2):\n",
+ " if i==0|i==2: \n",
+ " I3=I3+y1[i]\n",
+ " elif i%2==0:\n",
+ " I3=I3+4*y1[i]\n",
+ " elif i%2!=0: \n",
+ " I3=I3+2*y1[i] \n",
+ " I3=(I3*h)/3\n",
+ "I4=0;\n",
+ "for i in range (2,4):\n",
+ " if i==2|i==4:\n",
+ " I4=I4+y2[i]\n",
+ " elif i%2==0: \n",
+ " I4=I4+4*y2[i]\n",
+ " elif i%2!=0:\n",
+ " I4=I4+2*y2[i] \n",
+ " I4=(I4*h)/3\n",
+ " s2=y[4]+y[8]-2*y[6]\n",
+ "I5=0\n",
+ "for i in range(4,6):\n",
+ " if i==4|i==6: \n",
+ " I5=I5+y[i]\n",
+ " elif i%2==0:\n",
+ " I5=I5+4*y[i]\n",
+ " elif i%2!=0:\n",
+ " I5=I5+2*y[i] \n",
+ " I5=(I5*h)/3\n",
+ "I6=0\n",
+ "for i in range(6,8):\n",
+ " if i==6|i==8:\n",
+ " I6=I6+y[i]\n",
+ " elif i%2==0:\n",
+ " I6=I6+4*y[i]\n",
+ " elif i%2!=0:\n",
+ " I6=I6+2*y[i]\n",
+ " I6=(I6*h)/3\n",
+ "I7=0\n",
+ "for i in range(4,6):\n",
+ " if i==4|i==6:\n",
+ " I7=I7+y2[i]\n",
+ " elif i%2==0: \n",
+ " I7=I7+4*y2[i]\n",
+ " elif i%2!=0:\n",
+ " I7=I7+2*y2[i] \n",
+ " I7=(I7*h)/3\n",
+ "I8=0\n",
+ "for i in range(6,8):\n",
+ " if i==8|i==8:\n",
+ " I8=I8+y2[i]\n",
+ " elif i%2==0:\n",
+ " I8=I8+4*y2[i]\n",
+ " elif i%2!=0:\n",
+ " I8=I8+2*y2[i]\n",
+ " I8=(I8*h)/3\n",
+ "A=matrix([[1.81, 2.180],[2.88, 3.104]])\n",
+ "C=matrix([[2.10],[3.00]])\n",
+ "Z=A.I*C\n",
+ "p = np.poly1d([1,Z[0][0],Z[1][0]])\n",
+ "print \"the unknown value of equation is 1 -1 \" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the unknown value of equation is 1 -1 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Es4.9:pg-139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#linear weighted least approx\n",
+ "#example 4.9\n",
+ "#page 139\n",
+ "from numpy import matrix\n",
+ "x=[0, 2, 5, 7]\n",
+ "y=[-1, 5, 12, 20]\n",
+ "w=10 #given weight 10\n",
+ "W=[1, 1, 10, 1]\n",
+ "Wx=[0,0,0,0]\n",
+ "Wx2=[0,0,0,0]\n",
+ "Wx3=[0,0,0,0]\n",
+ "Wy=[0,0,0,0]\n",
+ "Wxy=[0,0,0,0]\n",
+ "for i in range(0,4):\n",
+ " Wx[i]=W[i]*x[i]\n",
+ " Wx2[i]=W[i]*x[i]**2\n",
+ " Wx3[i]=W[i]*x[i]**3\n",
+ " Wy[i]=W[i]*y[i]\n",
+ " Wxy[i]=W[i]*x[i]*y[i]\n",
+ "S_x=0\n",
+ "S_y=0\n",
+ "S_W=0\n",
+ "S_Wx=0\n",
+ "S_Wx2=0\n",
+ "S_Wy=0\n",
+ "S_Wxy=0\n",
+ "for i in range(0,4):\n",
+ " S_x=S_x+x[i]\n",
+ " S_y=S_y+y[i]\n",
+ " S_W=S_W+W[i]\n",
+ " S_Wx=S_Wx+Wx[i]\n",
+ " S_Wx2=S_Wx2+Wx2[i]\n",
+ " S_Wy=S_Wy+Wy[i]\n",
+ " S_Wxy=S_Wxy+Wxy[i]\n",
+ "A=matrix([[S_W,S_Wx],[S_Wx,S_Wx2]])\n",
+ "C=matrix([[S_Wy],[S_Wxy]])\n",
+ "print \"x\\t y\\t W\\t Wx\\t Wx^2\\t Wy\\t Wxy\\t\\n\\n\"\n",
+ "for i in range(0,4):\n",
+ " print \"%d\\t %d\\t %d\\t %d\\t %d\\t %d\\t %d\\t\\n\" %(x[i],y[i],W[i],Wx[i],Wx2[i],Wy[i],Wxy[i])\n",
+ "print \"-------------------------------------------------------------------------------------------------------------------------------------\\n\\n\"\n",
+ "print \"%d\\t %d\\t %d\\t %d\\t %d\\t %d\\t %d\\t\\n\" %(S_x,S_y,S_W,S_Wx,S_Wx2,S_Wy,S_Wxy)\n",
+ "X=A.I*C;\n",
+ "print \"\\n\\nthe equation is y=%f+%fx\" %(X[0][0],X[1][0])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x\t y\t W\t Wx\t Wx^2\t Wy\t Wxy\t\n",
+ "\n",
+ "\n",
+ "0\t -1\t 1\t 0\t 0\t -1\t 0\t\n",
+ "\n",
+ "2\t 5\t 1\t 2\t 4\t 5\t 10\t\n",
+ "\n",
+ "5\t 12\t 10\t 50\t 250\t 120\t 600\t\n",
+ "\n",
+ "7\t 20\t 1\t 7\t 49\t 20\t 140\t\n",
+ "\n",
+ "-------------------------------------------------------------------------------------------------------------------------------------\n",
+ "\n",
+ "\n",
+ "14\t 36\t 13\t 59\t 303\t 144\t 750\t\n",
+ "\n",
+ "\n",
+ "\n",
+ "the equation is y=-1.349345+2.737991x\n"
+ ]
+ }
+ ],
+ "prompt_number": 77
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.10:pg-139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#linear weighted least approx\n",
+ "#example 4.10\n",
+ "#page 139\n",
+ "x=[0, 2, 5, 7]\n",
+ "y=[-1, 5, 12, 20]\n",
+ "w=100 #given weight 100\n",
+ "W=[1, 1, 100, 1]\n",
+ "Wx=[0,0,0,0]\n",
+ "Wx2=[0,0,0,0]\n",
+ "Wx3=[0,0,0,0]\n",
+ "Wy=[0,0,0,0]\n",
+ "Wxy=[0,0,0,0]\n",
+ "for i in range(0,4):\n",
+ " Wx[i]=W[i]*x[i]\n",
+ " Wx2[i]=W[i]*x[i]**2\n",
+ " Wx3[i]=W[i]*x[i]**3\n",
+ " Wy[i]=W[i]*y[i]\n",
+ " Wxy[i]=W[i]*x[i]*y[i]\n",
+ "S_x=0\n",
+ "S_y=0\n",
+ "S_W=0\n",
+ "S_Wx=0\n",
+ "S_Wx2=0\n",
+ "S_Wy=0\n",
+ "S_Wxy=0\n",
+ "for i in range(0,4):\n",
+ " S_x=S_x+x[i]\n",
+ " S_y=S_y+y[i]\n",
+ " S_W=S_W+W[i]\n",
+ " S_Wx=S_Wx+Wx[i]\n",
+ " S_Wx2=S_Wx2+Wx2[i]\n",
+ " S_Wy=S_Wy+Wy[i]\n",
+ " S_Wxy=S_Wxy+Wxy[i]\n",
+ "A=matrix([[S_W,S_Wx],[S_Wx,S_Wx2]])\n",
+ "C=matrix([[S_Wy],[S_Wxy]])\n",
+ "print \"x\\t y\\t W\\t Wx\\t Wx^2\\t Wy\\t Wxy\\t\\n\\n\"\n",
+ "for i in range(0,4):\n",
+ " print \"%d\\t %d\\t %d\\t %d\\t %d\\t %d\\t %d\\t\\n\" %(x[i],y[i],W[i],Wx[i],Wx2[i],Wy[i],Wxy[i])\n",
+ "print \"-------------------------------------------------------------------------------------------------------------------------------------\\n\\n\"\n",
+ "print \"%d\\t %d\\t %d\\t %d\\t %d\\t %d\\t %d\\t\\n\" %(S_x,S_y,S_W,S_Wx,S_Wx2,S_Wy,S_Wxy)\n",
+ "X=A.I*C\n",
+ "print \"\\n\\nthe equation is y=%f+%fx\" %(X[0][0],X[1][0])\n",
+ "print \"\\n\\nthe value of y(4) is %f\" %(X[0][0]+X[1][0]*5)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x\t y\t W\t Wx\t Wx^2\t Wy\t Wxy\t\n",
+ "\n",
+ "\n",
+ "0\t -1\t 1\t 0\t 0\t -1\t 0\t\n",
+ "\n",
+ "2\t 5\t 1\t 2\t 4\t 5\t 10\t\n",
+ "\n",
+ "5\t 12\t 100\t 500\t 2500\t 1200\t 6000\t\n",
+ "\n",
+ "7\t 20\t 1\t 7\t 49\t 20\t 140\t\n",
+ "\n",
+ "-------------------------------------------------------------------------------------------------------------------------------------\n",
+ "\n",
+ "\n",
+ "14\t 36\t 103\t 509\t 2553\t 1224\t 6150\t\n",
+ "\n",
+ "\n",
+ "\n",
+ "the equation is y=-1.412584+2.690562x\n",
+ "\n",
+ "\n",
+ "the value of y(4) is 12.040227\n"
+ ]
+ }
+ ],
+ "prompt_number": 82
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter6_9.ipynb b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter6_9.ipynb
new file mode 100644
index 00000000..757bcf52
--- /dev/null
+++ b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter6_9.ipynb
@@ -0,0 +1,1072 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:4f380799ddd748d7c005b7eb0afef7c77160e5af919cbc18233369be08258e51"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter06:Numerical Differentiation and Integration"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.1:pg-201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.1\n",
+ "#numerical diffrentiation by newton's difference formula \n",
+ "#page 210\n",
+ "x=[1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2]\n",
+ "y=[2.7183, 3.3201, 4.0552, 4.9530, 6.0496, 7.3891, 9.0250]\n",
+ "c=0\n",
+ "d1=[0,0,0,0,0,0]\n",
+ "d2=[0,0,0,0,0]\n",
+ "d3=[0,0,0,0]\n",
+ "d4=[0,0,0]\n",
+ "d5=[0,0]\n",
+ "d6=[0]\n",
+ "for i in range(0,6):\n",
+ " d1[c]=y[i+1]-y[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,5):\n",
+ " d2[c]=d1[i+1]-d1[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,4):\n",
+ " d3[c]=d2[i+1]-d2[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,3):\n",
+ " d4[c]=d3[i+1]-d3[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,2):\n",
+ " d5[c]=d4[i+1]-d4[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,1):\n",
+ " d6[c]=d5[i+1]-d5[i]\n",
+ " c=c+1;\n",
+ "x0=1.2 #first and second derivative at 1.2\n",
+ "h=0.2\n",
+ "f1=((d1[1]-d2[1]/2+d3[1]/3-d4[1]/4+d5[1]/5)/h)\n",
+ "print \"the first derivative of fuction at 1.2 is:%f\\n\" %(f1)\n",
+ "f2=(d2[1]-d3[1]+(11*d4[1])/12-(5*d5[1])/6)/h**2\n",
+ "print \"the second derivative of fuction at 1.2 is:%f\\n\" %(f2)\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the first derivative of fuction at 1.2 is:3.320317\n",
+ "\n",
+ "the second derivative of fuction at 1.2 is:3.319167\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.2:pg-211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.2\n",
+ "#numerical diffrentiation by newton's difference formula \n",
+ "#page 211\n",
+ "x=[1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2]\n",
+ "y=[2.7183, 3.3201, 4.0552, 4.9530, 6.0496, 7.3891, 9.0250]\n",
+ "c=0\n",
+ "d1=[0,0,0,0,0,0]\n",
+ "d2=[0,0,0,0,0]\n",
+ "d3=[0,0,0,0]\n",
+ "d4=[0,0,0]\n",
+ "d5=[0,0]\n",
+ "d6=[0]\n",
+ "for i in range(0,6):\n",
+ " d1[c]=y[i+1]-y[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,5):\n",
+ " d2[c]=d1[i+1]-d1[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,4):\n",
+ " d3[c]=d2[i+1]-d2[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,3):\n",
+ " d4[c]=d3[i+1]-d3[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,2):\n",
+ " d5[c]=d4[i+1]-d4[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,1):\n",
+ " d6[c]=d5[i+1]-d5[i]\n",
+ " c=c+1;\n",
+ "x0=2.2 #first and second derivative at 2.2\n",
+ "h=0.2\n",
+ "f1=((d1[5]+d2[4]/2+d3[3]/3+d4[2]/4+d5[1]/5)/h)\n",
+ "print \"the first derivative of fuction at 1.2 is:%f\\n\" %(f1)\n",
+ "f2=(d2[4]+d3[3]+(11*d4[2])/12+(5*d5[1])/6)/h**2\n",
+ "print \"the second derivative of fuction at 1.2 is:%f\\n\" %(f2)\n",
+ "x1=2.0 # first derivative also at 2.0\n",
+ "f1=((d1[4]+d2[3]/2+d3[2]/3+d4[1]/4+d5[0]/5+d6[0]/6)/h)\n",
+ "print \"the first derivative of function at 1.2 is:%f\\n\" %(f1)\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the first derivative of fuction at 1.2 is:9.022817\n",
+ "\n",
+ "the second derivative of fuction at 1.2 is:8.992083\n",
+ "\n",
+ "the first derivative of function at 1.2 is:7.389633\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.3:pg-211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.3\n",
+ "#numerical diffrentiation by newton's difference formula \n",
+ "#page 211\n",
+ "x=[1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2]\n",
+ "y=[2.7183, 3.3201, 4.0552, 4.9530, 6.0496, 7.3891, 9.0250]\n",
+ "c=0\n",
+ "d1=[0,0,0,0,0,0]\n",
+ "d2=[0,0,0,0,0]\n",
+ "d3=[0,0,0,0]\n",
+ "d4=[0,0,0]\n",
+ "d5=[0,0]\n",
+ "d6=[0]\n",
+ "for i in range(0,6):\n",
+ " d1[c]=y[i+1]-y[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,5):\n",
+ " d2[c]=d1[i+1]-d1[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,4):\n",
+ " d3[c]=d2[i+1]-d2[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,3):\n",
+ " d4[c]=d3[i+1]-d3[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,2):\n",
+ " d5[c]=d4[i+1]-d4[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,1):\n",
+ " d6[c]=d5[i+1]-d5[i]\n",
+ " c=c+1;\n",
+ "x0=1.6 #first and second derivative at 1.6\n",
+ "h=0.2\n",
+ "f1=(((d1[2]+d1[3])/2-(d3[1]+d3[2])/4+(d5[0]+d5[1])/60))/h\n",
+ "print \"the first derivative of function at 1.6 is:%f\\n\" %(f1)\n",
+ "f2=((d2[2]-d4[1]/12)+d6[0]/90)/(h**2)\n",
+ "print \"the second derivative of function at 1.6 is:%f\\n\" %(f2)\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the first derivative of function at 1.6 is:4.885975\n",
+ "\n",
+ "the second derivative of function at 1.6 is:4.953361\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.4:pg-213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.4\n",
+ "#estimation of errors \n",
+ "#page 213\n",
+ "x=[1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2]\n",
+ "y=[2.7183, 3.3201, 4.0552, 4.9530, 6.0496, 7.3891, 9.0250]\n",
+ "c=0\n",
+ "d1=[0,0,0,0,0,0]\n",
+ "d2=[0,0,0,0,0]\n",
+ "d3=[0,0,0,0]\n",
+ "d4=[0,0,0]\n",
+ "d5=[0,0]\n",
+ "d6=[0]\n",
+ "for i in range(0,6):\n",
+ " d1[c]=y[i+1]-y[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,5):\n",
+ " d2[c]=d1[i+1]-d1[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,4):\n",
+ " d3[c]=d2[i+1]-d2[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,3):\n",
+ " d4[c]=d3[i+1]-d3[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,2):\n",
+ " d5[c]=d4[i+1]-d4[i]\n",
+ " c=c+1;\n",
+ "c=0\n",
+ "for i in range(0,1):\n",
+ " d6[c]=d5[i+1]-d5[i]\n",
+ " c=c+1\n",
+ "x0=1.6 #first and second derivative at 1.6\n",
+ "h=0.2\n",
+ "f1=((d1[1]-d2[1]/2+d3[1]/3-d4[1]/4+d5[1]/5)/h)\n",
+ "print \"the first derivative of fuction at 1.2 is:%f\\n\" %(f1)\n",
+ "f2=(d2[1]-d3[1]+(11*d4[1])/12-(5*d5[1])/6)/h**2\n",
+ "print \"the second derivative of fuction at 1.2 is:%f\\n\" %(f2)\n",
+ "T_error1=((d3[1]+d3[2])/2)/(6*h) #truncation error\n",
+ "e=0.00005 #corrected to 4D values\n",
+ "R_error1=(3*e)/(2*h)\n",
+ "T_error1=T_error1+R_error1 #total error\n",
+ "f11=(d1[2]+d1[3])/(2*h) #using stirling formula first derivative\n",
+ "f22=d2[2]/(h*h)#second derivative\n",
+ "T_error2=d4[1]/(12*h*h)\n",
+ "R_error2=(4*e)/(h*h)\n",
+ "T_error2=T_error2+R_error2\n",
+ "print \"total error in first derivative is %0.4g:\\n\" %(T_error1)\n",
+ "print \"total error in second derivative is %0.4g:\" %(T_error2)\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the first derivative of fuction at 1.2 is:3.320317\n",
+ "\n",
+ "the second derivative of fuction at 1.2 is:3.319167\n",
+ "\n",
+ "total error in first derivative is 0.03379:\n",
+ "\n",
+ "total error in second derivative is 0.02167:\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.5:pg-214"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#cubic spline method\n",
+ "#example 6.5\n",
+ "#page 214\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "x=[0, math.pi/2, math.pi]\n",
+ "y=[0, 1, 0]\n",
+ "M0=0\n",
+ "M2=0\n",
+ "h=math.pi/2\n",
+ "M1=(6*(y[0]-2*y[1]+y[2])/(h**2)-M0-M2)/4\n",
+ "def s1(x):\n",
+ " return (2/math.pi)*(-2*3*x*x/(math.pi**2)+3/2)\n",
+ "S1=s1(math.pi/4)\n",
+ "print \"S1(pi/4)=%f\" %(S1)\n",
+ "def s2(x):\n",
+ " return (-24*x)/(math.pi**3)\n",
+ "S2=s2(math.pi/4)\n",
+ "print \"S2(pi/4)=%f\" %(S2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "S1(pi/4)=0.716197\n",
+ "S2(pi/4)=-0.607927\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.6:pg-216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#derivative by cubic spline method\n",
+ "#example 6.6\n",
+ "#page 216\n",
+ "x=[-2, -1, 2, 3]\n",
+ "y=[-12, -8, 3, 5] \n",
+ "def f(x):\n",
+ " return x**3/15-3*x**2/20+241*x/60-3.9\n",
+ "def s2(x):\n",
+ " return (((2-x)**3)/6*(14/55)+((x+1)**3)/6*(-74/55))/3+(-8-21/55)*(2-x)/3+(3-(9/6)*(-74/55))*(x+1)/3\n",
+ "h=0.0001\n",
+ "x0=1.0\n",
+ "y1=(s2(x0+h)-s2(x0))/h\n",
+ "print \"the value y1(%0.2f) is : %f\" %(x0,y1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the value y1(1.00) is : 3.527232\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.7:pg-218"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#maximun and minimun of functions\n",
+ "#example 6.7\n",
+ "#page 218\n",
+ "x=[1.2, 1.3, 1.4, 1.5, 1.6]\n",
+ "y=[0.9320, 0.9636, 0.9855, 0.9975, 0.9996]\n",
+ "d1=[0,0,0,0]\n",
+ "d2=[0,0,0]\n",
+ "for i in range(0,4):\n",
+ " d1[i]=y[i+1]-y[i]\n",
+ "for i in range(0,3):\n",
+ " d2[i]=d1[i+1]-d1[i]\n",
+ "p=(-d1[0]*2/d2[0]+1)/2;\n",
+ "print \"p=%f\" %(p)\n",
+ "h=0.1\n",
+ "x0=1.2\n",
+ "X=x0+p*h\n",
+ "print \" the value of X correct to 2 decimal places is : %0.2f\" %(X)\n",
+ "Y=y[4]-0.2*d1[3]+(-0.2)*(-0.2+1)*d2[2]/2\n",
+ "print \"the value Y=%f\" %(Y)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "p=3.757732\n",
+ " the value of X correct to 2 decimal places is : 1.58\n",
+ "the value Y=0.999972\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.8:pg-226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.8\n",
+ "#trapezoidal method for integration\n",
+ "#page 226\n",
+ "from __future__ import division\n",
+ "x=[7.47, 7.48, 7.49, 7.0, 7.51, 7.52]\n",
+ "f_x=[1.93, 1.95, 1.98, 2.01, 2.03, 2.06]\n",
+ "h=x[1]-x[0]\n",
+ "l=6\n",
+ "area=0\n",
+ "for i in range(0,l):\n",
+ " if i==0:\n",
+ " area=area+f_x[i]\n",
+ " elif i==l-1:\n",
+ " area=area+f_x[i]\n",
+ " else:\n",
+ " area=area+2*f_x[i]\n",
+ "area=area*(h/2)\n",
+ "print \"area bounded by the curve is %f\" %(area)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "area bounded by the curve is 0.099650\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.9:pg-226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.9\n",
+ "#simpson 1/3rd method for integration\n",
+ "#page 226\n",
+ "from __future__ import division\n",
+ "import math\n",
+ "x=[0,0.00, 0.25, 0.50, 0.75, 1.00]\n",
+ "y=[0,1.000, 0.9896, 0.9589, 0.9089, 0.8415]\n",
+ "h=x[2]-x[1]\n",
+ "area=0\n",
+ "for i in range(0,6):\n",
+ " y[i]=y[i]**2\n",
+ "for i in range(1,6):\n",
+ " if i==1:\n",
+ " area=area+y[i]\n",
+ " elif i==5:\n",
+ " area=area+y[i]\n",
+ " elif i%2==0:\n",
+ " area=area+4*y[i]\n",
+ " elif i%2!=0: \n",
+ " area=area+2*y[i]\n",
+ "area=(area/3)*(h*math.pi)\n",
+ "print \"area bounded by the curve is %f\" %(area)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "area bounded by the curve is 2.819247\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.10:pg-228"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.10\n",
+ "#integration by trapezoidal and simpson's method\n",
+ "#page 228\n",
+ "from __future__ import division\n",
+ "def f(x):\n",
+ " return 1/(1+x)\n",
+ "h=0.5\n",
+ "x=[0,0.0,0.5,1.0]\n",
+ "y=[0,0,0,0]\n",
+ "l=4\n",
+ "for i in range(0,l):\n",
+ " y[i]=f(x[i])\n",
+ "area=0 #trapezoidal method\n",
+ "for i in range(1,l):\n",
+ " if i==1:\n",
+ " area=area+y[i]\n",
+ " elif i==l-1:\n",
+ " area=area+y[i]\n",
+ " else:\n",
+ " area=area+2*y[i]\n",
+ "area=area*(h/2)\n",
+ "print \"area bounded by the curve by trapezoidal method with h=%f is %f\\n \\n\" %(h,area)\n",
+ "area=0 #simpson 1/3rd rule\n",
+ "for i in range(1,l):\n",
+ " if i==1: \n",
+ " area=area+y[i]\n",
+ " elif i==l-1:\n",
+ " area=area+y[i]\n",
+ " elif i%2==0:\n",
+ " area=area+4*y[i]\n",
+ " elif i%2!=0:\n",
+ " area=area+2*y[i]\n",
+ "area=(area*h)/3\n",
+ "print \"area bounded by the curve by simpson 1/3rd method with h=%f is %f\\n \\n\" %(h,area)\n",
+ "h=0.25\n",
+ "x=[0,0.0,0.25,0.5,0.75,1.0]\n",
+ "y=[0,0,0,0,0,0]\n",
+ "l=6\n",
+ "for i in range(0,l):\n",
+ " y[i]=f(x[i])\n",
+ "area=0 #trapezoidal method\n",
+ "for i in range(1,l):\n",
+ " if i==1: \n",
+ " area=area+y[i]\n",
+ " elif i==l-1:\n",
+ " area=area+y[i]\n",
+ " else:\n",
+ " area=area+2*y[i]\n",
+ "area=area*(h/2)\n",
+ "print \"area bounded by the curve by trapezoidal method with h=%f is %f\\n \\n\" %(h,area)\n",
+ "area=0 #simpson 1/3rd rule\n",
+ "for i in range(1,l):\n",
+ " if i==1:\n",
+ " area=area+y[i]\n",
+ " elif i==l-1:\n",
+ " area=area+y[i]\n",
+ " elif i%2==0:\n",
+ " area=area+4*y[i]\n",
+ " elif i%2!=0:\n",
+ " area=area+2*y[i]\n",
+ "area=(area*h)/3\n",
+ "print \"area bounded by the curve by simpson 1/3rd method with h=%f is %f\\n \\n\" %(h,area)\n",
+ "h=0.125\n",
+ "x=[0,0.0,0.125,0.25,0.375,0.5,0.625,0.75,0.875,1.0]\n",
+ "y=[0,0,0,0,0,0,0,0,0,0]\n",
+ "l=10\n",
+ "for i in range(0,l):\n",
+ " y[i]=f(x[i])\n",
+ "area=0 #trapezoidal method\n",
+ "for i in range(1,l):\n",
+ " if i==1:\n",
+ " area=area+y[i]\n",
+ " elif i==l-1:\n",
+ " area=area+y[i]\n",
+ " elif i%2==0:\n",
+ " area=area+2*y[i]\n",
+ " elif i%2!=0:\n",
+ " area=area+2*y[i]\n",
+ "area=area*(h/2)\n",
+ "print \"area bounded by the curve by trapezoidal method with h=%f is %f\\n \\n\" %(h,area)\n",
+ "area=0 #simpson 1/3rd rule\n",
+ "for i in range(1,l):\n",
+ " if i==1:\n",
+ " area=area+y[i]\n",
+ " elif i==l-1:\n",
+ " area=area+y[i]\n",
+ " elif i%2==0:\n",
+ " area=area+4*y[i]\n",
+ " elif i%2!=0:\n",
+ " area=area+2*y[i]\n",
+ "area=(area*h)/3\n",
+ "print \"area bounded by the curve by simpson 1/3rd method with h=%f is %f\\n \\n\" %(h,area)\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ " \n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "area bounded by the curve by trapezoidal method with h=0.500000 is 0.708333\n",
+ " \n",
+ "\n",
+ "area bounded by the curve by simpson 1/3rd method with h=0.500000 is 0.694444\n",
+ " \n",
+ "\n",
+ "area bounded by the curve by trapezoidal method with h=0.250000 is 0.697024\n",
+ " \n",
+ "\n",
+ "area bounded by the curve by simpson 1/3rd method with h=0.250000 is 0.693254\n",
+ " \n",
+ "\n",
+ "area bounded by the curve by trapezoidal method with h=0.125000 is 0.694122\n",
+ " \n",
+ "\n",
+ "area bounded by the curve by simpson 1/3rd method with h=0.125000 is 0.693155\n",
+ " \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.11:pg-229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.11\n",
+ "#rommberg's method\n",
+ "#page 229\n",
+ "from __future__ import division\n",
+ "def f(x):\n",
+ " return 1/(1+x)\n",
+ "k=0\n",
+ "h=0.5\n",
+ "x=[0,0.0,0.5,1.0]\n",
+ "y=[0,0,0,0]\n",
+ "I=[0,0,0]\n",
+ "I1=[0,0]\n",
+ "T2=[0]\n",
+ "l=4\n",
+ "for i in range(0,l):\n",
+ " y[i]=f(x[i])\n",
+ "area=0 #trapezoidal method\n",
+ "for i in range(1,l):\n",
+ " if i==1:\n",
+ " area=area+y[i]\n",
+ " elif i==l-1:\n",
+ " area=area+y[i]\n",
+ " else:\n",
+ " area=area+2*y[i]\n",
+ "area=area*(h/2)\n",
+ "I[k]=area\n",
+ "k=k+1\n",
+ "h=0.25\n",
+ "x=[0,0.0,0.25,0.5,0.75,1.0]\n",
+ "y=[0,0,0,0,0,0]\n",
+ "l=6\n",
+ "for i in range(0,l):\n",
+ " y[i]=f(x[i])\n",
+ "area=0 #trapezoidal method\n",
+ "for i in range(1,l):\n",
+ " if i==1:\n",
+ " area=area+y[i]\n",
+ " elif i==l-1:\n",
+ " area=area+y[i]\n",
+ " else:\n",
+ " area=area+2*y[i]\n",
+ "area=area*(h/2)\n",
+ "I[k]=area\n",
+ "k=k+1\n",
+ "h=0.125\n",
+ "x=[0,0.0,0.125,0.25,0.375,0.5,0.625,0.75,0.875,1.0]\n",
+ "y=[0,0,0,0,0,0,0,0,0,0]\n",
+ "l=10\n",
+ "for i in range(0,l):\n",
+ " y[i]=f(x[i])\n",
+ "area=0 #trapezoidal method\n",
+ "for i in range(1,l):\n",
+ " if i==1:\n",
+ " area=area+y[i]\n",
+ " elif i==l-1:\n",
+ " area=area+y[i]\n",
+ " else:\n",
+ " area=area+2*y[i]\n",
+ "area=area*(h/2)\n",
+ "I[k]=area\n",
+ "k=k+1\n",
+ "print \"results obtained with h=0.5 0.25 0.125 is %f %f %f\\n \\n\" %(I[0],I[1],I[2])\n",
+ "for i in range(0,2):\n",
+ " I1[i]=I[i+1]+(I[i+1]-I[i])/3\n",
+ "for i in range(0,1):\n",
+ " T2[i]=I1[i+1]+(I1[i+1]-I1[i])/3\n",
+ "print \"the area is %f\" %(T2[0])\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "results obtained with h=0.5 0.25 0.125 is 0.708333 0.697024 0.694122\n",
+ " \n",
+ "\n",
+ "the area is 0.693121\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.13:pg-230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#area using cubic spline method\n",
+ "#example 6.13\n",
+ "#page 230\n",
+ "x=[0, 0.5, 1.0]\n",
+ "y=[0, 1.0, 0.0]\n",
+ "h=0.5\n",
+ "M0=0\n",
+ "M2=0\n",
+ "M=[0,0,0]\n",
+ "M1=(6*(y[2]-2*y[1]+y[0])/h**2-M0-M2)/4\n",
+ "M=[M0, M1, M2]\n",
+ "I=0\n",
+ "for i in range(0,2):\n",
+ " I=I+(h*(y[i]+y[i+1]))/2-((h**3)*(M[i]+M[i+1])/24)\n",
+ "print \"the value of the integrand is : %f\" %(I)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the value of the integrand is : 0.625000\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.15:pg-233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#euler's maclaurin formula\n",
+ "#example 6.15\n",
+ "#page 233\n",
+ "import math\n",
+ "y=[0, 1, 0]\n",
+ "h=math.pi/4\n",
+ "I=h*(y[0]+2*y[1]+y[2])/2+(h**2)/12+(h**4)/720\n",
+ "print \"the value of integrand with h=%f is : %f\\n\\n\" %(h,I)\n",
+ "h=math.pi/8\n",
+ "y=[0, math.sin(math.pi/8), math.sin(math.pi*2/8), math.sin(math.pi*3/8), math.sin(math.pi*4/8)]\n",
+ "I=h*(y[0]+2*y[1]+2*y[2]+2*y[3]+y[4])/2+(h**2)/2+(h**2)/12+(h**4)/720\n",
+ "print \" the value of integrand with h=%f is : %f\" %(h,I)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the value of integrand with h=0.785398 is : 0.837331\n",
+ "\n",
+ "\n",
+ " the value of integrand with h=0.392699 is : 1.077106\n"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.17:pg-236"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# example 6.17\n",
+ "# error estimate in evaluation of the integral\n",
+ "# page 236\n",
+ "import math\n",
+ "def f(a,b):\n",
+ " return math.cos(a)+4*math.cos((a+b)/2)+math.cos(b)\n",
+ "a=0\n",
+ "b=math.pi/2\n",
+ "c=math.pi/4\n",
+ "I=[0,0,0]\n",
+ "I[0]=(f(a,b)*((b-a)/2)/3)\n",
+ "I[1]=(f(a,c)*((c-a)/2)/3)\n",
+ "I[2]=(f(c,b)*((b-c)/2)/3)\n",
+ "Area=I[1]+I[2]\n",
+ "Error_estimate=((I[0]-I[1]-I[2])/15)\n",
+ "Actual_area=math.sin(math.pi/2)-math.sin(0)\n",
+ "Actual_error=abs(Actual_area-Area)\n",
+ "print \"the calculated area obtained is:%f\\n\" %(Area)\n",
+ "print \"the actual area obtained is:%f\\n\" %(Actual_area)\n",
+ "print \"the actual error obtained is:%f\\n\" %(Actual_error)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the calculated area obtained is:1.000135\n",
+ "\n",
+ "the actual area obtained is:1.000000\n",
+ "\n",
+ "the actual error obtained is:0.000135\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 49
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.18:pg-237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# example 6.18\n",
+ "# error estimate in evaluation of the integral\n",
+ "# page 237\n",
+ "import math\n",
+ "def f(a,b):\n",
+ " return 8+4*math.sin(a)+4*(8+4*math.sin((a+b)/2))+8+4*math.sin(b)\n",
+ "a=0\n",
+ "b=math.pi/2\n",
+ "c=math.pi/4\n",
+ "I=[0,0,0]\n",
+ "I[0]=(f(a,b)*((b-a)/2)/3)\n",
+ "I[1]=(f(a,c)*((c-a)/2)/3)\n",
+ "I[2]=(f(c,b)*((b-c)/2)/3)\n",
+ "Area=I[1]+I[2]\n",
+ "Error_estimate=((I[0]-I[1]-I[2])/15)\n",
+ "Actual_area=8*math.pi/2+4*math.sin(math.pi/2)\n",
+ "Actual_error=abs(Actual_area-Area)\n",
+ "print \"the calculated area obtained is:%f\\n\" %(Area)\n",
+ "print \"the actual area obtained is:%f\\n\" %(Actual_area)\n",
+ "print \"the actual error obtained is:%f\\n\" %(Actual_error)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the calculated area obtained is:16.566909\n",
+ "\n",
+ "the actual area obtained is:16.566371\n",
+ "\n",
+ "the actual error obtained is:0.000538\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.19:pg-242"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#gauss' formula\n",
+ "#example 6.19\n",
+ "#page 242\n",
+ "u=[-0.86113, -0.33998, 0.33998, 0.86113]\n",
+ "W=[0.34785, 0.65214, 0.65214, 0.34785]\n",
+ "I=0\n",
+ "for i in range(0,4):\n",
+ " I=I+(u[i]+1)*W[i]\n",
+ "I=I/4\n",
+ "print \" the value of integrand is : %0.5f\" %(I)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the value of integrand is : 0.49999\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.20:pg-247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 6.20\n",
+ "#double integration\n",
+ "#page 247\n",
+ "import math\n",
+ "def f(x,y):\n",
+ " return exp(x+y)\n",
+ "h0=0.5\n",
+ "k0=0.5\n",
+ "x=[[0,0,0],[0,0,0],[0,0,0]]\n",
+ "h=[0, 0.5, 1]\n",
+ "k=[0, 0.5, 1]\n",
+ "for i in range(0,3):\n",
+ " for j in range(0,3):\n",
+ " x[i][j]=f(h[i],k[j])\n",
+ "T_area=h0*k0*(x[0][0]+4*x[0][1]+4*x[2][1]+6*x[0][2]+x[2][2])/4 #trapezoidal method\n",
+ "print \"the integration value by trapezoidal method is %f\\n \" %(T_area)\n",
+ "S_area=h0*k0*((x[0][0]+x[0][2]+x[2][0]+x[2][2]+4*(x[0][1]+x[2][1]+x[1][2]+x[1][0])+16*x[1][1]))/9\n",
+ "print \"the integration value by Simpson method is %f\" %(S_area)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the integration value by trapezoidal method is 3.076274\n",
+ " \n",
+ "the integration value by Simpson method is 2.954484\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter7_9.ipynb b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter7_9.ipynb
new file mode 100644
index 00000000..aba1eb4b
--- /dev/null
+++ b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter7_9.ipynb
@@ -0,0 +1,714 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:0058f29553d8742ab5006900201b226161b38e64bcaf47caebba35d96ab2998b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter07:Numerical Linear Algebra"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.1:pg-256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7.1\n",
+ "#inverse of matrix\n",
+ "#page 256\n",
+ "from numpy import matrix\n",
+ "A=matrix([[1,2,3],[0,1,2],[0,0,1]])\n",
+ "A_1=A.I #inverse of matrix\n",
+ "print A_1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "[[ 1. -2. 1.]\n",
+ " [ 0. 1. -2.]\n",
+ " [ 0. 0. 1.]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex-7.2:pg-259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7.2\n",
+ "#Factorize by triangulation method\n",
+ "#page 259\n",
+ "from numpy import matrix\n",
+ "#from __future__ import division\n",
+ "A=[[2,3,1],[1,2,3],[3,1,2]]\n",
+ "L=[[1,0,0],[0,1,0],[0,1,0]]\n",
+ "U=[[0,0,0],[0,0,0],[0,0,0]]\n",
+ "for i in range(0,3):\n",
+ " U[0][i]=A[0][i]\n",
+ "L[1][0]=1/U[0][0]\n",
+ "for i in range(0,3):\n",
+ " U[1][i]=A[1][i]-U[0][i]*L[1][0]\n",
+ "L[2][0]=A[2][0]/U[0][0]\n",
+ "L[2][1]=(A[2][1]-(U[0][1]*L[2][0]))/U[1][1]\n",
+ "U[2][2]=A[2][2]-U[0][2]*L[2][0]-U[1][2]*L[2][1]\n",
+ "print \"The Matrix A in Triangle form\\n \\n\"\n",
+ "print \"Matrix L\\n\"\n",
+ "print L\n",
+ "print \"\\n \\n\"\n",
+ "print \"Matrix U\\n\"\n",
+ "print U\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Matrix A in Triangle form\n",
+ " \n",
+ "\n",
+ "Matrix L\n",
+ "\n",
+ "[[1, 0, 0], [0.5, 1, 0], [1.5, -7.0, 0]]\n",
+ "\n",
+ " \n",
+ "\n",
+ "Matrix U\n",
+ "\n",
+ "[[2, 3, 1], [0.0, 0.5, 2.5], [0, 0, 18.0]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.3:pg-262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7.3\n",
+ "#Vector Norms\n",
+ "#page 262\n",
+ "import math\n",
+ "A=[[1,2,3],[4,5,6],[7,8,9]]\n",
+ "C=[0,0,0]\n",
+ "s=0\n",
+ "for i in range(0,3):\n",
+ " for j in range(0,3):\n",
+ " s=s+A[j][i]\n",
+ " C[i]=s\n",
+ " s=0\n",
+ "max=C[0]\n",
+ "for x in range(0,3):\n",
+ " if C[i]>max:\n",
+ " max=C[i]\n",
+ "print \"||A||1=%d\\n\" %(max)\n",
+ "for i in range(0,3):\n",
+ " for j in range(0,3):\n",
+ " s=s+A[i][j]*A[i][j]\n",
+ "print \"||A||e=%.3f\\n\" %(math.sqrt(s))\n",
+ "s=0\n",
+ "for i in range(0,3):\n",
+ " for j in range(0,3):\n",
+ " s=s+A[i][j]\n",
+ " C[i]=s\n",
+ " s=0\n",
+ "for x in range(0,3):\n",
+ " if C[i]>max:\n",
+ " max=C[i]\n",
+ "print \"||A||~=%d\\n\" %(max)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "||A||1=18\n",
+ "\n",
+ "||A||e=16.882\n",
+ "\n",
+ "||A||~=24\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.4:pg-266"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7.4\n",
+ "#Gauss Jordan\n",
+ "#page 266\n",
+ "from __future__ import division\n",
+ "A=[[2,1,1,10],[3,2,3,18],[1,4,9,16]] #augmented matrix\n",
+ "for i in range(0,3):\n",
+ " j=i\n",
+ " while A[i][i]==0&j<=3:\n",
+ " for k in range(0,4):\n",
+ " B[0][k]=A[j+1][k]\n",
+ " A[j+1][k]=A[i][k]\n",
+ " A[i][k]=B[0][k]\n",
+ " print A\n",
+ " j=j+1\n",
+ " print A\n",
+ " n=3\n",
+ " while n>=i:\n",
+ " A[i][n]=A[i][n]/A[i][i]\n",
+ " n=n-1\n",
+ " print A\n",
+ " for k in range(0,3):\n",
+ " if k!=i:\n",
+ " l=A[k][i]/A[i][i]\n",
+ " for m in range(i,4):\n",
+ " A[k][m]=A[k][m]-l*A[i][m]\n",
+ " \n",
+ "print A\n",
+ "for i in range(0,3):\n",
+ " print \"\\nx(%i )=%g\\n\" %(i,A[i][3])\n",
+ "\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "[[2, 1, 1, 10], [3, 2, 3, 18], [1, 4, 9, 16]]\n",
+ "[[1.0, 0.5, 0.5, 5.0], [3, 2, 3, 18], [1, 4, 9, 16]]\n",
+ "[[1.0, 0.5, 0.5, 5.0], [0.0, 0.5, 1.5, 3.0], [0.0, 3.5, 8.5, 11.0]]\n",
+ "[[1.0, 0.5, 0.5, 5.0], [0.0, 1.0, 3.0, 6.0], [0.0, 3.5, 8.5, 11.0]]\n",
+ "[[1.0, 0.0, -1.0, 2.0], [0.0, 1.0, 3.0, 6.0], [0.0, 0.0, -2.0, -10.0]]\n",
+ "[[1.0, 0.0, -1.0, 2.0], [0.0, 1.0, 3.0, 6.0], [0.0, 0.0, 1.0, 5.0]]\n",
+ "[[1.0, 0.0, 0.0, 7.0], [0.0, 1.0, 0.0, -9.0], [0.0, 0.0, 1.0, 5.0]]\n",
+ "\n",
+ "x(0 )=7\n",
+ "\n",
+ "\n",
+ "x(1 )=-9\n",
+ "\n",
+ "\n",
+ "x(2 )=5\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.8:pg-273"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#LU decomposition method\n",
+ "#example 7.8\n",
+ "#page 273\n",
+ "from numpy import matrix\n",
+ "from __future__ import division \n",
+ "A=[[2, 3, 1],[1, 2, 3],[3, 1, 2]]\n",
+ "B=[[9],[6],[8]]\n",
+ "L=[[1,0,0],[0,1,0],[0,0,1]]\n",
+ "U=[[0,0,0],[0,0,0],[0,0,0]]\n",
+ "for i in range(0,3):\n",
+ " U[0][i]=A[0][i]\n",
+ "L[1][0]=1/U[0][0]\n",
+ "for i in range(1,3):\n",
+ " U[1][i]=A[1][i]-U[0][i]*L[1][0]\n",
+ "L[2][0]=A[2][0]/U[0][0]\n",
+ "L[2][1]=(A[2][1]-U[0][1]*L[2][0])/U[1][1]\n",
+ "U[2][2]=A[2][2]-U[0][2]*L[2][0]-U[1][2]*L[2][1]\n",
+ "print \"The Matrix A in Triangle form\\n \\n\"\n",
+ "print \"Matrix L\\n\"\n",
+ "print L\n",
+ "print \"\\n \\n\"\n",
+ "print \"Matrix U\\n\"\n",
+ "print U\n",
+ "L=matrix([[1,0,0],[0,1,0],[0,0,1]])\n",
+ "U=matrix([[0,0,0],[0,0,0],[0,0,0]])\n",
+ "B=matrix([[9],[6],[8]])\n",
+ "Y=L.I*B\n",
+ "X=matrix([[1.944444],[1.611111],[0.277778]])\n",
+ "print \"the values of x=%f,y=%f,z=%f\" %(X[0][0],X[1][0],X[2][0])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Matrix A in Triangle form\n",
+ " \n",
+ "\n",
+ "Matrix L\n",
+ "\n",
+ "[[1, 0, 0], [0.5, 1, 0], [1.5, -7.0, 1]]\n",
+ "\n",
+ " \n",
+ "\n",
+ "Matrix U\n",
+ "\n",
+ "[[2, 3, 1], [0, 0.5, 2.5], [0, 0, 18.0]]\n",
+ "the values of x=1.944444,y=1.611111,z=0.277778\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.9:pg-276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#ill conditioned linear systems\n",
+ "#example 7.9\n",
+ "#page 276\n",
+ "from numpy import matrix\n",
+ "import math\n",
+ "A=matrix([[2, 1],[2,1.01]])\n",
+ "B=matrix([[2],[2.01]])\n",
+ "X=A.I*B\n",
+ "Ae=0\n",
+ "Ae=math.sqrt(Ae)\n",
+ "inv_A=A.I\n",
+ "invA_e=0\n",
+ "invA_e=math.sqrt(invA_e)\n",
+ "C=A_e*invA_e\n",
+ "k=2\n",
+ "if k<1:\n",
+ " print \"the fuction is ill conditioned\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 56
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.10:pg-277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#ill condiioned linear systems\n",
+ "#example 7.10\n",
+ "#page 277\n",
+ "import numpy\n",
+ "from __future__ import division \n",
+ "A=[[1/2, 1/3, 1/4],[1/5, 1/6, 1/7],[1/8,1/9, 1/10]] #hilbert's matrix\n",
+ "de_A=numpy.linalg.det(A)\n",
+ "if de_A<1:\n",
+ " print \"A is ill-conditioned\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A is ill-conditioned\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.11:pg-277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#ill conditioned linear system\n",
+ "#example 7.11\n",
+ "#page 277\n",
+ "import numpy\n",
+ "import math\n",
+ "A=[[25, 24, 10],[66, 78, 37],[92, -73, -80]]\n",
+ "de_A=numpy.linalg.det(A)\n",
+ "for i in range(0,2):\n",
+ " s=0\n",
+ " for j in range(0,2):\n",
+ " s=s+A[i][j]**2\n",
+ " s=math.sqrt(s)\n",
+ " k=de_A/s\n",
+ "if k<1:\n",
+ " print\" the fuction is ill conditioned\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " the fuction is ill conditioned\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.12:pg-278"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#ill-conditioned system\n",
+ "#example 7.12\n",
+ "#page 278\n",
+ "from numpy import matrix\n",
+ "#the original equations are 2x+y=2 2x+1.01y=2.01\n",
+ "A1=matrix([[2, 1],[2, 1.01]])\n",
+ "C1=matrix([[2],[2.01]])\n",
+ "x1=1\n",
+ "y1=1 # approximate values\n",
+ "A2=matrix([[2, 1],[2, 1.01]])\n",
+ "C2=matrix([[3],[3.01]])\n",
+ "C=C1-C2\n",
+ "X=A1.I*C\n",
+ "x=X[0][0]+x1\n",
+ "y=X[1][0]+y1\n",
+ "print \"the exact solution is X=%f \\t Y=%f\" %(x,y)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the exact solution is X=0.500000 \t Y=1.000000\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.14:pg-282"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#solution of equations by iteration method\n",
+ "#example 7.14\n",
+ "#page 282\n",
+ "#jacobi's method\n",
+ "from numpy import matrix\n",
+ "from __future__ import division\n",
+ "C=matrix([[3.333],[1.5],[1.4]])\n",
+ "X=matrix([[3.333],[1.5],[1.4]])\n",
+ "B=matrix([[0, -0.1667, -0.1667],[-0.25, 0, 0.25],[-0.2, 0.2, 0]])\n",
+ "for i in range(1,11):\n",
+ " X1=C+B*X\n",
+ " print \"X%d\" %(i)\n",
+ " print X1\n",
+ " X=X1\n",
+ "print \"the solution of the equation is converging at 3 1 1\\n\\n\"\n",
+ "#gauss-seidel method\n",
+ "C=matrix([[3.333],[1.5],[1.4]])\n",
+ "X=matrix([[3.333],[1.5],[1.4]])\n",
+ "B=matrix([[0, -0.1667, -0.1667],[-0.25, 0, 0.25],[-0.2, 0.2, 0]])\n",
+ "X1=C+B*X\n",
+ "x=X1[0][0]\n",
+ "y=X1[1][0]\n",
+ "z=X1[2][0]\n",
+ "for i in range(0,5):\n",
+ " x=3.333-0.1667*y-0.1667*z\n",
+ " y=1.5-0.25*x+0.25*z\n",
+ " z=1.4-0.2*x+0.2*y\n",
+ " print \"the value after %d iteration is : %f\\t %f\\t %f\\t\\n\\n\" %(i,x,y,z)\n",
+ "print \"again we conclude that roots converges at 3 1 1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "X1\n",
+ "[[ 2.84957]\n",
+ " [ 1.01675]\n",
+ " [ 1.0334 ]]\n",
+ "X2\n",
+ "[[ 2.99124 ]\n",
+ " [ 1.0459575]\n",
+ " [ 1.033436 ]]\n",
+ "X3\n",
+ "[[ 2.9863651]\n",
+ " [ 1.010549 ]\n",
+ " [ 1.0109435]]\n",
+ "X4\n",
+ "[[ 2.9960172 ]\n",
+ " [ 1.0061446 ]\n",
+ " [ 1.00483678]]\n",
+ "X5\n",
+ "[[ 2.9977694 ]\n",
+ " [ 1.00220489]\n",
+ " [ 1.00202548]]\n",
+ "X6\n",
+ "[[ 2.9988948 ]\n",
+ " [ 1.00106402]\n",
+ " [ 1.0008871 ]]\n",
+ "X7\n",
+ "[[ 2.99927475]\n",
+ " [ 1.00049808]\n",
+ " [ 1.00043384]]\n",
+ "X8\n",
+ "[[ 2.99944465]\n",
+ " [ 1.00028977]\n",
+ " [ 1.00024467]]\n",
+ "X9\n",
+ "[[ 2.99951091]\n",
+ " [ 1.0002 ]\n",
+ " [ 1.00016902]]\n",
+ "X10\n",
+ "[[ 2.99953848]\n",
+ " [ 1.00016453]\n",
+ " [ 1.00013782]]\n",
+ "the solution of the equation is converging at 3 1 1\n",
+ "\n",
+ "\n",
+ "the value after 0 iteration is : 2.991240\t 1.010540\t 1.003860\t\n",
+ "\n",
+ "\n",
+ "the value after 1 iteration is : 2.997200\t 1.001665\t 1.000893\t\n",
+ "\n",
+ "\n",
+ "the value after 2 iteration is : 2.999174\t 1.000430\t 1.000251\t\n",
+ "\n",
+ "\n",
+ "the value after 3 iteration is : 2.999486\t 1.000191\t 1.000141\t\n",
+ "\n",
+ "\n",
+ "the value after 4 iteration is : 2.999545\t 1.000149\t 1.000121\t\n",
+ "\n",
+ "\n",
+ "again we conclude that roots converges at 3 1 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.16:pg-286"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#largest eigenvalue and eigenvectors\n",
+ "#example 7.16\n",
+ "#page 286\n",
+ "from numpy import matrix\n",
+ "A=matrix([[1,6,1],[1,2,0],[0,0,3]])\n",
+ "I=matrix([[1],[0],[0]]) #initial eigen vector\n",
+ "X0=A*I\n",
+ "print \"X0=\"\n",
+ "print X0\n",
+ "X1=A*X0\n",
+ "print \"X1=\"\n",
+ "print X1\n",
+ "X2=A*X1\n",
+ "print \"X2=\"\n",
+ "print X2\n",
+ "X3=X2/3\n",
+ "print \"X3=\"\n",
+ "print X3\n",
+ "X4=A*X3\n",
+ "X5=X4/4\n",
+ "print \"X5=\"\n",
+ "print X5\n",
+ "X6=A*X5;\n",
+ "X7=X6/(4*4)\n",
+ "print \"X7=\"\n",
+ "print X7\n",
+ "print \"as it can be seen that highest eigen value is 4 \\n\\n the eigen vector is %d %d %d\" %(X7[0],X7[1],X7[2])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "X0=\n",
+ "[[1]\n",
+ " [1]\n",
+ " [0]]\n",
+ "X1=\n",
+ "[[7]\n",
+ " [3]\n",
+ " [0]]\n",
+ "X2=\n",
+ "[[25]\n",
+ " [13]\n",
+ " [ 0]]\n",
+ "X3=\n",
+ "[[8]\n",
+ " [4]\n",
+ " [0]]\n",
+ "X5=\n",
+ "[[8]\n",
+ " [4]\n",
+ " [0]]\n",
+ "X7=\n",
+ "[[2]\n",
+ " [1]\n",
+ " [0]]\n",
+ "as it can be seen that highest eigen value is 4 \n",
+ "\n",
+ " the eigen vector is 2 1 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.17:pg-290"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#housrholder's method\n",
+ "#example 7.17\n",
+ "#page 290\n",
+ "from numpy import matrix\n",
+ "from __future__ import division\n",
+ "import math\n",
+ "A=[[1, 3, 4],[3, 2, -1],[4, -1, 1]]\n",
+ "print A[1][1]\n",
+ "S=math.sqrt(A[0][1]**2+A[0][2]**2)\n",
+ "v2=math.sqrt((1+A[0][1]/S)/2)\n",
+ "v3=A[0][2]/(2*S)\n",
+ "v3=v3/v2\n",
+ "V=matrix([[0],[v2],[v3]])\n",
+ "P1=matrix([[1, 0, 0],[0, 1-2*v2**2, -2*v2*v3],[0, -2*v2*v3, 1-2*v3**2]])\n",
+ "A1=P1*A*P1\n",
+ "print \"the reduced matrix is \\n\\n\"\n",
+ "print A1\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n",
+ "the reduced matrix is \n",
+ "\n",
+ "\n",
+ "[[ 1.00000000e+00 -5.00000000e+00 -8.88178420e-16]\n",
+ " [ -5.00000000e+00 4.00000000e-01 2.00000000e-01]\n",
+ " [ -8.88178420e-16 2.00000000e-01 2.60000000e+00]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter8_9.ipynb b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter8_9.ipynb
new file mode 100644
index 00000000..f9594f07
--- /dev/null
+++ b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter8_9.ipynb
@@ -0,0 +1,1093 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:2931d18383652f9ddbbffb4012198b4962547d461a3374ea2ad7fe562dec2ad9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter08:Numerical Solution of Ordinary Differential Equations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.1:pg-304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 8.1\n",
+ "#taylor's method\n",
+ "#page 304\n",
+ "import math\n",
+ "f=1 #value of function at 0\n",
+ "def f1(x):\n",
+ " return x-f**2\n",
+ "def f2(x):\n",
+ " return 1-2*f*f1(x)\n",
+ "def f3(x):\n",
+ " return -2*f*f2(x)-2*f2(x)**2\n",
+ "def f4(x):\n",
+ " return -2*f*f3(x)-6*f1(x)*f2(x)\n",
+ "def f5(x):\n",
+ " return -2*f*f4(x)-8*f1(x)*f3(x)-6*f2(x)**2\n",
+ "h=0.1 #value at 0.1\n",
+ "k=f \n",
+ "for j in range(1,5):\n",
+ " if j==1:\n",
+ " k=k+h*f1(0);\n",
+ " elif j==2:\n",
+ " k=k+(h**j)*f2(0)/math.factorial(j)\n",
+ " elif j ==3:\n",
+ " k=k+(h**j)*f3(0)/math.factorial(j)\n",
+ " elif j ==4:\n",
+ " k=k+(h**j)*f4(0)/math.factorial(j)\n",
+ " elif j==5:\n",
+ " k=k+(h**j)*f5(0)/math.factorial(j)\n",
+ "print \"the value of the function at %.2f is :%0.4f\" %(h,k)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the value of the function at 0.10 is :0.9113\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.2:pg-304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#taylor's method\n",
+ "#example 8.2\n",
+ "#page 304\n",
+ "import math\n",
+ "f=1 #value of function at 0\n",
+ "f1=0 #value of first derivatie at 0\n",
+ "def f2(x):\n",
+ " return x*f1+f\n",
+ "def f3(x):\n",
+ " return x*f2(x)+2*f1\n",
+ "def f4(x):\n",
+ " return x*f3(x)+3*f2(x)\n",
+ "def f5(x):\n",
+ " return x*f4(x)+4*f3(x)\n",
+ "def f6(x):\n",
+ " return x*f5(x)+5*f4(x)\n",
+ "h=0.1 #value at 0.1\n",
+ "k=f\n",
+ "for j in range(1,6):\n",
+ " if j==1:\n",
+ " k=k+h*f1\n",
+ " elif j==2:\n",
+ " k=k+(h**j)*f2(0)/math.factorial(j)\n",
+ " elif j ==3:\n",
+ " k=k+(h**j)*f3(0)/math.factorial(j)\n",
+ " elif j ==4:\n",
+ " k=k+(h**j)*f4(0)/math.factorial(j)\n",
+ " elif j==5:\n",
+ " k=k+(h**j)*f5(0)/math.factorial(j)\n",
+ " else:\n",
+ " k=k+(h**j)*f6(0)/math.factorial (j)\n",
+ "print \"the value of the function at %.2f is :%0.7f\" %(h,k)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the value of the function at 0.10 is :1.0050125\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.3:pg-306"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 8.3\n",
+ "#picard's method\n",
+ "#page 306\n",
+ "from scipy import integrate\n",
+ "from __future__ import division\n",
+ "def f(x,y):\n",
+ " return x+y**2\n",
+ "y=[0,0,0,0]\n",
+ "y[1]=1\n",
+ "for i in range(1,3):\n",
+ " a=integrate.quad(lambda x:x+y[i]**2,0,i/10)\n",
+ " y[i+1]=a[0]+y[1]\n",
+ " print \"\\n y (%g) = %g\\n\" %(i/10,y[i+1])"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " y (0.1) = 1.105\n",
+ "\n",
+ "\n",
+ " y (0.2) = 1.26421\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.4:pg-306"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 8.4\n",
+ "#picard's method\n",
+ "#page 306\n",
+ "from scipy import integrate\n",
+ "y=[0,0,0,0] #value at 0\n",
+ "c=0.25\n",
+ "for i in range(0,3):\n",
+ " a=integrate.quad(lambda x:(x**2/(y[i]**2+1)),0,c)\n",
+ " y[i+1]=y[0]+a[0]\n",
+ " print \"\\n y(%0.2f) = %g\\n\" %(c,y[i+1])\n",
+ " c=c*2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " y(0.25) = 0.00520833\n",
+ "\n",
+ "\n",
+ " y(0.50) = 0.0416655\n",
+ "\n",
+ "\n",
+ " y(1.00) = 0.332756\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.5:pg-308"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 8.5\n",
+ "#euler's method\n",
+ "#page 308\n",
+ "def f(y):\n",
+ " return -1*y\n",
+ "y=[0,0,0,0,0]\n",
+ "y[0]=1 #value at 0\n",
+ "h=0.01\n",
+ "c=0.01\n",
+ "for i in range(0,4):\n",
+ " y[i+1]=y[i]+h*f(y[i])\n",
+ " print \"\\ny(%g)=%g\\n\" %(c,y[i+1])\n",
+ " c=c+0.01\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "y(0.01)=0.99\n",
+ "\n",
+ "\n",
+ "y(0.02)=0.9801\n",
+ "\n",
+ "\n",
+ "y(0.03)=0.970299\n",
+ "\n",
+ "\n",
+ "y(0.04)=0.960596\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.6:pg-308"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 8.6\n",
+ "#error estimates in euler's \n",
+ "#page 308\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "def f(y):\n",
+ " return -1*y\n",
+ "y=[0,0,0,0,0]\n",
+ "L=[0,0,0,0,0]\n",
+ "e=[0,0,0,0,0]\n",
+ "y[0]=1 #value at 0\n",
+ "h=0.01\n",
+ "c=0.01;\n",
+ "for i in range(0,4):\n",
+ " y[i+1]=y[i]+h*f(y[i])\n",
+ " print \"\\ny(%g)=%g\\n\" %(c,y[i+1])\n",
+ " c=c+0.01\n",
+ "for i in range(0,4):\n",
+ " L[i]=abs(-(1/2)*(h**2)*y[i+1])\n",
+ " print \"L(%d) =%f\\n\\n\" %(i,L[i])\n",
+ "e[0]=0\n",
+ "for i in range(0,4):\n",
+ " e[i+1]=abs(y[1]*e[i]+L[0])\n",
+ " print \"e(%d)=%f\\n\\n\" %(i,e[i])\n",
+ "Actual_value=math.exp(-0.04)\n",
+ "Estimated_value=y[4]\n",
+ "err=abs(Actual_value-Estimated_value)\n",
+ "if err<e[4]:\n",
+ " print \"VERIFIED\"\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "y(0.01)=0.99\n",
+ "\n",
+ "\n",
+ "y(0.02)=0.9801\n",
+ "\n",
+ "\n",
+ "y(0.03)=0.970299\n",
+ "\n",
+ "\n",
+ "y(0.04)=0.960596\n",
+ "\n",
+ "L(0) =0.000050\n",
+ "\n",
+ "\n",
+ "L(1) =0.000049\n",
+ "\n",
+ "\n",
+ "L(2) =0.000049\n",
+ "\n",
+ "\n",
+ "L(3) =0.000048\n",
+ "\n",
+ "\n",
+ "e(0)=0.000000\n",
+ "\n",
+ "\n",
+ "e(1)=0.000050\n",
+ "\n",
+ "\n",
+ "e(2)=0.000099\n",
+ "\n",
+ "\n",
+ "e(3)=0.000147\n",
+ "\n",
+ "\n",
+ "VERIFIED\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.7:pg-310"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 8.7\n",
+ "#modified euler's method\n",
+ "#page 310\n",
+ "h=0.05\n",
+ "f=1\n",
+ "def f1(x,y):\n",
+ " return x**2+y\n",
+ "x=[0,0.05,0.1]\n",
+ "y1=[0,0,0,0]\n",
+ "y2=[0,0,0,0]\n",
+ "y1[0]=f+h*f1(x[0],f);\n",
+ "y1[1]=f+h*(f1(x[0],f)+f1(x[1],y1[0]))/2\n",
+ "y1[2]=f+h*(f1(x[0],f)+f1(x[2],y1[1]))/2\n",
+ "y2[0]=y1[1]+h*f1(x[1],y1[1])\n",
+ "y2[1]=y1[1]+h*(f1(x[1],y1[1])+f1(x[2],y2[0]))/2\n",
+ "y2[2]=y1[1]+h*(f1(x[1],y1[1])+f1(x[2],y2[1]))/2\n",
+ "print \"y1(0)\\t y1(1)\\t y1(2)\\t y2(0)\\t y2(1)\\t y3(2)\\n\\n\"\n",
+ "print \" %f\\t %f\\t %f\\t %f\\t %f\\t %f\\n\" %(y1[0],y1[1],y1[2],y2[0],y2[1],y2[2])\n",
+ "print \"\\n\\n the value of y at %0.2f is : %0.4f\" %(x[2],y2[2])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "y1(0)\t y1(1)\t y1(2)\t y2(0)\t y2(1)\t y3(2)\n",
+ "\n",
+ "\n",
+ " 1.050000\t 1.051313\t 1.051533\t 1.104003\t 1.105508\t 1.105546\n",
+ "\n",
+ "\n",
+ "\n",
+ " the value of y at 0.10 is : 1.1055\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.8:pg-313"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 8.8\n",
+ "#runge-kutta formula\n",
+ "#page 313\n",
+ "from __future__ import division\n",
+ "def f(x,y):\n",
+ " return y-x\n",
+ "y=2\n",
+ "x=0\n",
+ "h=0.1\n",
+ "K1=h*f(x,y)\n",
+ "K2=h*f(x+h,y+K1)\n",
+ "y1=y+( K1+K2)/2\n",
+ "print \"\\n y(0.1) by second order runge kutta method:%0.4f\" %(y1)\n",
+ "y=y1\n",
+ "x=0.1\n",
+ "h=0.1\n",
+ "K1=h*f(x,y)\n",
+ "K2=h*f(x+h,y+K1)\n",
+ "y1=y+( K1+K2)/2\n",
+ "print \"\\n y(0.2) by second order runge kutta method:%0.4f\" %(y1)\n",
+ "y=2\n",
+ "x=0\n",
+ "h=0.1\n",
+ "K1=h*f(x,y)\n",
+ "K2=h*f(x+h/2,y+K1/2)\n",
+ "K3=h*f(x+h/2,y+K2/2)\n",
+ "K4=h*f(x+h,y+K3)\n",
+ "y1=y+(K1+2*K2+2*K3+K4)/6\n",
+ "print \"\\n y(0.1) by fourth order runge kutta method:%0.4f\" %(y1)\n",
+ "y=y1\n",
+ "x=0.1\n",
+ "h=0.1\n",
+ "K1=h*f(x,y)\n",
+ "K2=h*f(x+h/2,y+K1/2)\n",
+ "K3=h*f(x+h/2,y+K2/2)\n",
+ "K4=h*f(x+h,y+K3)\n",
+ "y1=y+(K1+2*K2+2*K3+K4)/6\n",
+ "print \"\\n y(0.1) by fourth order runge kutta method:%0.4f \" %(y1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " y(0.1) by second order runge kutta method:2.2050\n",
+ "\n",
+ " y(0.2) by second order runge kutta method:2.4210\n",
+ "\n",
+ " y(0.1) by fourth order runge kutta method:2.2052\n",
+ "\n",
+ " y(0.1) by fourth order runge kutta method:2.4214 \n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.9:pg-315"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 8.9\n",
+ "#runge kutta method\n",
+ "#page 315\n",
+ "from __future__ import division\n",
+ "def f(x,y):\n",
+ " return 1+y**2\n",
+ "y=0\n",
+ "x=0\n",
+ "h=0.2\n",
+ "K1=h*f(x,y)\n",
+ "K2=h*f(x+h/2,y+K1/2)\n",
+ "K3=h*f(x+h/2,y+K2/2)\n",
+ "K4=h*f(x+h,y+K3)\n",
+ "y1=y+(K1+2*K2+2*K3+K4)/6\n",
+ "print \"\\n y(0.2) by fourth order runge kutta method:%0.4f\" %(y1)\n",
+ "y=y1\n",
+ "x=0.2\n",
+ "h=0.2\n",
+ "K1=h*f(x,y)\n",
+ "K2=h*f(x+h/2,y+K1/2)\n",
+ "K3=h*f(x+h/2,y+K2/2)\n",
+ "K4=h*f(x+h,y+K3)\n",
+ "y1=y+(K1+2*K2+2*K3+K4)/6\n",
+ "print \"\\n y(0.4) by fourth order runge kutta method:%0.4f\" %(y1)\n",
+ "y=2\n",
+ "x=0\n",
+ "h=0.1\n",
+ "y=y1\n",
+ "x=0.4\n",
+ "h=0.2\n",
+ "K1=h*f(x,y)\n",
+ "K2=h*f(x+h/2,y+K1/2)\n",
+ "K3=h*f(x+h/2,y+K2/2)\n",
+ "K4=h*f(x+h,y+K3)\n",
+ "y1=y+(K1+2*K2+2*K3+K4)/6\n",
+ "print \"\\n y(0.6) by fourth order runge kutta method:%0.4f\" %(y1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " y(0.2) by fourth order runge kutta method:0.2027\n",
+ "\n",
+ " y(0.4) by fourth order runge kutta method:0.4228\n",
+ "\n",
+ " y(0.6) by fourth order runge kutta method:0.6841\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.10:pg-315"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 8.10\n",
+ "#initial value problems\n",
+ "#page 315\n",
+ "from __future__ import division\n",
+ "def f1(x,y):\n",
+ " return 3*x+y/2\n",
+ "y=[1,0,0]\n",
+ "h=0.1\n",
+ "c=0\n",
+ "for i in range(0,2):\n",
+ " y[i+1]=y[i]+h*f1(c,y[i])\n",
+ " print \"\\ny(%g)=%g\\n\" %(c,y[i])\n",
+ " c=c+0.1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "y(0)=1\n",
+ "\n",
+ "\n",
+ "y(0.1)=1.05\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.11:pg-316"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 8.11\n",
+ "#adam's moulton method\n",
+ "#page 316\n",
+ "def f(x,y):\n",
+ " return 1+y**2\n",
+ "y=0\n",
+ "x=0\n",
+ "h=0.2\n",
+ "f1=[0,0,0]\n",
+ "K1=h*f(x,y)\n",
+ "K2=h*f(x+h/2,y+K1/2)\n",
+ "K3=h*f(x+h/2,y+K2/2)\n",
+ "K4=h*f(x+h,y+K3)\n",
+ "y1=y+(K1+2*K2+2*K3+K4)/6\n",
+ "f1[0]=y1\n",
+ "print \"\\n y(0.2) by fourth order runge kutta method:%0.4f\" %(y1)\n",
+ "y=y1\n",
+ "x=0.2\n",
+ "h=0.2\n",
+ "K1=h*f(x,y)\n",
+ "K2=h*f(x+h/2,y+K1/2)\n",
+ "K3=h*f(x+h/2,y+K2/2)\n",
+ "K4=h*f(x+h,y+K3)\n",
+ "y1=y+(K1+2*K2+2*K3+K4)/6\n",
+ "f1[1]=y1\n",
+ "print \"\\n y(0.4) by fourth order runge kutta method:%0.4f\" %(y1)\n",
+ "y=2\n",
+ "x=0\n",
+ "h=0.1\n",
+ "y=y1\n",
+ "x=0.4\n",
+ "h=0.2\n",
+ "K1=h*f(x,y)\n",
+ "K2=h*f(x+h/2,y+K1/2)\n",
+ "K3=h*f(x+h/2,y+K2/2)\n",
+ "K4=h*f(x+h,y+K3)\n",
+ "y1=y+(K1+2*K2+2*K3+K4)/6\n",
+ "f1[2]=y1\n",
+ "print \"\\n y(0.6) by fourth order runge kutta method:%0.4f\" %(y1)\n",
+ "y_p=y1+h*(55*(1+f1[2]**2)-59*(1+f1[1]**2)+37*(1+f1[0]**2)-9)/24\n",
+ "y_c=y1+h*(9*(1+(y_p-1)**2)+19*(1+f1[2]**2)-5*(1+f1[1]**2)+(1+f1[0]**2))/24\n",
+ "print \"\\nthe predicted value is:%0.4f:\\n\" %(y_p)\n",
+ "print \" the computed value is:%0.4f:\" %(y_c)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " y(0.2) by fourth order runge kutta method:0.2027\n",
+ "\n",
+ " y(0.4) by fourth order runge kutta method:0.4228\n",
+ "\n",
+ " y(0.6) by fourth order runge kutta method:0.6841\n",
+ "\n",
+ "the predicted value is:1.0234:\n",
+ "\n",
+ " the computed value is:0.9512:\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.12:pg-320"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 8.12\n",
+ "#milne's method\n",
+ "#page 320\n",
+ "def f(x,y):\n",
+ " return 1+y**2\n",
+ "y=0\n",
+ "f1=[0,0,0]\n",
+ "Y1=[0,0,0,0]\n",
+ "x=0\n",
+ "h=0.2\n",
+ "f1[0]=0\n",
+ "print \"x y y1=1+y^2\\n\\n\"\n",
+ "Y1[0]=1+y**2\n",
+ "print \"%0.4f %0.4f %0.4f\\n\" %(x,y,(1+y**2))\n",
+ "K1=h*f(x,y)\n",
+ "K2=h*f(x+h/2,y+K1/2)\n",
+ "K3=h*f(x+h/2,y+K2/2)\n",
+ "K4=h*f(x+h,y+K3)\n",
+ "y1=y+(K1+2*K2+2*K3+K4)/6\n",
+ "f1[0]=y1\n",
+ "Y1[1]=1+y1**2\n",
+ "print \"%0.4f %0.4f %0.4f\\n\" %(x+h,y1,(1+y1**2))\n",
+ "y=y1\n",
+ "x=0.2\n",
+ "h=0.2\n",
+ "K1=h*f(x,y)\n",
+ "K2=h*f(x+h/2,y+K1/2)\n",
+ "K3=h*f(x+h/2,y+K2/2)\n",
+ "K4=h*f(x+h,y+K3)\n",
+ "y1=y+(K1+2*K2+2*K3+K4)/6\n",
+ "f1[1]=y1\n",
+ "Y1[2]=1+y1**2\n",
+ "print \"%0.4f %0.4f %0.4f\\n\" %(x+h,y1,(1+y1**2))\n",
+ "y=y1\n",
+ "x=0.4\n",
+ "h=0.2\n",
+ "K1=h*f(x,y)\n",
+ "K2=h*f(x+h/2,y+K1/2)\n",
+ "K3=h*f(x+h/2,y+K2/2)\n",
+ "K4=h*f(x+h,y+K3)\n",
+ "y1=y+(K1+2*K2+2*K3+K4)/6\n",
+ "f1[2]=y1\n",
+ "Y1[3]=1+y1**2;\n",
+ "print \"%0.4f %0.4f %0.4f\\n\" %(x+h,y1,(1+y1**2))\n",
+ "Y_4=4*h*(2*Y1[1]-Y1[2]+2*Y1[3])/3\n",
+ "print \"y(0.8)=%f\\n\" %(Y_4)\n",
+ "Y=1+Y_4**2\n",
+ "Y_4=f1[1]+h*(Y1[2]+4*Y1[3]+Y)/3 #more correct value\n",
+ "print \"y(0.8)=%f\\n\" %(Y_4)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "x y y1=1+y^2\n",
+ "\n",
+ "\n",
+ "0.0000 0.0000 1.0000\n",
+ "\n",
+ "0.2000 0.2027 1.0411\n",
+ "\n",
+ "0.4000 0.4228 1.1788\n",
+ "\n",
+ "0.6000 0.6841 1.4680\n",
+ "\n",
+ "y(0.8)=1.023869\n",
+ "\n",
+ "y(0.8)=1.029403\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.13:pg-320"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 8.13\n",
+ "#milne's method\n",
+ "#page 320\n",
+ "def f1(x,y):\n",
+ " return x**2+y**2-2\n",
+ "x=[-0.1, 0, 0.1, 0.2]\n",
+ "y=[1.0900, 1.0, 0.8900, 0.7605]\n",
+ "Y1=[0,0,0,0]\n",
+ "h=0.1\n",
+ "for i in range(0,4):\n",
+ " Y1[i]=f1(x[i],y[i])\n",
+ "print \" x y y1=x^2+y^2-2 \\n\\n\"\n",
+ "for i in range(0,4):\n",
+ " print \" %0.2f %f %f \\n\" %(x[i],y[i],Y1[i])\n",
+ "Y_3=y[0]+(4*h/3)*(2*Y1[1]-Y1[2]+2*Y1[3])\n",
+ "print \"y(0.3)=%f\\n\" %(Y_3)\n",
+ "Y1_3=f1(0.3,Y_3)\n",
+ "Y_3=y[2]+h*(Y1[2]+4*Y1[3]+Y1_3)/3 #corrected value\n",
+ "print \"corrected y(0.3)=%f\" %(Y_3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " x y y1=x^2+y^2-2 \n",
+ "\n",
+ "\n",
+ " -0.10 1.090000 -0.801900 \n",
+ "\n",
+ " 0.00 1.000000 -1.000000 \n",
+ "\n",
+ " 0.10 0.890000 -1.197900 \n",
+ "\n",
+ " 0.20 0.760500 -1.381640 \n",
+ "\n",
+ "y(0.3)=0.614616\n",
+ "\n",
+ "corrected y(0.3)=0.614776\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.14:pg322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 8.14\n",
+ "#initial-value problem\n",
+ "#page 322\n",
+ "from __future__ import division\n",
+ "import math\n",
+ "def f(x):\n",
+ " return 13*math.exp(x/2)-6*x-12\n",
+ "s1=1.691358\n",
+ "s3=3.430879\n",
+ "print \"the erorr in the computed values are %0.7g %0.7g\" %(abs(f(0.5)-s1),abs(f(1)-s3))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the erorr in the computed values are 0.0009724169 0.002497519\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.15:pg-328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#boundary value problem using finite difference method\n",
+ "#example 8.15\n",
+ "#page 328\n",
+ "import math\n",
+ "from numpy import matrix\n",
+ "def f(x):\n",
+ " return math.cos(x)+((1-math.cos(1))/math.sin(1))*math.sin(x)-1\n",
+ "h1=1/2\n",
+ "Y=f(0.5)\n",
+ "y0=0\n",
+ "y2=0\n",
+ "y1=4*(1/4+y0+y2)/7\n",
+ "print \"computed value with h=%f of y(0.5) is %f\\n\" %(h1,y1)\n",
+ "print \"error in the result with actual value %f\\n\" %(abs(Y-y1))\n",
+ "h2=1/4\n",
+ "y0=0\n",
+ "y4=0\n",
+ "#solving the approximated diffrential equation\n",
+ "A=matrix([[-31/16, 1, 0],[1, -31/16, 1],[0, 1, -31/16]])\n",
+ "X=matrix([[-1/16],[-1/16],[-1/16]])\n",
+ "C=A.I*X\n",
+ "print \"computed value with h=%f of y(0.5) is %f\\n\" %(h2,C[1][0])\n",
+ "print \"error in the result with actual value %f\\n\" %(abs(Y-C[1][0]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "computed value with h=0.500000 of y(0.5) is 0.142857\n",
+ "\n",
+ "error in the result with actual value 0.003363\n",
+ "\n",
+ "computed value with h=0.250000 of y(0.5) is 0.140312\n",
+ "\n",
+ "error in the result with actual value 0.000818\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.16:pg-329"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#boundary value problem using finite difference method\n",
+ "#example 8.16\n",
+ "#page 329\\\n",
+ "from numpy import matrix\n",
+ "import math\n",
+ "def f(x):\n",
+ " return math.sinh(x)\n",
+ "y0=0 #y(0)=0\n",
+ "y4=3.62686 #y(2)=3.62686\n",
+ "h1=0.5\n",
+ "Y=f(0.5)\n",
+ "#arranging and calculating the values\n",
+ "A=matrix([[-9, 4, 0],[4, -9, 4],[0, 4, -9]])\n",
+ "C=matrix([[0],[0],[-14.50744]])\n",
+ "X=A.I*C\n",
+ "print \"computed value with h=%f of y(0.5) is %f\\n\" %(h1,X[0][0])\n",
+ "print \"error in the result with actual value %f\\n\" %(abs(Y-X[0][0]))\n",
+ "h2=1.0\n",
+ "y0=0 #y(0)=0\n",
+ "y2=3.62686 #y(2)=3.62686\n",
+ "y1=(y0+y2)/3\n",
+ "Y=(4*X[1][0]-y1)/3\n",
+ "print \"with better approximation error is reduced to %f\" %(abs(Y-f(1.0)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "computed value with h=0.500000 of y(0.5) is 0.526347\n",
+ "\n",
+ "error in the result with actual value 0.005252\n",
+ "\n",
+ "with better approximation error is reduced to 0.000855\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.17:pg-330"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#cubic spline method\n",
+ "#example 8.17\n",
+ "#page 330\n",
+ "import math\n",
+ "def f(x):\n",
+ " return math.cos(x)+((1-math.cos(1))/math.sin(1))*math.sin(x)-1\n",
+ "y=[f(0), f(0.5), f(1)]\n",
+ "h=1/2\n",
+ "Y=f(0.5)\n",
+ "y0=0\n",
+ "y2=0\n",
+ "M0=-1\n",
+ "M1=-22/25\n",
+ "M2=-1\n",
+ "s1_0=47/88\n",
+ "s1_1=-47/88\n",
+ "s1_05=0\n",
+ "print \"the cubic spline value is %f\" %(Y)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the cubic spline value is 0.139494\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.18:pg-331"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#cubic spline method\n",
+ "#example 8.18\n",
+ "#page 331\n",
+ "from numpy import matrix\n",
+ "from __future__ import division\n",
+ "import math\n",
+ "#after arranging and forming equation \n",
+ "A=matrix([[10, -1, 0, 24],[0, 16, -1, -32],[1, 20, 0, 16],[0, 1, 26, -24]])\n",
+ "C=matrix([[36],[-12],[24],[-9]])\n",
+ "X=A.I*C;\n",
+ "print \" Y1=%f\\n\\n\" %(X[3][0])\n",
+ "print \" the error in the solution is :%f\" %(abs((2/3)-X[3][0]))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Y1=0.653890\n",
+ "\n",
+ "\n",
+ " the error in the solution is :0.012777\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.19:pg-331"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#boundary value problem by cubisc spline nethod\n",
+ "#example 8.18\n",
+ "#page 331\n",
+ "from numpy import matrix\n",
+ "h=1/2\n",
+ "#arranging in two subintervals we get\n",
+ "A=matrix([[10, -1, 0,24],[0, 16, -1, -32],[1, 20, 0, 16],[0, 1, 26, -24]])\n",
+ "C=matrix([[36],[-12],[24],[-9]])\n",
+ "X=A.I*C\n",
+ "print \"the computed value of y(1.5) is %f \"%(X[3][0])\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the computed value of y(1.5) is 0.653890 \n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter_5_9.ipynb b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter_5_9.ipynb
new file mode 100644
index 00000000..697b9cb3
--- /dev/null
+++ b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter_5_9.ipynb
@@ -0,0 +1,359 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f2fd61e2bc794cbd536a64a99cc1e32ed50fce093e2901b8c1e8c55a86c80516"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter05:Spline Functions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5.1:pg-182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#linear splines\n",
+ "#example 5.1\n",
+ "#page 182\n",
+ "from numpy import matrix\n",
+ "X=matrix([[1],[2], [3]])\n",
+ "y=matrix([[-8],[-1],[18]])\n",
+ "m1=(y[1][0]-y[0][0])/(X[1][0]-X[0][0])\n",
+ "m2=(y[2][0]-y[1][0])/(X[2][0]-X[1][0])\n",
+ "def s1(x):\n",
+ " return y[0][0]+(x-X[0][0])*m1\n",
+ "def s2(x):\n",
+ " return y[1][0]+(x-X[1][0])*m2\n",
+ "print \"the value of function at 2.5 is %0.2f: \" %(s2(2.5))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the value of function at 2.5 is 8.50: \n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5.3:pg-188"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#cubic splines\n",
+ "#example 5.3\n",
+ "#page 188\n",
+ "from numpy import matrix\n",
+ "import math\n",
+ "X=matrix([[1],[2],[3]])\n",
+ "y=matrix([[-8],[-1],[18]])\n",
+ "M1=0\n",
+ "M2=8\n",
+ "M3=0\n",
+ "h=1\n",
+ "#deff('y=s1(x)','y=3*(x-1)^3-8*(2-x)-4*(x-1)')\n",
+ "def s1(x):\n",
+ " return 3*math.pow(x-1,3)-8*(2-x)-4*(x-1)\n",
+ "#deff('y=s2(x)','y=3*(3-x)^3+22*x-48');\n",
+ "def s2(x):\n",
+ " return 3*math.pow(3-x,3)+22*x-48\n",
+ "h=0.0001\n",
+ "n=2.0\n",
+ "D=(s2(n+h)-s2(n))/h;\n",
+ "print \" y(2.5)=%f\" %(s2(2.5))\n",
+ "print \"y1(2.0)=%f\" %(D)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " y(2.5)=7.375000\n",
+ "y1(2.0)=13.000900\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5.4:pg-189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#cubic spline\n",
+ "#example 5.4\n",
+ "#page 189\n",
+ "from numpy import matrix\n",
+ "import math\n",
+ "x=matrix([[0],[math.pi/2],[math.pi]])\n",
+ "y=matrix([[0],[1],[0]])\n",
+ "h=x[1][0]-x[0][0]\n",
+ "M0=0\n",
+ "M2=0\n",
+ "M1=((6*(y[0][0]-2*y[1][0]+y[2][0])/math.pow(h,2))-M0-M2)/4\n",
+ "X=math.pi/6.0\n",
+ "s1=(math.pow(x[1][0]-X,3)*(M0/6)+math.pow(X-x[0][0],3)*M1/6+(y[0][0]-math.pow(h,2)*M0/6)*(x[1][0]-X)+(y[1][0]-math.pow(h,2)*M1/6)*(X-x[0][0]))/h;\n",
+ "x=matrix([[0],[math.pi/4], [math.pi/2], [3*math.pi/4], [math.pi]])\n",
+ "y=matrix([[0], [1.414], [1] ,[1.414]])\n",
+ "M0=0\n",
+ "M4=0\n",
+ "A=matrix([[4, 1, 0],[1, 4, 1],[0 ,1 ,4]]) #calculating value of M1 M2 M3 by matrix method\n",
+ "C=matrix([[-4.029],[-5.699],[-4.029]])\n",
+ "B=A.I*C\n",
+ "print \"M0=%f\\t M1=%f\\t M2=%f\\t M3=%f\\t M4=%f\\t\\n\\n\" %(M0,B[0][0],B[1][0],B[2][0],M4)\n",
+ "h=math.pi/4;\n",
+ "X=math.pi/6;\n",
+ "s1=(-0.12408*math.pow(X,3)+0.7836*X)/h;\n",
+ "print \"the value of sin(pi/6) is:%f\" %(s1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "M0=0.000000\t M1=-0.744071\t M2=-1.052714\t M3=-0.744071\t M4=0.000000\t\n",
+ "\n",
+ "\n",
+ "the value of sin(pi/6) is:0.499722\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5.5:pg-191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#cubic spline\n",
+ "#example 5.5\n",
+ "#page 191\n",
+ "import math\n",
+ "from numpy import matrix\n",
+ "x=[1,2,3]\n",
+ "y=[6,18,42]\n",
+ "m0=40\n",
+ "s1=0\n",
+ "m1=(3*(y[2]-y[0])-m0)/4\n",
+ "X=0\n",
+ "s1=m0*((x[1]-X)**2)*(X-x[0])-m1*((X-x[0])**2)*(x[1]-X)+y[0]*((x[1]-X)**2)*(2*(X-x[0])+1)+y[1]*((X-x[0])**2)*(2*(x[1]-X)+1)\n",
+ "print \"s1= %f+261*x-160X^2+33X^3\" %(s1)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "s1= -128.000000+261*x-160X^2+33X^3\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5.7:pg-195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#surface fitting by cubic spline\n",
+ "#example 5.7\n",
+ "#page 195\n",
+ "import math\n",
+ "from numpy import matrix\n",
+ "def L0(y):\n",
+ " return math.pow(y,3)/4-5*y/4+1\n",
+ "def L1(y):\n",
+ " return (math.pow(y,3)/2)*-1+3*y/2\n",
+ "def L2(y):\n",
+ " return math.pow(y,3)/4-y/4\n",
+ "A=[ [1,2,9], [2,3,10], [9,10,17] ]\n",
+ "x=0.5\n",
+ "y=0.5\n",
+ "S=0.0\n",
+ "S=S+L0(x)*(L0(x)*A[0][0]+L1(x)*A[0][1]+L2(x)*A[0][2])\n",
+ "S=S+L1(x)*(L0(x)*A[1][0]+L1(x)*A[1][1]+L2(x)*A[1][2])\n",
+ "S=S+L2(x)*(L0(x)*A[2][0]+L1(x)*A[2][1]+L2(x)*A[2][2])\n",
+ "print \"approximated value of z(0.5 0.5)=%f\\n\\n\" %(S)\n",
+ "print \" error in the approximated value : %f\" %((abs(1.25-S)/1.25)*100)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "approximated value of z(0.5 0.5)=0.875000\n",
+ "\n",
+ "\n",
+ " error in the approximated value : 30.000000\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5.8:pg-200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#cubic B-splines\n",
+ "#example 5.8\n",
+ "#page 200\n",
+ "import math\n",
+ "k=[0.0, 1, 2, 3, 4]\n",
+ "pi=[0.0, 0, 4, -6, 24]\n",
+ "x=1\n",
+ "S=0\n",
+ "for i in range(2,5):\n",
+ " S=S+math.pow(k[i]-x,3)/(pi[i])\n",
+ "print \"the cubic splines for x=1 is %f\\n\\n\" %(S)\n",
+ "S=0\n",
+ "x=2\n",
+ "for i in range(2,5):\n",
+ " S=S+math.pow(k[i]-x,3)/(pi[i])\n",
+ "print \"the cubic splines for x=2 is %f\\n\\n\" %(S)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the cubic splines for x=1 is 0.041667\n",
+ "\n",
+ "\n",
+ "the cubic splines for x=2 is 0.166667\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5.9:pg-201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#cubic B-spline\n",
+ "#example 5.9\n",
+ "#page 201\n",
+ "k=[0, 1, 2, 3, 4];\n",
+ "x=1 #for x=1\n",
+ "s11=0\n",
+ "s13=0\n",
+ "s14=0\n",
+ "s24=0 \n",
+ "s12=1/(k[2]-k[1])\n",
+ "s22=((x-k[0])*s11+(k[2]-x)*s12)/2.0 #k[2]-k[0]=2\n",
+ "s23=((x-k[1])*s11+(k[3]-x)*s13)/(k[3]-k[1])\n",
+ "s33=((x-k[0])*s22+(k[3]-x)*s23)/(k[3]-k[0])\n",
+ "s34=((x-k[1])*s23+(k[4]-x)*s24)/(k[4]-k[1])\n",
+ "s44=((x-k[0])*s33+(k[4]-x)*s34)/(k[4]-k[0])\n",
+ "print \"s11=%f\\t s22=%f\\t s23=%f\\t s33=%f\\t s34=%f\\t s44=%f\\n\\n\" %(s11,s22,s23,s33,s34,s44)\n",
+ "x=2 #for x=2\n",
+ "s11=0\n",
+ "s12=0\n",
+ "s14=0\n",
+ "s22=0\n",
+ "s13=1/(k[3]-k[2])\n",
+ "s23=((x-k[1])*s12+(k[3]-x)*s13)/2.0 # k[3]-k[1]=2\n",
+ "s24=((x-k[2])*s13+(k[4]-x)*s14)/(k[2]-k[0])\n",
+ "s33=((x-k[0])*s22+(k[3]-x)*s23)/(k[3]-k[0])\n",
+ "s34=((x-k[1])*s23+(k[4]-x)*s24)/(k[4]-k[1])\n",
+ "s44=((x-k[0])*s33+(k[4]-x)*s34)/(k[4]-k[0])\n",
+ "print \"s13=%f\\t s23=%f\\t s24=%f\\t s33=%f\\t s34=%f\\t s44=%f\\n\\n\" %(s13,s23,s24,s33,s34,s44)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "s11=0.000000\t s22=0.500000\t s23=0.000000\t s33=0.166667\t s34=0.000000\t s44=0.041667\n",
+ "\n",
+ "\n",
+ "s13=1.000000\t s23=0.500000\t s24=0.000000\t s33=0.166667\t s34=0.166667\t s44=0.166667\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/screenshots/ex1.2_4.png b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/screenshots/ex1.2_4.png
new file mode 100644
index 00000000..9dd9ad02
--- /dev/null
+++ b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/screenshots/ex1.2_4.png
Binary files differ
diff --git a/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/screenshots/ex3.7_1.png b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/screenshots/ex3.7_1.png
new file mode 100644
index 00000000..81986fc3
--- /dev/null
+++ b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/screenshots/ex3.7_1.png
Binary files differ
diff --git a/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/screenshots/ex6.5_1.png b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/screenshots/ex6.5_1.png
new file mode 100644
index 00000000..1628bc09
--- /dev/null
+++ b/Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/screenshots/ex6.5_1.png
Binary files differ