summaryrefslogtreecommitdiff
path: root/3588/CH6
diff options
context:
space:
mode:
Diffstat (limited to '3588/CH6')
-rw-r--r--3588/CH6/EX6.1/EX6_1.savbin0 -> 25944 bytes
-rw-r--r--3588/CH6/EX6.1/EX6_1.sce28
-rw-r--r--3588/CH6/EX6.10/EX6_10.savbin0 -> 20360 bytes
-rw-r--r--3588/CH6/EX6.10/EX6_10.sce56
-rw-r--r--3588/CH6/EX6.3/EX6_3.savbin0 -> 28248 bytes
-rw-r--r--3588/CH6/EX6.3/EX6_3.sce32
-rw-r--r--3588/CH6/EX6.7/EX6_7.savbin0 -> 23488 bytes
-rw-r--r--3588/CH6/EX6.7/EX6_7.sce13
-rw-r--r--3588/CH6/EX6.8/EX6_8.savbin0 -> 18128 bytes
-rw-r--r--3588/CH6/EX6.8/EX6_8.sce23
-rw-r--r--3588/CH6/EX6.9/EX6_9.savbin0 -> 18672 bytes
-rw-r--r--3588/CH6/EX6.9/EX6_9.sce30
12 files changed, 182 insertions, 0 deletions
diff --git a/3588/CH6/EX6.1/EX6_1.sav b/3588/CH6/EX6.1/EX6_1.sav
new file mode 100644
index 000000000..e151f00fd
--- /dev/null
+++ b/3588/CH6/EX6.1/EX6_1.sav
Binary files differ
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
new file mode 100644
index 000000000..f6be677b5
--- /dev/null
+++ b/3588/CH6/EX6.10/EX6_10.sav
Binary files differ
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
new file mode 100644
index 000000000..8469ef271
--- /dev/null
+++ b/3588/CH6/EX6.3/EX6_3.sav
Binary files differ
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
new file mode 100644
index 000000000..db8306be9
--- /dev/null
+++ b/3588/CH6/EX6.7/EX6_7.sav
Binary files differ
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
new file mode 100644
index 000000000..12285c74f
--- /dev/null
+++ b/3588/CH6/EX6.8/EX6_8.sav
Binary files differ
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
new file mode 100644
index 000000000..d41de5738
--- /dev/null
+++ b/3588/CH6/EX6.9/EX6_9.sav
Binary files differ
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)