{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 14: Energy Methods" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 14.10: EM10.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clear all; clc;\n", "\n", "disp('Scilab Code Ex 14.10 : ')\n", "\n", "//Given:\n", "m = 80*1000; //kg\n", "v = 0.2; //m/s\n", "l_ac = 1.5; //m\n", "E = 200*10^9; //N/m^2\n", "w = 0.2; //m\n", "I = (1/12)*(w^4);\n", "l_ab = 1000; //mm\n", "\n", "//Calculations:\n", "del_Amax = sqrt((m*v^2*l_ac^3)/(3*E*I));\n", "\n", "P_max = (3*E*I*del_Amax)/(l_ac^3);\n", "theta_A = (P_max*l_ac^2)/(2*E*I);\n", "del_Amax = del_Amax*1000;\n", "del_Bmax = del_Amax + (theta_A*l_ab);\n", "\n", "\n", "//Display:\n", "\n", " printf('\n\nThe maximum horizontal displacement of the post at B due to impact = %1.1f mm',del_Bmax);\n", " \n", "\n", "//---------------------------------------------------------------------------END------------------------------------------------------------------------------\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 14.11: EM11.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clear all; clc;\n", "\n", "disp('Scilab Code Ex 14.11 : ')\n", "\n", "//Given:\n", "A = 400*10^-6; //m^2\n", "E = 200*10^6; //kN/m^2\n", "P = 100; //kN\n", "\n", "//Virtual Work Equation:\n", "\n", "n = [0 0 -1.414 1];\n", "N = [-100 141.4 -141.4 200];\n", "L = [4 2.828 2.828 2];\n", "del_cv = 0;\n", "\n", "for i=1:4\n", " del_cv = del_cv + (n(i)*N(i)*L(i))/(A*E);\n", "end\n", "\n", "del_cv = del_cv*1000;\n", "\n", "//Display:\n", "\n", " printf('\n\nThe vertical displacement of joint C of the steel truss = %1.1f mm',del_cv);\n", " \n", "\n", "//---------------------------------------------------------------------------END------------------------------------------------------------------------------\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 14.12: EM12.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clear all; clc;\n", "\n", "disp('Scilab Code Ex 14.12 : ')\n", "\n", "//Given:\n", "A = 300*10^-6; //m^2\n", "E = 210*10^6; //kN/m^2\n", "P = 60; //kN\n", "F_ac = 1.25; //kN\n", "\n", "//Part a:\n", "\n", "//Virtual Work Equation:\n", "\n", "n = [0 1.25 0 -0.75];\n", "N = [0 75 -60 -45];\n", "L = [1.5 2.5 2 1.5];\n", "del_ch = 0;\n", "\n", "for i=1:4\n", " del_ch = del_ch + (n(i)*N(i)*L(i))/(A*E);\n", "end\n", "\n", "del_chA = del_ch*1000;\n", "\n", "//Part b:\n", "\n", "del_L = -6; //mm\n", "del_chB = F_ac*del_L;\n", "\n", "if(del_chB<0)\n", " \n", "\n", "//Display:\n", " \n", " printf('\n\nThe horizontal displacement of joint C if a force is applied to B = %1.3f mm',del_chA);\n", " printf('\nThe horizontal displacement of joint C if AC is fabricated short = %1.1f mm',del_chB);\n", "end\n", "\n", " \n", "\n", "//---------------------------------------------------------------------------END------------------------------------------------------------------------------\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 14.13: EM13.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clear all; clc;\n", "\n", "disp('Scilab Code Ex 14.13 : ')\n", "\n", "//Given:\n", "del_T = 60; //degree celcius\n", "alpha = 12*10^-6; //per degree celcius\n", "E = 200*10^6; //kN/m^2\n", "A = 250*10^-6; //m^2\n", "L = 4; //m\n", "\n", "//Virtual Work Equation:\n", "n = 1.155; //kN\n", "N = -12; //kN\n", "\n", "del_bh = (n*N*L)/(A*E) + (n*alpha*del_T*L);\n", "del_bh = del_bh*1000;\n", "\n", "//Display:\n", "\n", "printf('\n\nThe horizontal displacement of joint B of the truss = %1.2f mm',del_bh);\n", "\n", "//---------------------------------------------------------------------END--------------------------------------------------------------------------------------------" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 14.16: EM16.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clear all; clc;\n", "\n", "disp('Scilab Code Ex 14.16 : ')\n", "\n", "//Given:\n", "I = 175.8*10^-6; //m^4\n", "E = 200*10^6; //kN/m^2\n", "Ra = 1;//kN\n", "l_ab = 3; //m\n", "l_bc = 6; //m\n", "\n", "\n", "//Virtual Work Equation:\n", "m1 = -1; //*x1\n", "M1 = -2.5; //*x1^3\n", "m2 = -0.5; //*x2\n", "\n", "x10 = 0;\n", "x11 = l_ab;\n", "I1 = integrate('m1*M1*(x1^4)','x1',x10,x11);\n", "\n", "x20 = 0;\n", "x21 = l_bc;\n", "I2 = integrate('m2*123.75*(x2^2)','x2',x20,x21);\n", "\n", "x20 = 0;\n", "x21 = l_bc;\n", "I3 = integrate(' -m2*22.5*(x2^3)','x2',x20,x21);\n", "\n", "In = I1 + I2 + I3;\n", "del_A = (In)/(E*I);\n", "del_A = del_A*1000;\n", "\n", "\n", "//Display:\n", "\n", " printf('\n\nThe displacement of point A of the steel beam = %1.1f mm',del_A);\n", " \n", "//---------------------------------------------------------------------------END------------------------------------------------------------------------------\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 14.17: EM17.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clear all; clc;\n", "\n", "disp('Scilab Code Ex 14.17 : ')\n", "\n", "//Given:\n", "E = 210*10^3; //N/mm^2\n", "P = 40*10^3;//N\n", "A_ab = 1250; //mm^2\n", "A_ac = 625; //mm^2\n", "A_cd = 1250; //mm^2\n", "A_bc = 625; //mm^2\n", "\n", "N_by_P = [0 0 1.67 -1.33];\n", "L = [4000 3000 5000 4000];\n", "A = [A_ab A_bc A_ac A_cd];\n", "N = zeros(4);\n", "sum = 0;\n", "\n", "\n", "for i =1:4\n", " N(i) = N_by_P(i)*P;\n", " num(i) = N(i)*N_by_P(i)*L(i);\n", " \n", "end\n", "\n", "for i = 1:4\n", " sum = sum + (num(i)/(A(i)*E)); //By Castigliano's Second theorem.\n", "end\n", "\n", "del_ch = sum;\n", "\n", "//Display:\n", " printf('\n\nThe horizontal displacement of joint C of the steel truss = %1.2f mm',sum);\n", " \n", "//---------------------------------------------------------------------------END------------------------------------------------------------------------------\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 14.18: EM18.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clear all; clc;\n", "\n", "disp('Scilab Code Ex 14.18 : ')\n", "\n", "//Given:\n", "E = 200*10^6; //kN/m^2\n", "P = 0;//N\n", "A = 400*10^-6; //m^2\n", "\n", "N_by_P = [0 0 -1.414 1];\n", "L = [4 2.828 2.828 2];\n", "N = [-100 141.4 -141.4 200];\n", "sum = 0;\n", "\n", "\n", "for i =1:4\n", " num(i) = N(i)*N_by_P(i)*L(i); \n", "end\n", "\n", "for i = 1:4\n", " sum = sum + (num(i)/(A*E)); //By Castigliano's Second theorem.\n", "end\n", "\n", "del_ch = sum*1000;\n", "\n", "//Display:\n", " printf('\n\nThe vertical displacement of joint C of the steel truss = %1.1f mm',del_ch);\n", " \n", "//---------------------------------------------------------------------------END------------------------------------------------------------------------------\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 14.1: EM1.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clear all; clc;\n", "\n", "disp('Scilab Code Ex 14.1 : ')\n", "\n", "//Given:\n", "sigma_y = 310; //N/mm^2\n", "db =18; //mm\n", "rb = db/2;\n", "Ab = %pi*(rb^2);\n", "E = 210*10^3; //N/mm^2\n", "da1 = 20; //mm\n", "ra1 = da1/2;\n", "Aa1 = %pi*(ra1^2);\n", "La1 = 50;//mm\n", "La2= 6; //mm\n", "da2 =18; //mm\n", "ra2 = da2/2;\n", "Aa2 = %pi*(ra2^2);\n", "Lb = 56; //mm\n", "\n", "\n", "//Bolt A:\n", "P_max = sigma_y*Ab;\n", "Uia = (P_max^2/(2*E))*(La1/Aa1 + La2/Aa2); //Ui = (N^2L)/(2AE)\n", "Uia = Uia/1000;\n", "\n", "//Bolt B:\n", "Uib = (P_max^2/(2*E))*(Lb/Ab);\n", "Uib = Uib/1000;\n", "\n", "//Display:\n", " printf('\n\nThe greatest amount of strain energy absorbed by bolt A = %1.3f J',Uia);\n", " printf('\nThe greatest amount of strain energy absorbed by bolt B = %1.3f J',Uib);\n", " \n", " //-------------------------------------------------------------------------END---------------------------------------------------------------------------------" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 14.21: EM21.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clear all; clc;\n", "\n", "disp('Scilab Code Ex 14.21 : ')\n", "\n", "//Given:\n", "I = 125*10^-6; //m^4\n", "E = 200*10^6; //kN/m^2\n", "Rc = 5;//kN\n", "l_ac = 6; //m\n", "l_cb = 4; //m\n", "\n", "\n", "//Castigliano's Second Theorem:\n", "m = 0.4/9;\n", "\n", "x10 = 0;\n", "x11 = l_ac;\n", "I11 = integrate('4.4*(x1^2)','x1',x10,x11);\n", "I12 = integrate('-m*(x1^4)','x1',x10,x11);\n", "I1 = I11 + I12;\n", "\n", "x20 = 0;\n", "x21 = l_cb;\n", "I21 = integrate('6*0.6*(x2^2)','x2',x20,x21);\n", "I22 = integrate('18*0.6*(x2)','x2',x20,x21);\n", "I2 = I21+I22;\n", "\n", "In = I1 + I2 ;\n", "del_cv = (In)/(E*I);\n", "del_cv = del_cv*1000;\n", "\n", "\n", "//Display:\n", "\n", " printf('\n\nThe vertical displacement of point C of the steel beam = %1.1f mm',del_cv);\n", " \n", "//---------------------------------------------------------------------------END------------------------------------------------------------------------------\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 14.5: EM5.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clear all; clc;\n", "\n", "disp('Scilab Code Ex 14.5 : ')\n", "\n", "//Given:\n", "G = 75*10^9; //N/m^2\n", "ro = 80/1000; //m\n", "t = 15/1000; //m\n", "ri = ro - t;\n", "l1 = 750/1000; //m\n", "l2 = 300/1000; //m\n", "T1 = 40; //Nm\n", "T2 =15; //Nm\n", "\n", "//Calculations:\n", "\n", "J = (%pi/2)*(ro^4 - ri^4);\n", "\n", "//Eqn 14-22\n", "U1 = (T1^2*l1)/(2*G*J); \n", "U2 = (T2^2*l2)/(2*G*J);\n", "Ui = U1 + U2;\n", "Ui = Ui*10^6; //in micro Joule\n", "\n", "//Display:\n", "\n", " printf('\n\nThe strain energy stored in the shaft = %1.0fX10^-6 J',Ui);\n", " \n", "//-------------------------------------------------------------------------END-------------------------------------------------------------------------------------------\n", " " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 14.6: EM6.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clear all; clc;\n", "\n", "disp('Scilab Code Ex 14.6 : ')\n", "\n", "//Given:\n", "l_ab = 1; //m\n", "l_bc = 2; //m\n", "N_ab = 11.547*1000; //N\n", "Nb = 20*1000; //N\n", "Nc = -23.094*1000; //N\n", "N_ac = -20*1000; //N\n", "A = 100/(1000^2); //mm^2\n", "E = 200*10^9; //N/m^2\n", "P = 20*10^3;//N\n", "\n", "//Eqn 14-26\n", "P_by_2 = P/2;\n", "l_ac = sqrt(l_bc^2 - l_ab^2);\n", "del = 0;\n", "\n", "N2= [N_ab^2 Nc^2 N_ac^2];\n", "L = [l_ab l_bc l_ac];\n", "\n", "for i = 1:3\n", " del = del + (N2(i)*L(i))/(2*A*E);\n", "end\n", "\n", "del_bh = del/P_by_2;\n", "del_bh = del_bh*1000;\n", "\n", "//Display:\n", "\n", "printf('\n\nThe horizontal displacement at point B = %1.2fmm',del_bh);\n", " \n", "//-------------------------------------------------------------------------END-------------------------------------------------------------------------------------------\n", " " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 14.8: EM8.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clear all; clc;\n", "\n", "disp('Scilab Code Ex 14.8 : ')\n", "\n", "//Given:\n", "ro = 60; //mm\n", "ri = 50; //mm\n", "E = 70; //kN/mm^2\n", "W = 600; //kN\n", "L = 240; //mm\n", "h = 0;\n", "\n", "//Part a:\n", "\n", "A = (%pi)*(ro^2 - ri^2);\n", "del_st= (W*L)/(A*E);\n", "\n", "//Part b:\n", "\n", "del_max = del_st*(1 + sqrt(1 + 2*(h/del_st)));\n", "\n", "//Display:\n", "\n", " printf('\n\nThe maximum displacement at the top of the pipe for gradually applied load = %1.4f mm',del_st);\n", " printf('\nThe maximum displacement at the top of the pipe for suddenly applied load = %1.4f mm',del_max);\n", "\n", "//---------------------------------------------------------------------------END------------------------------------------------------------------------------" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 14.9: EM9.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clear all; clc;\n", "\n", "disp('Scilab Code Ex 14.9 : ')\n", "\n", "//Given:\n", "W = 6000; //N\n", "h = 50; //mm\n", "E = 210*1000; //N/mm^2\n", "L = 5000; //mm\n", "I = 87.3*10^6; //mm^2\n", "\n", "//Calculations:\n", "\n", "del_st = (W*L^3)/(48*E*I);\n", "del_max = del_st*(1 + sqrt(1 + 2*(h/del_st)));\n", "\n", "c = 252/2;\n", "sigma_max = (12*E*del_max*c)/(L^2);\n", "\n", "//Display:\n", "\n", " printf('\n\nThe maximum bending stress in the steel beam = %1.2f N/mm^2',sigma_max);\n", " printf('\nThe maximum deflection in the beam = %1.3f mm',del_max);\n", "\n", "//---------------------------------------------------------------------------END------------------------------------------------------------------------------" ] } ], "metadata": { "kernelspec": { "display_name": "Scilab", "language": "scilab", "name": "scilab" }, "language_info": { "file_extension": ".sce", "help_links": [ { "text": "MetaKernel Magics", "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" } ], "mimetype": "text/x-octave", "name": "scilab", "version": "0.7.1" } }, "nbformat": 4, "nbformat_minor": 0 }