diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3588 | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '3588')
69 files changed, 1227 insertions, 0 deletions
diff --git a/3588/CH10/EX10.1/EX10_1.sav b/3588/CH10/EX10.1/EX10_1.sav Binary files differnew file mode 100644 index 000000000..b44b19fee --- /dev/null +++ b/3588/CH10/EX10.1/EX10_1.sav diff --git a/3588/CH10/EX10.1/EX10_1.sce b/3588/CH10/EX10.1/EX10_1.sce new file mode 100644 index 000000000..aa12a0a1d --- /dev/null +++ b/3588/CH10/EX10.1/EX10_1.sce @@ -0,0 +1,21 @@ +//Clearing console +clc +clear + +//Intializing variables +mg = 20 +k = 25 +g = 386.4 + +//Calculating circular frequency +w = sqrt(k*g/mg) + +//Solving for constants in equation of motion +fi = acosd(0/w) +C = (2.3-0.8)/sind(fi) + +//Circular frequency in Hz +f = w/(2*%pi) + +printf('\nResults\n') +printf('\nCircular Frequency =%fHz\n Amplitude =%fin\n Phase Angle =%fdegree',f,C,fi) diff --git a/3588/CH10/EX10.2/EX10_2.sav b/3588/CH10/EX10.2/EX10_2.sav Binary files differnew file mode 100644 index 000000000..e442c23f6 --- /dev/null +++ b/3588/CH10/EX10.2/EX10_2.sav diff --git a/3588/CH10/EX10.2/EX10_2.sce b/3588/CH10/EX10.2/EX10_2.sce new file mode 100644 index 000000000..98cd4ce25 --- /dev/null +++ b/3588/CH10/EX10.2/EX10_2.sce @@ -0,0 +1,31 @@ +//Clearing console +clc +clear + +//Intializing variables +mg = 20 +k = 40 +g = 386.4 + +//Calculating circular frequency +w1 = sqrt(k*g/mg) +w2 = sqrt(6*k*g/mg) + +k1 = [1 1;2 -0.5] +f1 = [1;0.5] +k2 = [27.8 68.1;2*27.8 0.5*68.1] +f2 = [0;0] +//Solving for constants in equations of motion +u1=linsolve(k1,-f1) +u2=linsolve(k2,-f2) + +fi1 = acosd(u2(1,1)) +fi2 = acosd(u2(2,1)) + +a1 = u1(1,1)/sind(fi1) +a2 = u1(2,1)/sind(fi2) + +printf('\nResults\n') +printf('\nCircular Frequency1 =%frad/sec\n Amplitude1 =%fin\n Phase Angle1 =%fdegree',w1,a1,fi1) +printf('\nCircular Frequency2 =%frad/sec\n Amplitude2 =%fin\n Phase Angle2 =%fdegree',w2,a2,fi2) + diff --git a/3588/CH10/EX10.6/EX10_6.sav b/3588/CH10/EX10.6/EX10_6.sav Binary files differnew file mode 100644 index 000000000..022d3eec5 --- /dev/null +++ b/3588/CH10/EX10.6/EX10_6.sav diff --git a/3588/CH10/EX10.6/EX10_6.sce b/3588/CH10/EX10.6/EX10_6.sce new file mode 100644 index 000000000..647ba56d5 --- /dev/null +++ b/3588/CH10/EX10.6/EX10_6.sce @@ -0,0 +1,35 @@ +//Clearing console +clc +clear + +//Intializing variables +t = 5 +p = 7.83*10^-6 +x0 = -1 +x1 = 1 + +//Calculating elements of mass matrix +m11 = (150*p*t*integrate('(1-r)^2','r',x0,x1)*integrate('(1-s)^2','s',x0,x1))/16 +m12 = (150*p*t*integrate('1-r^2','r',x0,x1)*integrate('(1-s)^2','s',x0,x1))/16 +m22 = (150*p*t*integrate('(1+r)^2','r',x0,x1)*integrate('(1-s)^2','s',x0,x1))/16 +m13 = (150*p*t*integrate('1-r^2','r',x0,x1)*integrate('1-s^2','s',x0,x1))/16 +m14 = (150*p*t*integrate('(1-r)^2','r',x0,x1)*integrate('1-s^2','s',x0,x1))/16 +m23 = (150*p*t*integrate('(1+r)^2','r',x0,x1)*integrate('1-s^2','s',x0,x1))/16 +m24 = (150*p*t*integrate('1-r^2','r',x0,x1)*integrate('1-s^2','s',x0,x1))/16 +m33 = (150*p*t*integrate('(1+r)^2','r',x0,x1)*integrate('(1+s)^2','s',x0,x1))/16 +m34 = (150*p*t*integrate('1-r^2','r',x0,x1)*integrate('(1+s)^2','s',x0,x1))/16 +m44 = (150*p*t*integrate('(1-r)^2','r',x0,x1)*integrate('(1+s)^2','s',x0,x1))/16 + +//Constructing Mass matrix +m(1,1:8) = [m11 m12 m13 m14 0 0 0 0] +m(2,1:8) = [m12 m22 m23 m24 0 0 0 0] +m(3,1:8) = [m13 m23 m33 m34 0 0 0 0] +m(4,1:8) = [m14 m24 m34 m44 0 0 0 0] +m(5,1:8) = [0 0 0 0 m11 m12 m13 m14] +m(6,1:8) = [0 0 0 0 m12 m22 m23 m24] +m(7,1:8) = [0 0 0 0 m13 m23 m33 m34] +m(8,1:8) = [0 0 0 0 m14 m24 m34 m44] + +printf('\nResults\n') +printf('\nMass matrix m in (kg)') +disp(m) diff --git a/3588/CH10/EX10.9/EX10_9.sav b/3588/CH10/EX10.9/EX10_9.sav Binary files differnew file mode 100644 index 000000000..5e3e6b0fc --- /dev/null +++ b/3588/CH10/EX10.9/EX10_9.sav diff --git a/3588/CH10/EX10.9/EX10_9.sce b/3588/CH10/EX10.9/EX10_9.sce new file mode 100644 index 000000000..747322fd4 --- /dev/null +++ b/3588/CH10/EX10.9/EX10_9.sce @@ -0,0 +1,17 @@ +//Clearing console +clc +clear + +//Intializing variables +t1 = 0.03 +w1 = 5 +t2 = 0.1 +w2 = 15 + +//Solving for Rayleigh coefficients +k = [1/(2*w1) w1/2;1/(2*w2) w2/2] +f = [t1;t2] +u=linsolve(k,-f) + +printf('\nResults\n') +printf('\nRayleigh coefficients\n Alpha =%f\n Beta =%f',u(1,1),u(2,1)) diff --git a/3588/CH2/EX2.1/EX2_1.sav b/3588/CH2/EX2.1/EX2_1.sav Binary files differnew file mode 100644 index 000000000..3f7947524 --- /dev/null +++ b/3588/CH2/EX2.1/EX2_1.sav diff --git a/3588/CH2/EX2.1/EX2_1.sce b/3588/CH2/EX2.1/EX2_1.sce new file mode 100644 index 000000000..a9358fcb1 --- /dev/null +++ b/3588/CH2/EX2.1/EX2_1.sce @@ -0,0 +1,35 @@ +//Clearing Console +clc +clear + +//Node 1 Displacement +U1=0 +//Stiffness of Springs +K1=50 +K2=75 +//Nodal Forces +F2=75 +F3=75 +//varible decleration +K=[] +F=[] +U=[] + +//Constructing Stiffness and Force matrices +K(1,1)=K1+K2 +K(1,2)=-K2 +K(2,1)=-K2 +K(2,2)=K2 +F(1,1)=F2 +F(2,1)=F3 + +//Solving for Nodal Displacements U2 and U3 +U=linsolve(K,-F) //K*U=F (equlibrium equation) + +//Solving for Nodal force F1 +F1=-50*U(1,1) + +//Printing Results +printf('\nResults\n') +printf('\nNodal displacements \nU1=%fin \nU2=%fin \nU3=%fin\n',U1,U(1,1),U(2,1)) +printf('\nNodal Force F1=%flb\n',F1) diff --git a/3588/CH2/EX2.6/EX2_6.sav b/3588/CH2/EX2.6/EX2_6.sav Binary files differnew file mode 100644 index 000000000..d4010820b --- /dev/null +++ b/3588/CH2/EX2.6/EX2_6.sav diff --git a/3588/CH2/EX2.6/EX2_6.sce b/3588/CH2/EX2.6/EX2_6.sce new file mode 100644 index 000000000..416b7c1d5 --- /dev/null +++ b/3588/CH2/EX2.6/EX2_6.sce @@ -0,0 +1,43 @@ +//Clearing Console +clc +clear + +//Node 1 Displacement +U1=0 + +//Stiffness of Springs +k1=4 +k2=6 +k3=3 + +//Nodal Forces +F2=-30 +F3=0 +F4=50 + +//varible decleration +K=zeros(3,3) + +//Constructing Stiffness and Force matrices +K(1,1)=k1 + 2*k2 +K(1,2)=-2*k2 +K(2,1)=-2*k2 +K(2,2)=2*k2 +k3 +K(2,3)=-k3 +K(3,2)=-k3 +K(3,3)=k3 + +F(1,1)=F2 +F(2,1)=F3 +F(3,1)=F4 + +//Solving for Nodal Displacements U2, U3 and U4 +U=linsolve(K,-F) //K*U=F (equlibrium equation) + +//Solving for Nodal force F1 +F1=-4*U(1,1) + +//Printing Results +printf('\nResults\n') +printf('\nNodal displacements \nU1=%fmm \nU2=%fmm \nU3=%fmm \nU4=%fmm\n',U1,U(1,1),U(2,1),U(3,1)) +printf('\nNodal Force F1=%fN\n',F1) diff --git a/3588/CH3/EX3.2/EX3_2.sav b/3588/CH3/EX3.2/EX3_2.sav Binary files differnew file mode 100644 index 000000000..f31ed296c --- /dev/null +++ b/3588/CH3/EX3.2/EX3_2.sav diff --git a/3588/CH3/EX3.2/EX3_2.sce b/3588/CH3/EX3.2/EX3_2.sce new file mode 100644 index 000000000..23a1aebae --- /dev/null +++ b/3588/CH3/EX3.2/EX3_2.sce @@ -0,0 +1,55 @@ +//Clearing Console +clc +clear + +//Intialing given values +E1=10*10^6 +E2=10*10^6 +A1=1.5 +A2=1.5 +L1=56.57 +L2=40 +//Calculating stiffnesses of elements +k1=A1*E1/L1 +k2=A2*E2/L2 + +//Calculating Stiffness matrix +K= [k1/2 k1/2 0 0 -k1/2 -k1/2;k1/2 k1/2 0 0 -k1/2 -k1/2;0 0 k2 0 -k2 0;0 0 0 0 0 0;-k1/2 -k1/2 -k2 0 k1/2+k2 k1/2;-k1/2 -k1/2 0 0 k1/2 k1/2] + +//Intializing known nodal displacements and forces +U(1,1)=0 +U(2,1)=0 +U(3,1)=0 +U(4,1)=0 + +F(5,1)=500 +F(6,1)=300 + +//Calculating Nodal Displacements +U(5:6,1)=linsolve(K(5:6,5:6),-F(5:6,1)) //K*U=F (equlibrium equation) + +//Calculatiing Nodal Forces +F(1:4)=K(1:4,5:6)*U(5:6) + +//Calculating Elemental forces displacements and stress +//For Element-1 +R1= [1/sqrt(2) 1/sqrt(2) 0 0;0 0 1/sqrt(2) 1/sqrt(2)] +u1 = R1*U([1 2 5 6],1) +sigma_1 = E1*[-1/L1 1/L1]*R1*U([1 2 5 6],1) +f1 = [k1 -k1;-k1 k1]*u1 +//For Element_2 +R2= [1 0 0 0;0 0 1 0] +u2 = R2*U([3:6],1) +sigma_2 = E2*[-1/L2 1/L2]*R2*U([3:6],1) +f2 = [k2 -k2;-k2 k2]*u2 + +//Printing Results +printf('\nResults\n') +printf('\nNodal Displacements \nU1x=%fin \nU1y=%fin \nU2x=%fin \nU2y=%fin \nU3x=%fin \nU3y=%fin\n',U(1,1),U(2,1),U(3,1),U(4,1),U(5,1),U(6,1)) +printf('\nNodal Forces \nF1x=%flb \nF1y=%flb \nF2x=%flb \nF2y=%flb \nF3x=%flb \nF3y=%flb\n',F(1,1),F(2,1),F(3,1),F(4,1),F(5,1),F(6,1)) +printf('\nElement-1 Displacements \nux=%fin \nuy=%fin \n',u1(1,1),u1(2,1)) +printf('\nElement-1 Forces \nFx=%flb \nFy=%flb\n',f1(1,1),f1(2,1)) +printf('\nElement-1 Stress \nSigma_1=%flb/in^2\n',sigma_1) +printf('\nElement-2 Displacements \nux=%fin \nuy=%fin \n',u2(1,1),u2(2,1)) +printf('\nElement-2 Forces \nFx=%flb \nFy=%flb\n',f2(1,1),f2(2,1)) +printf('\nElement-2 Stress \nSigma_2=%flb/in^2\n',sigma_2) diff --git a/3588/CH3/EX3.3/EX3_3.sav b/3588/CH3/EX3.3/EX3_3.sav Binary files differnew file mode 100644 index 000000000..90e0d0668 --- /dev/null +++ b/3588/CH3/EX3.3/EX3_3.sav diff --git a/3588/CH3/EX3.3/EX3_3.sce b/3588/CH3/EX3.3/EX3_3.sce new file mode 100644 index 000000000..8691ebbd3 --- /dev/null +++ b/3588/CH3/EX3.3/EX3_3.sce @@ -0,0 +1,45 @@ +//Clearing Console +clc +clear + +//First, note that the 3-D truss with four nodes has 12 possible displacements. However, +//since nodes 1–3 are fixed, nine of the possible displacements are known to be zero. There- +//fore, we need assemble only a portion of the system stiffness matrix to solve for the three +//unknown displacements. + +//Calculating Elemental Stiffness Matrices +for i=1:3 + if i==1 then + cx=0.8 + cy=0 + cz=-0.6 + K1=3*10^5*[cx^2 cx*cy cx*cz -cx^2 -cx*cy -cx*cz;cx*cy cy^2 cy*cz -cx*cy -cy^2 -cy*cz;cx*cz cy*cz cz^2 -cx*cz -cy*cz -cz^2;-cx^2 -cx*cy -cx*cz cx^2 cx*cy cx*cz;-cx*cy -cy^2 -cy*cz cx*cy cy^2 cy*cz;-cx*cz -cy*cz -cz^2 cx*cz cy*cz cz^2] + end + if i==2 then + cx=0.8 + cy=0 + cz=0.6 + K2=3*10^5*[cx^2 cx*cy cx*cz -cx^2 -cx*cy -cx*cz;cx*cy cy^2 cy*cz -cx*cy -cy^2 -cy*cz;cx*cz cy*cz cz^2 -cx*cz -cy*cz -cz^2;-cx^2 -cx*cy -cx*cz cx^2 cx*cy cx*cz;-cx*cy -cy^2 -cy*cz cx*cy cy^2 cy*cz;-cx*cz -cy*cz -cz^2 cx*cz cy*cz cz^2] + end + if i==3 then + cx=0.8 + cy=0.6 + cz=0 + K3=3*10^5*[cx^2 cx*cy cx*cz -cx^2 -cx*cy -cx*cz;cx*cy cy^2 cy*cz -cx*cy -cy^2 -cy*cz;cx*cz cy*cz cz^2 -cx*cz -cy*cz -cz^2;-cx^2 -cx*cy -cx*cz cx^2 cx*cy cx*cz;-cx*cy -cy^2 -cy*cz cx*cy cy^2 cy*cz;-cx*cz -cy*cz -cz^2 cx*cz cy*cz cz^2] + end +end + +//Calculating required elements of global Stiffness Matrix +K([10:12],[10:12]) = [K1(4,4)+K2(4,4)+K3(4,4) K1(4,5)+K2(4,5)+K3(4,5) K1(4,6)+K2(4,6)+K3(4,6); K1(4,5)+K2(4,5)+K3(4,5) K1(5,5)+K2(5,5)+K3(5,5) K1(5,6)+K2(5,6)+K3(5,6); K1(4,6)+K2(4,6)+K3(4,6) K1(5,6)+K2(5,6)+K3(5,6) K1(6,6)+K2(6,6)+K3(6,6)] + +//Constructing required Force matrix +F([10:12],1)=[0;-5000;0] + +//Solving for node 4 displacements +U(10:12,1)=linsolve(K(10:12,10:12),-F(10:12,1)) //K*U=F (equlibrium equation) + +//Printing Results +printf('\nResults\n') +printf('\nNode-4 Displacement Components \nUx=%fin \nUy=%fin \nUz=%fin',U(10,1),U(11,1),U(12,1)) + + diff --git a/3588/CH4/EX4.3/EX4_3.sav b/3588/CH4/EX4.3/EX4_3.sav Binary files differnew file mode 100644 index 000000000..b187f611f --- /dev/null +++ b/3588/CH4/EX4.3/EX4_3.sav diff --git a/3588/CH4/EX4.3/EX4_3.sce b/3588/CH4/EX4.3/EX4_3.sce new file mode 100644 index 000000000..61e93cd29 --- /dev/null +++ b/3588/CH4/EX4.3/EX4_3.sce @@ -0,0 +1,49 @@ +//Clearing console +clc +clear + +//Intializing Variables +b = 40 +h = 40 +I = (b*h^3)/12 +L1=300 +L2=300 +L3=200 +E1 = 207*10^3 +E3 = 69*10^3 +A1= 1600 +A3 = 78.54 + +//Calculating elemental stiffness matrices +K1 = ((E1*I)/(L1^3))*[12 6*L1 -12 6*L1;6*L1 4*(L1)^2 -6*L1 2*(L1)^2; -12 -6*L1 12 -6*L1; 6*L1 2*(L1)^2 -6*L1 4*(L1)^2] +K2 = K1 //as L1 = L2 and both are of same material (E1 = E2) +K3 = (A3*E3/L3)*[1 -1;-1 1] + +//Constructing Global Stiffness matrix +K(1,[1:7])= [K1(1,[1:4]) 0 0 0] +K(2,[1:7])= [K1(2,[1:4]) 0 0 0] +K(3,[1:7])= [K1(3,[1:2]) K1(3,3)+K2(1,1)+K3(1,1) K1(3,4)+K2(1,2) K2(1,[3:4]) K3(1,2)] +K(4,[1:7])= [K1(4,[1:2]) K1(4,3)+K2(2,1) K1(4,4)+K2(2,2) K2(2,[3:4]) 0] +K(5,[1:7])= [0 0 K2(3,[1:4]) 0 ] +K(6,[1:7])= [0 0 K2(4,[1:4]) 0 ] +K(7,[1:7])= [0 0 K3(2,1) 0 0 0 K3(2,2)] + +//Constructing Force matrix (required values) +F([2:6],1) = [0; 0; 0; -10000; 0] + +//Solving for displacements +U(2:6,1)=linsolve(K(2:6,2:6),-F(2:6,1)) //K*U=F (equlibrium equation) + +//Solving Axial stress of BD element +stress_BD = E3*[-1/L3 1/L3]*[0 1 0 0;0 0 0 1]*[0;U(3,1);0;0] +U(1,1)=0 +U(7,1)=0 + +//Calculating Reaction forces +F = [K]*[U] + +//Printing Results +printf('\nResults\n') +printf('\nNode-C Displacement Components \nU=%fmm \nTheta=%frad',U(3,1),U(4,1)) +printf('\nReaction Forces \nR1=%fN \nR4=%fN',F(1,1),F(7,1)) + diff --git a/3588/CH4/EX4.4/EX4_4.sav b/3588/CH4/EX4.4/EX4_4.sav Binary files differnew file mode 100644 index 000000000..afae5bc14 --- /dev/null +++ b/3588/CH4/EX4.4/EX4_4.sav diff --git a/3588/CH4/EX4.4/EX4_4.sce b/3588/CH4/EX4.4/EX4_4.sce new file mode 100644 index 000000000..39f3c563c --- /dev/null +++ b/3588/CH4/EX4.4/EX4_4.sce @@ -0,0 +1,48 @@ +//Clearing console +clc +clear + +//Intializing Variables +b = 1 +h = 1 +A = 1 +L = 20 +I = (b*h^3)/12 +E = 10*10^6 +M = 90 + +//Calculating elemental stiffness matrices +k1([2,3,5,6],1:6) = ((E*I)/(L^3))*[0 12 6*L 0 -12 6*L;0 6*L 4*(L)^2 0 -6*L 2*(L)^2;0 -12 -6*L 0 12 -6*L;0 6*L 2*(L)^2 0 -6*L 4*(L)^2] +k1([1,4],1:6) = (A*E/L)*[1 0 0 -1 0 0;-1 0 0 1 0 0] +k2 = k1 //as L1 = L2 and both are of same material (E1 = E2) + +//Calculating transformation matrix +R = [cosd(M) sind(M) 0 0 0 0;-sind(M) cosd(M) 0 0 0 0;0 0 1 0 0 0;0 0 0 cosd(M) sind(M) 0;0 0 0 -sind(M) cosd(M) 0;0 0 0 0 0 1] + +//Constructing elemental Stiffness matrix in global system +K1 = (R)'*k1*R + +//Constructing Global Stiffness matrix +K(1,[1:9])= [K1(1,[1:6]) 0 0 0] +K(2,[1:9])= [K1(2,[1:6]) 0 0 0] +K(3,[1:9])= [K1(3,[1:6]) 0 0 0] +K(4,[1:9])= [K1(4,[1:3]) K1(4,4)+k2(1,1) K1(4,5)+k2(1,2) K1(4,6)+k2(1,3) k2(1,[4:6])] +K(5,[1:9])= [K1(5,[1:3]) K1(5,4)+k2(2,1) K1(5,5)+k2(2,2) K1(5,6)+k2(2,3) k2(2,[4:6])] +K(6,[1:9])= [K1(6,[1:3]) K1(6,4)+k2(3,1) K1(6,5)+k2(3,2) K1(6,6)+k2(3,3) k2(3,[4:6])] +K(7,[1:9])= [0 0 0 k2(4,[1:6])] +K(8,[1:9])= [0 0 0 k2(5,[1:6])] +K(9,[1:9])= [0 0 0 k2(6,[1:6])] + +//Constructing Force matrix (required values) +F([4:6],1) = [0;-100;-333.3] +U([1:3],1) =[0; 0; 0] + +//Solving for displacements +U(4:6,1)=linsolve(K(4:6,4:6),-F(4:6,1)) //K*U=F (equlibrium equation) + +//Solving for local displacements +u(1:6,1) = R*U(1:6,1) + +//Printing Results +printf('\nResults\n') +printf('\nNode-B Displacement Components \nUx=%fin \nUy=%fin \nTheta=%frad',u(4,1),u(5,1),u(6,1)) diff --git a/3588/CH5/EX5.1/EX5_1.png b/3588/CH5/EX5.1/EX5_1.png Binary files differnew file mode 100644 index 000000000..4daf259dd --- /dev/null +++ b/3588/CH5/EX5.1/EX5_1.png diff --git a/3588/CH5/EX5.1/EX5_1.sav b/3588/CH5/EX5.1/EX5_1.sav Binary files differnew file mode 100644 index 000000000..e1a5f3b41 --- /dev/null +++ b/3588/CH5/EX5.1/EX5_1.sav diff --git a/3588/CH5/EX5.1/EX5_1.sce b/3588/CH5/EX5.1/EX5_1.sce new file mode 100644 index 000000000..3a39983bf --- /dev/null +++ b/3588/CH5/EX5.1/EX5_1.sce @@ -0,0 +1,27 @@ +//Clearing console +clc +clear + +x = poly(0,"x") +//Intializing variables +x0 = 0 +x1 = 1 + +//Calculating constants in solution (Y = c*X) X-trial function +c = integrate('x*(x-1)*(10*x^2+5)','x',x0,x1)/integrate('x*(x-1)*2','x',x0,x1) + +//Calculating solution for given differntial equation +for t =1:11 + F(1,t) = c*(t-1)*(t-11)/100 +end +S = c*x*(x-1) +//Constructing x matrix +t = 0:0.1:1; + +//plotting solution +plot(t,F); +xtitle('solution','x','y(x)') + +printf('\nResults\n') +printf('\nSolution of the Differential Equation y(x) =') +disp(S) diff --git a/3588/CH5/EX5.2/EX5_2.png b/3588/CH5/EX5.2/EX5_2.png Binary files differnew file mode 100644 index 000000000..11bcebcc0 --- /dev/null +++ b/3588/CH5/EX5.2/EX5_2.png diff --git a/3588/CH5/EX5.2/EX5_2.sav b/3588/CH5/EX5.2/EX5_2.sav Binary files differnew file mode 100644 index 000000000..2704c4fd0 --- /dev/null +++ b/3588/CH5/EX5.2/EX5_2.sav diff --git a/3588/CH5/EX5.2/EX5_2.sce b/3588/CH5/EX5.2/EX5_2.sce new file mode 100644 index 000000000..1c31c63cf --- /dev/null +++ b/3588/CH5/EX5.2/EX5_2.sce @@ -0,0 +1,37 @@ +//Clearing console +clc +clear + +x = poly(0,"x") + +//Intializing variables +x0 = 0 +x1 = 1 + +//Consrtucting K and F matrices to solve the residual equations +K(1,1:2) = [integrate('x*(x-1)*2','x',x0,x1) integrate('x*(x-1)*2*(3*x-1)','x',x0,x1)] +K(2,1:2) = [integrate('x^2*(x-1)*2','x',x0,x1) integrate('x^2*(x-1)*2*(3*x-1)','x',x0,x1)] + +F = [integrate('x*(x-1)*(10*(x^2)+5)','x',x0,x1); integrate('x^2*(x-1)*(10*(x^2)+5)','x',x0,x1)] + +//Solving for constants in assumed solution +U(1:2,1)=linsolve(K,-F) + +S = U(1,1)*x*(x-1)+U(2,1)*x^2*(x-1) + +//Calculating solution for given differntial equation +for t =1:11 + P(1,t) = (U(1,1)*(t-1)*(t-11)/100)+(U(2,1)*(t-1)^2*(t-11)/1000) +end + +//Constructing x matrix +k = 0:0.1:1; + +//plotting solution +plot(k,P); +xtitle('solution','x','y(x)') + +printf('\nResults\n') +printf('\nSolution of the Differential Equation y(x) =') +disp(S) + diff --git a/3588/CH5/EX5.3/EX5_3.png b/3588/CH5/EX5.3/EX5_3.png Binary files differnew file mode 100644 index 000000000..3abc6b7ed --- /dev/null +++ b/3588/CH5/EX5.3/EX5_3.png diff --git a/3588/CH5/EX5.3/EX5_3.sav b/3588/CH5/EX5.3/EX5_3.sav Binary files differnew file mode 100644 index 000000000..ddfa0d959 --- /dev/null +++ b/3588/CH5/EX5.3/EX5_3.sav diff --git a/3588/CH5/EX5.3/EX5_3.sce b/3588/CH5/EX5.3/EX5_3.sce new file mode 100644 index 000000000..2a52fad7a --- /dev/null +++ b/3588/CH5/EX5.3/EX5_3.sce @@ -0,0 +1,33 @@ +//Clearing console +clc +clear + +x = poly(0,"x") + +//Intializing variables +x0 = 0 +x1 = 1 + +K = [integrate('x*(x-1)*(x^2-x+2)','x',x0,x1)] + +F = [integrate('x*(x-1)*3*x','x',x0,x1)] + +c = F/K + +S = c*x*(x-1)+x + +//Calculating solution for given differntial equation +for t =1:11 + P(1,t) = (c*(t-1)*(t-11)/100)+(t-1)/10 +end + +//Constructing x matrix +t = 0:0.1:1; + +//plotting solution +plot(t,P); +xtitle('solution','x','y(x)') + +printf('\nResults\n') +printf('\nSolution of the Differential Equation y(x) =') +disp(S) diff --git a/3588/CH5/EX5.4/EX5_4.sav b/3588/CH5/EX5.4/EX5_4.sav Binary files differnew file mode 100644 index 000000000..3765bc3ed --- /dev/null +++ b/3588/CH5/EX5.4/EX5_4.sav diff --git a/3588/CH5/EX5.4/EX5_4.sce b/3588/CH5/EX5.4/EX5_4.sce new file mode 100644 index 000000000..eb1a1e597 --- /dev/null +++ b/3588/CH5/EX5.4/EX5_4.sce @@ -0,0 +1,35 @@ +//Clearing console +clc +clear + +x = poly(0,"x") +//Intializing variables +x0 = 0 +x1 = 1 + +//Calculating constants in solution (Y = c*X) X-trial function +c = integrate('x*(x-1)*(10*x^2+5)','x',x0,x1)/integrate('x*(x-1)*2','x',x0,x1) + +S1 = c*x*(x-1) + +//2nd part of problem + +//Consrtucting K and F matrices to solve the residual equations +K(1,1:3) = [integrate('-x*(1-x^3)*12*x^2','x',x0,x1) integrate('x*(1-x^3)*(2-12*x^2)','x',x0,x1) integrate('x*(1-x^3)*(6*x-12*x^2)','x',x0,x1)] +K(2,1:3) = [integrate('-x^2*(1-x^2)*12*x^2','x',x0,x1) integrate('x^2*(1-x^2)*(2-12*x^2)','x',x0,x1) integrate('x^2*(1-x^2)*(6*x-12*x^2)','x',x0,x1)] +K(3,1:3) = [integrate('-x^3*(1-x)*12*x^2','x',x0,x1) integrate('x^3*(1-x)*(2-12*x^2)','x',x0,x1) integrate('x^3*(1-x)*(6*x-12*x^2)','x',x0,x1)] + +F = [integrate('x*(1-x^3)*(10*(x^2)+5)','x',x0,x1); integrate('x^2*(1-x^2)*(10*(x^2)+5)','x',x0,x1);integrate('x^3*(1-x)*(10*(x^2)+5)','x',x0,x1)] + +//Solving for constants in assumed solution +U(1:3,1)=(linsolve(K,-F)) + +c4 = -(U(1,1)+U(2,1)+U(3,1)) +S2 = U(1,1)*x +U(2,1)*x^2 +U(3,1)*x^3 +c4*x^4 + +printf('\nResults\n') +printf('\nSolution of the Differential Equation') +printf('\nPart-1 y(x) = ') +disp(S1) +printf('\nPart-2 y(x) = ') +disp(S2) diff --git a/3588/CH5/EX5.6/EX5_6.sav b/3588/CH5/EX5.6/EX5_6.sav Binary files differnew file mode 100644 index 000000000..a2bacc540 --- /dev/null +++ b/3588/CH5/EX5.6/EX5_6.sav diff --git a/3588/CH5/EX5.6/EX5_6.sce b/3588/CH5/EX5.6/EX5_6.sce new file mode 100644 index 000000000..74d570fed --- /dev/null +++ b/3588/CH5/EX5.6/EX5_6.sce @@ -0,0 +1,40 @@ +//Clearing console +clc +clear + +//Intializing Variables +d = 0.06 +k1 = 200 +k2 = 389 +L1 = 0.25 +T(5,1) = 80 +Q(1:4,1) = ((%pi*d^2)/4)*[4000;0;0;0] + +//Calculating elemental conductance matrices +K1 = ((k1*%pi*(d^2))/(4*L1))*[1 -1;-1 1] +K2 = ((k2*%pi*(d^2))/(4*L1))*[1 -1;-1 1] + +//Calculating conductance matrices +K(1,1:5) = [K1(1,1:2) 0 0 0] +K(2,1:5) = [K1(2,1) K1(2,2)+K1(1,1) K1(1,2) 0 0] +K(3,1:5) = [0 K1(2,1) K1(2,2)+K2(1,1) K2(1,2) 0 ] +K(4,1:5) = [0 0 K2(2,1) K2(2,2)+K2(1,1) K2(1,2)] +K(5,1:5) = [0 0 0 K2(2,1) K2(2,2)] + +//Accounting for the known temperature at node 5, and modifying Q matrix for solving +q(1:4,1) = Q(1:4,1) - T(5,1)*K(1:4,5) + +//Solving for Temperatures +T(1:4,1)=linsolve(K(1:4,1:4),-q(1:4,1)) + +//Sovling for heat at node 5 +Q(5,1) = K(5,1:5)*T + +//Sovling for heat flux at node 5 +q5 = - Q(5,1)/((%pi*d^2)/4) + +//Printing Results +printf('\nResults\n') +printf('\nNode-Temperatures \nT1=%f◦C \nT2=%f◦C \nT3=%f◦C \nT4=%f◦C \nT5=%f◦C',T(1,1),T(2,1),T(3,1),T(4,1),T(5,1)) +printf('\nHeat flow at node-5 \nq5=%fW/m^2',q5) + diff --git a/3588/CH6/EX6.1/EX6_1.sav b/3588/CH6/EX6.1/EX6_1.sav Binary files differnew file mode 100644 index 000000000..e151f00fd --- /dev/null +++ b/3588/CH6/EX6.1/EX6_1.sav diff --git a/3588/CH6/EX6.1/EX6_1.sce b/3588/CH6/EX6.1/EX6_1.sce new file mode 100644 index 000000000..d133990b2 --- /dev/null +++ b/3588/CH6/EX6.1/EX6_1.sce @@ -0,0 +1,28 @@ +//Clearing console +clc +clear + +s = poly(0,"s") + +//Calculating Constants in interpolation functions +c1 = 1/((-1/3)*(-2/3)*(-1)) +c2 = 1/((1/3)*(-1/3)*(-2/3)) +c3 = 1/((2/3)*(1/3)*(-1/3)) +c4 = 1/((1)*(2/3)*(1/3)) + +//interpolation functions +N1 = c1*(s-1/3)*(s-2/3)*(s-1) +N2 = c2*(s)*(s-2/3)*(s-1) +N3 = c3*(s)*(s-1/3)*(s-1) +N4 = c4*(s)*(s-1/3)*(s-2/3) + +//Printing Results +printf('\nInterpolation Functions\n') +printf('N1(x) =') +disp(N1) +printf('N2(x) =') +disp(N2) +printf('N3(x) =') +disp(N3) +printf('N4(x) =') +disp(N4) diff --git a/3588/CH6/EX6.10/EX6_10.sav b/3588/CH6/EX6.10/EX6_10.sav Binary files differnew file mode 100644 index 000000000..f6be677b5 --- /dev/null +++ b/3588/CH6/EX6.10/EX6_10.sav diff --git a/3588/CH6/EX6.10/EX6_10.sce b/3588/CH6/EX6.10/EX6_10.sce new file mode 100644 index 000000000..505d3ca6b --- /dev/null +++ b/3588/CH6/EX6.10/EX6_10.sce @@ -0,0 +1,56 @@ +//Clearing console +clc +clear + +//Intializing variables +r1 = 0 +r(1) = sqrt(3)/3 +r(2) = -sqrt(3)/3 + +t(1) = 0 +t(2) = 0.7745967 +t(3)= -0.7745967 + +W11 = 2 +Wt(1)= 0.8888889 +Wt(2) = 0.5555556 +Wt(3) = 0.5555556 + +f(1) = 0.339981043583856 +f(2) = -0.339981043583856 +f(3) = 0.861136311590453 +f(4) = -0.861136311590453 + +Wf(1) = 0.652145154862526 +Wf(2) = 0.652145154862526 +Wf(3) = 0.347854845137454 +Wf(4) = 0.347854845137454 + +//Gaussian quadrature Integration one point +I1 = -2*(1/3) + +//Not considering weight factors for cubic and quadratic functions as they are 1 +//Gaussian quadrature Integration two points +I2 = 0 +for i =1:2 + I2 = I2 + (r(i)^2 -1)/((r(i)+3)^2) +end + +//Gaussian quadrature Integration three points +I3 = 0 +for i =1:3 + I3 = I3 + Wt(i)*(t(i)^2 -1)/((t(i)+3)^2) +end + +//Gaussian quadrature Integration three points +I4 = 0 +for i =1:4 + I4 = I4 + Wf(i)*(f(i)^2 -1)/((f(i)+3)^2) +end + +printf('\nResults') +printf('Integration of given function') +printf('\n One Point Integration I1 =%f',I1) +printf('\n Two Point Integration I2 =%f',I2) +printf('\n Three Point Integration I3 =%f',I3) +printf('\n Four Point Integration I4 =%f',I4) diff --git a/3588/CH6/EX6.3/EX6_3.sav b/3588/CH6/EX6.3/EX6_3.sav Binary files differnew file mode 100644 index 000000000..8469ef271 --- /dev/null +++ b/3588/CH6/EX6.3/EX6_3.sav diff --git a/3588/CH6/EX6.3/EX6_3.sce b/3588/CH6/EX6.3/EX6_3.sce new file mode 100644 index 000000000..2c5f799b1 --- /dev/null +++ b/3588/CH6/EX6.3/EX6_3.sce @@ -0,0 +1,32 @@ +//Clearing console +clc +clear + +x = poly(0,"x") +y = poly(0,"y") + +//Intializing Variables +r = 1 +s = 0.5 + +//Node 2: (3*m + b=1) +//Node 3: (2.5*m + b=2) +//constructing matrices for solving b and m +k = [3 1;2.5 1] +f = [1;2] + +//Solving for b and m +u(1:2,1)=linsolve(k,-f) + +//Calculating x and y for (r, s) = (1, 0.5) +X = (1 - r )*(1 - s)/4 + (1 + r )*(1 - s)*(3)/4 + (1 + r )*(1 + s)*(2.5)/4 + (1 - r )*(1 + s)*(1.25)/4 +Y =(1 - r )*(1 - s)/4 + (1 + r )*(1 - s)/4 + (1 + r )*(1 + s)*(2)/4 + (1 - r )*(1 + s)*(1.75)/4 + + + +//Printing Results +printf('\nResults\n') +printf('\nelement edge 2-3 is described by y=') +disp(u(1,1)*x + u(2,1)) +printf('\nFor (r, s) = (1, 0.5) , we obtain') +printf('\n x=%f y=%f',X,Y) diff --git a/3588/CH6/EX6.7/EX6_7.sav b/3588/CH6/EX6.7/EX6_7.sav Binary files differnew file mode 100644 index 000000000..db8306be9 --- /dev/null +++ b/3588/CH6/EX6.7/EX6_7.sav diff --git a/3588/CH6/EX6.7/EX6_7.sce b/3588/CH6/EX6.7/EX6_7.sce new file mode 100644 index 000000000..8bc410036 --- /dev/null +++ b/3588/CH6/EX6.7/EX6_7.sce @@ -0,0 +1,13 @@ +//Clearing console +clc +clear + +//Intializing variables +x0 = -1 +x1 = 1 + +//Integrating given function +f = [integrate('r^2 -3*r+7','r',x0,x1)] + +printf('\nResults') +printf('\nIntegration of given function f =%f',f) diff --git a/3588/CH6/EX6.8/EX6_8.sav b/3588/CH6/EX6.8/EX6_8.sav Binary files differnew file mode 100644 index 000000000..12285c74f --- /dev/null +++ b/3588/CH6/EX6.8/EX6_8.sav diff --git a/3588/CH6/EX6.8/EX6_8.sce b/3588/CH6/EX6.8/EX6_8.sce new file mode 100644 index 000000000..d5473fc71 --- /dev/null +++ b/3588/CH6/EX6.8/EX6_8.sce @@ -0,0 +1,23 @@ +//Clearing console +clc +clear + +//Intializing variables +r(1) = sqrt(3)/3 +r(2) = -sqrt(3)/3 +s(1) = sqrt(3)/3 +s(2) = -sqrt(3)/3 + +W(1) = 1 +W(2) = 1 +I = 0 + +//Gaussian quadrature Integration +for j =1:2 + for i =1:2 + I = I + W(i)*W(j)*((r(i))^3 -1)*(s(j)-1)^2 + end +end + +printf('\nResults') +printf('\nIntegration of given function I =%f',-I) diff --git a/3588/CH6/EX6.9/EX6_9.sav b/3588/CH6/EX6.9/EX6_9.sav Binary files differnew file mode 100644 index 000000000..d41de5738 --- /dev/null +++ b/3588/CH6/EX6.9/EX6_9.sav diff --git a/3588/CH6/EX6.9/EX6_9.sce b/3588/CH6/EX6.9/EX6_9.sce new file mode 100644 index 000000000..a3b8be5c6 --- /dev/null +++ b/3588/CH6/EX6.9/EX6_9.sce @@ -0,0 +1,30 @@ +//Clearing console +clc +clear + +//Intializing variables +r(1) = sqrt(3)/3 +r(2) = -sqrt(3)/3 +s(1) = sqrt(3)/3 +s(2) = -sqrt(3)/3 +t(1) = 0 +t(2) = 0.7745967 +t(3)= -0.7745967 + +Wt(1)= 0.8888889 +Wt(2) = 0.5555556 +Wt(3) = 0.5555556 +//Not considering weight factors for cubic and quadratic functions as they are 1 + +I = 0 +//Gaussian quadrature Integration +for k =1:3 + for j =1:2 + for i =1:2 + I = I + Wt(k)*((r(i))^2)*((s(j))^2 -1)*((t(k))^4 -2) + end + end +end + +printf('\nResults') +printf('\nIntegration of given function I =%f',I) diff --git a/3588/CH7/EX7.1/EX7_1.sav b/3588/CH7/EX7.1/EX7_1.sav Binary files differnew file mode 100644 index 000000000..0eeaab6ea --- /dev/null +++ b/3588/CH7/EX7.1/EX7_1.sav diff --git a/3588/CH7/EX7.1/EX7_1.sce b/3588/CH7/EX7.1/EX7_1.sce new file mode 100644 index 000000000..e378b08cf --- /dev/null +++ b/3588/CH7/EX7.1/EX7_1.sce @@ -0,0 +1,44 @@ +//Clearing console +clc +clear + +//Intializing Variables +d = 0.06 +k1 = 200 +k2 = 389 +L = 0.5 +T(5,1) = 80 +Q(1:4,1) = ((%pi*d^2)/4)*[4000;0;0;0] +A = (%pi*d^2)/4 + +//Calculating elemental stiffness matrices +function K= matri(k,A,L) + K=[(7*k*A)/(3*L) -(8*k*A)/(3*L) (k*A)/(3*L);-(8*k*A)/(3*L) (16*k*A)/(3*L) -(8*k*A)/(3*L);(k*A)/(3*L) -(8*k*A)/(3*L) (7*k*A)/(3*L)] +endfunction + +K1 = matri(k1,A,L) +K2 = matri(k2,A,L) + +//Calculating global stiffness matrice +K(1,1:5) = [K1(1,1:3) 0 0] +K(2,1:5) = [K1(2,1:3) 0 0] +K(3,1:5) = [K1(3,1) K1(3,2) K1(3,3)+K2(1,1) K2(1,2:3)] +K(4,1:5) = [0 0 K2(2,1:3)] +K(5,1:5) = [0 0 K2(3,1:3)] + +//Accounting for T5 = 80◦C and Calculating Qd +Qd(1:4,1) = Q(1:4,1)-T(5,1)*K(1:4,5) + +//Solving for Temperatures +T(1:4,1)=linsolve(K(1:4,1:4),-Qd(1:4,1)) + +//Sovling for heat at node 5 +Q(5,1) = K(5,1:5)*T + +//Sovling for heat flux at node 5 +q5 = - Q(5,1)/((%pi*d^2)/4) + +//Printing Results +printf('\nResults\n') +printf('\nNode-Temperatures \nT1=%f◦C \nT2=%f◦C \nT3=%f◦C \nT4=%f◦C \nT5=%f◦C',T(1,1),T(2,1),T(3,1),T(4,1),T(5,1)) +printf('\nHeat flow at node-5 \nq5=%fW/m^2',q5) diff --git a/3588/CH7/EX7.11/EX7_11.sav b/3588/CH7/EX7.11/EX7_11.sav Binary files differnew file mode 100644 index 000000000..4dbdea002 --- /dev/null +++ b/3588/CH7/EX7.11/EX7_11.sav diff --git a/3588/CH7/EX7.11/EX7_11.sce b/3588/CH7/EX7.11/EX7_11.sce new file mode 100644 index 000000000..894267d70 --- /dev/null +++ b/3588/CH7/EX7.11/EX7_11.sce @@ -0,0 +1,55 @@ +//Clearing console +clc +clear + +//Intializing Variables +d = 0.012 +L = 0.1 +k = 200 +c = 900 +p = 2700 +T(1,1) = 80 +T(5,1) = 30 +Td(1,1) = 0 +Td(5,1) = 0 +Q(1:4,1) = ((%pi*d^2)/4)*[4000;0;0;0] + +//Calculating elemental conductance and capacitance matrices +C1 = ((c*p*L*%pi*(d)^2)/(16*6))*[2 1;1 2] +K1 = ((k*%pi*(d)^2)/(L))*[1 -1;-1 1] + +//Calculating globLal capacitance matrices +C(1,1:5) = [C1(1,1:2) 0 0 0] +C(2,1:5) = [C1(2,1) C1(2,2)+C1(1,1) C1(1,2) 0 0] +C(3,1:5) = [0 C1(2,1) C1(2,2)+C1(1,1) C1(1,2) 0] +C(4,1:5) = [0 0 C1(2,1) C1(2,2)+C1(1,1) C1(1,2)] +C(5,1:5) = [0 0 0 C1(2,1) C1(2,2)] + +//Calculating global conductance matrices +K(1,1:5) = [K1(1,1:2) 0 0 0] +K(2,1:5) = [K1(2,1) K1(2,2)+K1(1,1) K1(1,2) 0 0] +K(3,1:5) = [0 K1(2,1) K1(2,2)+K1(1,1) K1(1,2) 0] +K(4,1:5) = [0 0 K1(2,1) K1(2,2)+K1(1,1) K1(1,2)] +K(5,1:5) = [0 0 0 K1(2,1) K1(2,2)] + +//Calculating Inverse of Capacitance matrix +Ci = inv(C(2:4,2:4)) + +//Caluculating Coefficents Temperature odes +A = Ci*K(2:4,2:4) +B = Ci*(Q(2:4,1)-C(2:4,1)*Td(1,1)-C(2:4,5)*Td(5,1)-K(2:4,1)*T(1,1)-K(2:4,5)*T(5,1)) + +//solving for T2 T3 and T4 +T2(1) =30 +T3(1) =30 +T4(1) =30 + +for i = 2:301 + T2(i) = T2(i-1)-(A(1,1:3)*[T2(i-1);T3(i-1);T4(i-1)])+B(1,1) + T3(i) = T3(i-1)-(A(2,1:3)*[T2(i-1);T3(i-1);T4(i-1)])+B(2,1) + T4(i) = T4(i-1)-(A(3,1:3)*[T2(i-1);T3(i-1);T4(i-1)])+B(3,1) +end + +printf('\nResults\n') +printf('\nNode-Temperatures \nT2=%fK \nT3=%fK \nT4=%fK',T2(300),T3(300),T4(300)) + diff --git a/3588/CH7/EX7.2/EX7_2.sav b/3588/CH7/EX7.2/EX7_2.sav Binary files differnew file mode 100644 index 000000000..b6df83ad8 --- /dev/null +++ b/3588/CH7/EX7.2/EX7_2.sav diff --git a/3588/CH7/EX7.2/EX7_2.sce b/3588/CH7/EX7.2/EX7_2.sce new file mode 100644 index 000000000..b6f744875 --- /dev/null +++ b/3588/CH7/EX7.2/EX7_2.sce @@ -0,0 +1,15 @@ +//Clearing console +clc +clear + +//Intializing Variables +T1 = 95.14 +T2 = 90.14 +T3 = 85.14 + +//Calculating a2 +a2 = 2*T1 - 4*T2 +2*T3 + +//Printing Results +printf('\nResults\n') +printf('\na2=%f',a2) diff --git a/3588/CH7/EX7.3/EX7_3.sav b/3588/CH7/EX7.3/EX7_3.sav Binary files differnew file mode 100644 index 000000000..b7d610c7f --- /dev/null +++ b/3588/CH7/EX7.3/EX7_3.sav diff --git a/3588/CH7/EX7.3/EX7_3.sce b/3588/CH7/EX7.3/EX7_3.sce new file mode 100644 index 000000000..75072b292 --- /dev/null +++ b/3588/CH7/EX7.3/EX7_3.sce @@ -0,0 +1,50 @@ +//Clearing console +clc +clear + +//Intializing Variables +d = 0.5 +L = 4 +kx = 120 +ha = 50 +hw = 100 +Ta = 72 +T(1,1) = 180 +Q(1:4,1) = ((%pi*d^2)/4)*[4000;0;0;0] +A = (%pi*d^2)/(4*144) +Le = 1/12 +P = %pi*d/12 + +//Calculating elemental conductance capcitance matrices +Kc = ((kx*A)/(Le))*[1 -1;-1 1] +Kh = (ha*P*Le/(6))*[2 1;1 2] + +K1 = Kc + Kh + +//Calculating global stiffness matrice +K(1,1:5) = [K1(1,1:2) 0 0 0] +K(2,1:5) = [K1(2,1) K1(2,2)+K1(1,1) K1(1,2) 0 0] +K(3,1:5) = [0 K1(2,1) K1(2,2)+K1(1,1) K1(1,2) 0] +K(4,1:5) = [0 0 K1(2,1) K1(2,2)+K1(1,1) K1(1,2)] +K(5,1:5) = [0 0 0 K1(2,1) K1(2,2)] + +f = (ha*P*Ta*Le/(2))*[1;1] +Fh(2:5,1) = [f(1,1)+f(2,1);f(1,1)+f(2,1);f(1,1)+f(2,1);f(1,1)] +Fg(2:4,1) = Fh(2:4,1) +Fg(5,1) = Fh(5,1)+A*hw*40 +K(5,5) = K(5,5) +A*hw +Fd(2:5,1) = Fg(2:5,1)-K(2:5,1)*T(1,1) + +//Solving for Temperatures +T(2:5,1)=linsolve(K(2:5,2:5),-Fd(2:5,1)) + + +//Sovling for heat at node 5 +Fg(1,1) = K(1,1:5)*T + +//Sovling for heat flux at node 5 +q1 = ((-f(1,1)+ Fg(1,1))/(A)) + +printf('\nResults\n') +printf('\nNode-Temperatures \nT1=%f◦F \nT2=%f◦F \nT3=%f◦F \nT4=%f◦F \nT5=%f◦F',T(1,1),T(2,1),T(3,1),T(4,1),T(5,1)) +printf('\nHeat flow at node-1 \nq1=%fBtu/hr-ft^2',q1) diff --git a/3588/CH7/EX7.4/EX7_4.sav b/3588/CH7/EX7.4/EX7_4.sav Binary files differnew file mode 100644 index 000000000..424bfd3b7 --- /dev/null +++ b/3588/CH7/EX7.4/EX7_4.sav diff --git a/3588/CH7/EX7.4/EX7_4.sce b/3588/CH7/EX7.4/EX7_4.sce new file mode 100644 index 000000000..24ae49e04 --- /dev/null +++ b/3588/CH7/EX7.4/EX7_4.sce @@ -0,0 +1,58 @@ +//Clearing console +clc +clear + +//Intializing Variables +a = 0.5/12 +b = 0.5/12 +t = 0.5/12 +kx = 20 +ky = 20 +h= 50 + +r(1) = sqrt(3)/3 +r(2) = -sqrt(3)/3 +s(1) = sqrt(3)/3 +s(2) = -sqrt(3)/3 +K11 = 0 + +//Gaussian quadrature Integration for calculating elements of stiffness matrix +for j =1:2 + for i =1:2 + K11 = K11 + ((kx*t*(a/b)*(s(j)-1)^2)/16)+((ky*t*(b/a)*(r(i)-1)^2)/16)+((2*h*a*b*((1-r(i))^2)*((1-s(j))^2))/16) + end +end + +K22 = 0 +for j =1:2 + for i =1:2 + K22 = K22 + ((kx*t*(a/b)*(s(j)-1)^2)/16)+((ky*t*(b/a)*(r(i)+1)^2)/16)+((2*h*a*b*((1+r(i))^2)*((1-s(j))^2))/16) + end +end + +K12 = 0 +for j =1:2 + for i =1:2 + K12 = K12 + (-(kx*t*(a/b)*(s(j)-1)^2)/16)+((ky*t*(b/a)*(r(i)+1)*(1-r(i)))/16)+((2*h*a*b*(1-r(i))*(1+r(i))*((1-s(j))^2))/16) + end +end + +K13 = 0 +for j =1:2 + for i =1:2 + K13 = K13 + ((kx*t*(a/b)*(s(j)-1)*(s(j)+1))/16)+((ky*t*(b/a)*(r(i)+1)*(r(i)-1))/16)+((2*h*a*b*(1-r(i))*(1+r(i))*(1-s(j))*(1+s(j)))/16) + end +end + +K14 = 0 +for j =1:2 + for i =1:2 + K14 = K14 + (-(kx*t*(a/b)*(s(j)-1)*(1+s(j)))/16)+(-(ky*t*(b/a)*(1-r(i))^2)/16)+((2*h*a*b*(1-s(j))*(1+s(j))*((1-r(i))^2))/16) + end +end + +//Similarly Calculating other elements +K = [K11 K12 K13 K14;K12 K22 K12 K13;K13 K12 K22 K12;K14 K13 K12 K22] + +printf('\nComplete Element Conductance Matrix in Btu/(hr-◦F )\n') +disp(K) diff --git a/3588/CH7/EX7.5/EX7_5.sav b/3588/CH7/EX7.5/EX7_5.sav Binary files differnew file mode 100644 index 000000000..b83b52725 --- /dev/null +++ b/3588/CH7/EX7.5/EX7_5.sav diff --git a/3588/CH7/EX7.5/EX7_5.sce b/3588/CH7/EX7.5/EX7_5.sce new file mode 100644 index 000000000..7cab14276 --- /dev/null +++ b/3588/CH7/EX7.5/EX7_5.sce @@ -0,0 +1,89 @@ +//Clearing console +clc +clear + +//Intializing Variables +h = 50 +kx = 20 +ky = 20 +a = 0.5/12 +b = 0.5/12 +t = 0.5/12 +Ta = 68 +T(1,1) = 180 +T(2,1) = 180 +T(3,1) = 180 + +//Surface Convection stiffness matrix from problem EX7.4 +k = [0.6327160 -0.1003086 -0.2584877 -0.1003086;-0.1003086 0.6327160 -0.1003086 -0.2584877;-0.2584877 -0.1003086 0.6327160 -0.1003086;-0.1003086 -0.2584877 -0.1003086 0.6327160] + +k1 = integrate('(1-r)^2','r',-1,1) +k2 = integrate('(1+r)^2','r',-1,1) +k3 = integrate('1-r^2','r',-1,1) + +//Edge Convection stiffness matrix and force vector +k1h = (h*t*a/4)*[k1 k3 0 0;k3 k2 0 0;0 0 0 0;0 0 0 0] +f1h = (h*t*Ta*a/2)*[2;2;0;0] + +k2h = (h*t*a/4)*[k1 k3 0 0;k3 k2 0 0;0 0 0 0;0 0 0 0]+(h*t*b/4)*[0 0 0 0;0 k1 k3 0;0 k3 k2 0;0 0 0 0] +f2h = (h*t*Ta*a/2)*[2;4;2;0] + +k3h = (h*t*a/4)*[0 0 0 0;0 k1 k3 0;0 k3 k1+k2 k3;0 0 k3 k2] +f3h = (h*t*Ta*a/2)*[0;2;4;2] + +k4h = (h*t*a/4)*[0 0 0 0;0 0 0 0;0 0 k1 k3;0 0 k3 k2] +f4h = (h*t*Ta*a/2)*[0;0;2;2] + +//Surface Convection force vector +feh = (h*t*Ta*a/2)*[4;4;4;4] + +//Constructing Elemental stiffness matrices +k1 = k1h + k +k2 = k2h + k +k3 = k3h + k +k4 = k4h + k + +//Constructing elemental force vectors +f1 = f1h + feh +f2 = f2h + feh +f3 = f3h + feh +f4 = f4h + feh + +//Constructing Global stiffness matrix +K(1,1:9) = [k1(1,1) k1(1,4) 0 k1(1,2) k1(1,3) 0 0 0 0] +K(2,1:9) = [k1(4,1) k1(4,4)+k4(1,1) k4(1,4) k1(4,2) k1(4,3)+k4(1,2) k4(1,3) 0 0 0] +K(3,1:9) = [0 k4(4,1) k4(4,4) 0 k4(4,2) k4(4,3) 0 0 0] +K(4,1:9) = [k1(2,1) k1(2,4) 0 k1(2,2)+k2(1,1) k1(2,3)+k2(1,4) 0 k2(1,2) k2(1,3) 0] +K(5,1:9) = [k1(3,1) k1(3,4)+k4(2,1) k4(2,4) k1(3,2)+k2(4,1) k1(3,3)+k2(4,4)+k3(1,1)+k4(2,2) k3(1,4)+k4(2,3) k2(4,2) k2(4,3)+k3(1,2) k3(1,3)] +K(6,1:9) = [0 k4(3,1) k4(3,4) 0 k3(4,1)+k4(3,2) k3(4,4)+k4(3,3) 0 k3(4,2) k3(4,3)] +K(7,1:9) = [0 0 0 k2(2,1) k2(2,4) 0 k2(2,2) k2(2,3) 0] +K(8,1:9) = [0 0 0 k2(3,1) k2(3,4)+k3(2,1) k3(2,4) k2(3,2) k2(3,3)+k3(2,2) k3(2,3)] +K(9,1:9) = [0 0 0 0 k3(3,1) k3(3,4) 0 k3(3,2) k3(3,3)] + +//Constructing Global force vector +F(4,1) = f1(2,1) +f2(1,1) +F(5,1) = f1(3,1) +f2(4,1)+f3(1,1)+f4(2,1) +F(6,1) = f3(4,1) +f4(3,1) +F(7,1) = f2(2,1) +F(8,1) = f2(3,1) +f3(2,1) +F(9,1) = f3(3,1) + +//Resulting force vector by accounting for T1=T2=T3=180 +Fd(4:9,1) = F(4:9,1) - K(4:9,1:3)*T(1:3,1) + +//Solving for Temperatures +T(4:9,1)=linsolve(K(4:9,4:9),-Fd(4:9,1)) + +//Sovling for heat at node 1 2 and 3 +F(1:3,1) = K(1:3,1:9)*T + +//Sovling for heat flow at node 1 2 and 3 +F1 = F(1,1) - f1(1,1) +F2 = F(2,1) -35.4168 +F3 = F(3,1)-f4(4,1) + +printf('\nResults\n') +printf('\nNode-Temperatures \nT1=%f◦F \nT2=%f◦F \nT3=%f◦F \nT4=%f◦F \nT5=%f◦F \nT6=%f◦F \nT7=%f◦F \nT8=%f◦F \nT9=%f◦F',T(1,1),T(2,1),T(3,1),T(4,1),T(5,1),T(6,1),T(7,1),T(8,1),T(9,1)) +printf('\nHeat flow at node-1 \nF1=%fBtu/hr',F1) +printf('\nHeat flow at node-2 \nF2=%fBtu/hr',F2) +printf('\nHeat flow at node-3 \nF3=%fBtu/hr',F3) diff --git a/3588/CH7/EX7.6/EX7_6.sav b/3588/CH7/EX7.6/EX7_6.sav Binary files differnew file mode 100644 index 000000000..bfa8c869c --- /dev/null +++ b/3588/CH7/EX7.6/EX7_6.sav diff --git a/3588/CH7/EX7.6/EX7_6.sce b/3588/CH7/EX7.6/EX7_6.sce new file mode 100644 index 000000000..e848eacd6 --- /dev/null +++ b/3588/CH7/EX7.6/EX7_6.sce @@ -0,0 +1,24 @@ +//Clearing console +clc +clear + +//Intializing variables +kx = 20 +ky = 20 +a = 0.5/12 +b = 0.5/12 +T =[180.000000;180.000000;180.000000;106.528061;111.987760;106.528061;89.057755;90.986763;89.057755] + +T2 = [T(4,1);T(7,1);T(8,1);T(5,1)] + +//Calculating the centroidal heat flux components for elements 2 and 3 +q2x = -(kx/(4*a))*(T2(2,1)-T2(1,1)+T2(3,1)-T2(4,1)) +q2y = -(ky/(4*b))*(T2(4,1)-T2(1,1)+T2(3,1)-T2(2,1)) + +//due to symmetry +q3x = q2x +q3y = -q2y + +printf('\nResults\n') +printf('\nHeat flux components for element 2 \nq2x=%fBtu/hr-ft 2 \nq2y=%fBtu/hr-ft^2',q2x,q2y) +printf('\nHeat flux components for element 3 \nq3x=%fBtu/hr-ft 2 \nq3y=%fBtu/hr-ft^2',q3x,q3y) diff --git a/3588/CH7/EX7.7/EX7_7.sav b/3588/CH7/EX7.7/EX7_7.sav Binary files differnew file mode 100644 index 000000000..bbe19a9ed --- /dev/null +++ b/3588/CH7/EX7.7/EX7_7.sav diff --git a/3588/CH7/EX7.7/EX7_7.sce b/3588/CH7/EX7.7/EX7_7.sce new file mode 100644 index 000000000..08d49fea8 --- /dev/null +++ b/3588/CH7/EX7.7/EX7_7.sce @@ -0,0 +1,26 @@ +//Clearing console +clc +clear + +//Intializing variables +h = 50 +a = 0.5/12 +b = 0.5/12 +t = 0.5/12 +Ta = 68 +A = 4*a*b +T =[180.000000;180.000000;180.000000;106.528061;111.987760;106.528061;89.057755;90.986763;89.057755] + +T3 = [T(5,1);T(8,1);T(9,1);T(6,1)] + +//convective heat flow rate for element 3 due to different surfaces +I1 = (2*h*A)*(((T3(1,1)+T3(2,1)+T3(3,1)+T3(4,1))/4)-Ta) +I2 = 2*h*t*b*(((T3(2,1)+T3(3,1))/2)-Ta) +I3 = 2*h*t*b*(((T3(3,1)+T3(4,1))/2)-Ta) + +//The total convective heat flow rate for element 3 +H = I1+I2+I3 + + +printf('\nResults\n') +printf('\nThe total convective heat flow rate for element 3\nH=%fBtu/hr',H) diff --git a/3588/CH7/EX7.9/EX7_9.sav b/3588/CH7/EX7.9/EX7_9.sav Binary files differnew file mode 100644 index 000000000..92c1b2a76 --- /dev/null +++ b/3588/CH7/EX7.9/EX7_9.sav diff --git a/3588/CH7/EX7.9/EX7_9.sce b/3588/CH7/EX7.9/EX7_9.sce new file mode 100644 index 000000000..8ce7692bb --- /dev/null +++ b/3588/CH7/EX7.9/EX7_9.sce @@ -0,0 +1,46 @@ +//Clearing console +clc +clear + +//Intializing Variables +d = 0.02 +L = 0.1 +k = 0.156 +c = 0.523 +h = 300 +m = 0.2*60 +Ta = 15 +T(1,1) = 50 + +//Calculating elemental conductance capcitance matrices +Kc = ((k*%pi*(d)^2)/(L))*[1 -1;-1 1] +Kh = (h*%pi*d*L/24)*[2 1;1 2] +Km = (m*c/2)*[-1 1;-1 1] + +//Calculating elemental stiffness matrice +K1 = Kc+Kh+Km + +//Calculating global stiffness matrice +K(1,1:5) = [K1(1,1:2) 0 0 0] +K(2,1:5) = [K1(2,1) K1(2,2)+K1(1,1) K1(1,2) 0 0] +K(3,1:5) = [0 K1(2,1) K1(2,2)+K1(1,1) K1(1,2) 0] +K(4,1:5) = [0 0 K1(2,1) K1(2,2)+K1(1,1) K1(1,2)] +K(5,1:5) = [0 0 0 K1(2,1) K1(2,2)] + + +f = (h*%pi*d*Ta*L/8)*[1;1] +F(2:5,1) = [f(1,1)+f(2,1);f(1,1)+f(2,1);f(1,1)+f(2,1);f(1,1)] + +Fd(2:5,1) = F(2:5,1)-K(2:5,1)*T(1,1) + +//Solving for Nodal temperatures +T(2:5,1)=linsolve(K(2:5,2:5),-Fd(2:5,1)) + +//Calculating qs +qm1 = m*c*T(1,1)*10 +qm5 = m*c*T(5,1)*10 + +printf('\nResults\n') +printf('\nNode-Temperatures \nT1=%fK \nT2=%fK \nT3=%fK \nT4=%fK \nT5=%fK',T(1,1),T(2,1),T(3,1),T(4,1),T(5,1)) +printf('\nHeat rate at node-1 \nq1=%fW',qm1) +printf('\nHeat rate at node-5 \nq5=%fW',qm5) diff --git a/3588/CH9/EX9.1/EX9_1.sav b/3588/CH9/EX9.1/EX9_1.sav Binary files differnew file mode 100644 index 000000000..3c1a674e6 --- /dev/null +++ b/3588/CH9/EX9.1/EX9_1.sav diff --git a/3588/CH9/EX9.1/EX9_1.sce b/3588/CH9/EX9.1/EX9_1.sce new file mode 100644 index 000000000..88c37414f --- /dev/null +++ b/3588/CH9/EX9.1/EX9_1.sce @@ -0,0 +1,38 @@ +//Clearing console +clc +clear + +//Intializing Variables +t = 0.2 +p1x = 0 +p1y = -100 +p2x = 150 +p2y = 0 + +//nodal force vector arising from the distributed loads in element 1 +k11 = integrate('1-x','x',0,1) +k12 = integrate('x','x',0,1) + +f1 = t*[k11 0;k12 0;0 0;0 k11;0 k12;0 0]*[p1x;p1y] + +//nodal force vector arising from the distributed loads in element 2 +k21 = integrate('(2-y)*y/2','y',0,2) +k22 = integrate('y*y/2','y',0,2) +k23 = integrate('(2-y)/2','y',0,2) +k24 = integrate('y/2','y',0,2) + +f2 = t*[0 0;k21 0;k22 0;0 k23;0 k24;0 0]*[p2x;p2y] + +//nodal force vector arising from the distributed loads +f = f1+f2 + +printf('\nResults\n') +printf('\nNodal force vector arising from the distributed loads for the element f(p) in (lb)') +printf('\nf1x =%flb',f(1)) +printf('\nf2x =%flb',f(2)) +printf('\nf3x =%flb',f(3)) +printf('\nf1y =%flb',f(4)) +printf('\nf2y =%flb',f(5)) +printf('\nf3y =%flb',f(6)) + + diff --git a/3588/CH9/EX9.2/EX9_2.sav b/3588/CH9/EX9.2/EX9_2.sav Binary files differnew file mode 100644 index 000000000..e597bc2dc --- /dev/null +++ b/3588/CH9/EX9.2/EX9_2.sav diff --git a/3588/CH9/EX9.2/EX9_2.sce b/3588/CH9/EX9.2/EX9_2.sce new file mode 100644 index 000000000..659f54494 --- /dev/null +++ b/3588/CH9/EX9.2/EX9_2.sce @@ -0,0 +1,25 @@ +//Clearing console +clc +clear + +//Intializing Variables +t = 0.2 +p = 7.4*(10^-4) +FBx = 0 +FBy = -386.4 + +//As the x component of the body force is zero, the x components of the nodal force vector will be zero +f1x = 0 +f2x = 0 +f3x = 0 + +//The y components of the nodal force vector +f1y = p*t*FBy*integrate('2*x*(1-x)','x',0,1) +f2y = p*t*FBy*integrate('2*x*(x)','x',0,1)/2 +f3y = p*t*FBy*integrate('2*x*(x)','x',0,1)/2 + +printf('\nResults\n') +printf('\nThe x components of the nodal force vector\nf1x=%flb \nf2x=%flb \nf3x=%flb',f1x,f2x,f3x) +printf('\nThe y components of the nodal force vector\nf1y=%flb \nf2y=%flb \nf3y=%flb',f1y,f2y,f3y) +printf('\nbody force is equally distributed to the element nodes') + diff --git a/3588/CH9/EX9.5/EX9_5.sav b/3588/CH9/EX9.5/EX9_5.sav Binary files differnew file mode 100644 index 000000000..6c85138fd --- /dev/null +++ b/3588/CH9/EX9.5/EX9_5.sav diff --git a/3588/CH9/EX9.5/EX9_5.sce b/3588/CH9/EX9.5/EX9_5.sce new file mode 100644 index 000000000..ada6a46e9 --- /dev/null +++ b/3588/CH9/EX9.5/EX9_5.sce @@ -0,0 +1,24 @@ +//Clearing console +clc +clear + +//Intializing Variables +P = 10 +r = 3 +z0 = 0 +z1 = 1 + +//As we have pressure on one face only and no axial pressure, we immediately observe that +fr2 = 0 +fz1 = 0 +fz2 = 0 +fz3 = 0 + +//Calculating fr1 and fr3 +fr1 = 2*%pi*P*r*[integrate('z','z',z0,z1)] +fr3 = 2*%pi*P*r*[integrate('1-z','z',z0,z1)] + +printf('\nResults\n') +printf('\nNodal Forces') +printf('\nfr1 =%flb fr2 =%flb fr3 =%flb',fr1,fr2,fr3) +printf('\nfz1 =%flb fz2 =%flb fz3 =%flb',fz1,fz2,fz3) |