Record_Mudinjuduchu_nu_Nenaikuran
Record_Mudinjuduchu_nu_Nenaikuran
Record_Mudinjuduchu_nu_Nenaikuran
ME STRUCTURAL ENGINEERING
Submitted by
I YEAR / II SEMESTER
ALAGAPPA CHETTIAR GOVERNMENT
COLLEGE OF ENGINEERING AND TECHNOLOGY
(An Autonomous Institution Affiliated to Anna University, Chennai)
Karaikudi - 630 003
INTERNALEXAMINER EXTERNALEXAMINER
INDEX
EXPRIMENT
DATE NAME OF THE EXPRIMENT SIGNATURE
NO.
for i = 1:100;
xh = (x1 + x2)/2;
if y(x1)*y(xh) < 0;
x2 = xh;
else
x1 = xh;
end
if abs(y(x1)) < e
break
end
end
fprintf('The root: %f \n The number of bisections: %d \n', x1,i);
PROGRAM INPUT
PROGRAM OUTPUT
syms x
f = input(‘Enter the function:’);
df = diff(f,x);
dfx = inline(df);
e = input(‘Enter the allowable error: ’);
x0 = input(‘Enter the initial guess:’);
n = 100;
if dfx(x0) ~= 0
for i=1:n
x1=x0-(f(x0)/dfx(x0));
fprintf('x%d=%.6f\n',i,x1)
if abs(x1-x0)<e
break
end
if dfx(x1)==0
disp('failed')
end
x0=x1;
end
else
disp('Newtons Raphson method Failed')
end
PROGRAM INPUT
PROGRAM OUTPUT
x1=0.200000
x2=-0.789091
x3=-1.293046
x4=-1.172211
x5=-1.159370
x6=-1.159237
x7=-1.159237
Ex. N0 : 3 MATLAB Program - Curve Fitting by Least Square Approximations.
MATLAB Program:
PROGRAM OUTPUT
PLOTTED GRAPH
Ex. N0 : 4 MATLAB program for solving the System of Linear equations
using Gauss-Elimination Method
MATLAB Program:
X
PROGRAM INPUT:
Enter your Co-efficient matrix: [33 56 12.7; 55.1 87 93; 22.7 18.3 9.81]
Enter your Source vector: [17
29
56]
PROGRAM OUTPUT:
Aug =
33.0000 56.0000 12.7000 17.0000
0 -6.5030 71.7948 0.6152
0 0 -222.1726 42.3932
-0.1908
Ex. N0 : 5 MATLAB program for solving the System of Linear equations
using Gauss Seidal Iteration Method
MATLAB Program:
PROGRAM OUTPUT
X=
1.9000
2.9000
3.5000
iteration no 2
X=
1.9000
2.9000
3.5000
iteration no 3
X=
1.9000
2.9000
3.5000
Ex. N0 : 6 MATLAB program for solving the System of Linear equations
using Gauss Jordan Method
MATLAB Program:
PROGRAM INPUT
Aug =
Aug =
Aug =
PROGRAM OUTPUT
I=1.292525
Ex. N0 : 8 MATLAB program Integrate numerically using Simpson’ rule.
MATLAB Program:
PROGRAM OUTPUT
The value of integration is 4.195460
Ex. N0 : 9 MATLAB program to find the numerical solution of Ordinary
Differential equation using Euler's Method.
MATLAB Program:
PROGRAM OUTPUT:
y(1.000000e-01) = -4.3000
y(2.000000e-01) = 4.9659
y(3.000000e-01) = -4.3325
y(4.000000e-01) = 4.9350
y(5.000000e-01) = -4.3619
y(6.000000e-01) = 4.9070
y(7.000000e-01) = -4.3884
y(8.000000e-01) = 4.8817
y(9.000000e-01) = -4.4125
y(1) = 4.8588
y(1.100000e+00) = -4.4343
y(1.200000e+00) = 4.8381
y(1.300000e+00) = -4.4540
y(1.400000e+00) = 4.8194
y(1.500000e+00) = -4.4718
y(1.600000e+00) = 4.8024
y(1.700000e+00) = -4.4879
y(1.800000e+00) = 4.7871
y(1.900000e+00) = -4.5025
y(2) = 4.7732
Ex.N0 :10 MATLAB program to find the numerical solution of Ordinary
Differential equation using Runge – Kutta Method.
MATLAB Program:
PROGRAM OUTPUT:
y(1.000000e-01) = 1.8914
y(2.000000e-01) = 0.8443
y(3.000000e-01) = 0.4848
y(4.000000e-01) = 0.3551
y(5.000000e-01) = 0.3024
y(6.000000e-01) = 0.2758
y(7.000000e-01) = 0.2585
y(8.000000e-01) = 0.2445
y(9.000000e-01) = 0.2322
y(1) = 0.2207
y(1.100000e+00) = 0.2099
y(1.200000e+00) = 0.1996
y(1.300000e+00) = 0.1899
y(1.400000e+00) = 0.1806
y(1.500000e+00) = 0.1718
y(1.600000e+00) = 0.1634
y(1.700000e+00) = 0.1555
y(1.800000e+00) = 0.1479
y(1.900000e+00) = 0.1407
y(2) = 0.1338