Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Tarea 1 Metodos Numericos
Tarea 1 Metodos Numericos
Tarea 1
1. Bisección: La suma de dos números es 20. Si cada uno se agrega a su raíz
cuadrada, el producto de las dos sumas es 155,55. Determine los dos números
con una exactitud de 10-4.
DESARROLLO EN MATLAB
This is the Bisection Method.
Input the function F(x) in terms of x
For example: cos(x)
((20-x)+(20-x)^(1/2))*(x+x^(1/2))-155.55
Input endpoints A < B on separate lines
5
10
Input tolerance
10^(-4)
Input maximum number of iterations - no decimal point
20
Select output destination
1. Screen
2. Text file
Enter 1 or 2
1
Select amount of output
1. Answer only
2. All intermediate approximations
Enter 1 or 2
2
Bisection Method
I P F(P)
1 7.50000000e+00 8.6316225e+00
2 6.25000000e+00 -2.7916316e+00
3 6.87500000e+00 3.5046467e+00
4 6.56250000e+00 5.0384069e-01
5 6.40625000e+00 -1.1068959e+00
6 6.48437500e+00 -2.9229948e-01
7 6.52343750e+00 1.0807501e-01
8 6.50390625e+00 -9.1535809e-02
9 6.51367188e+00 8.4136649e-03
10 6.50878906e+00 -4.1525051e-02
11 6.51123047e+00 -1.6546688e-02
12 6.51245117e+00 -4.0642605e-03
13 6.51306152e+00 2.1752649e-03
14 6.51275635e+00 -9.4435710e-04
15 6.51290894e+00 6.1548909e-04
16 6.51283264e+00 -1.6442521e-04
mg m2 g
−kt
m
s ( t ) =s o− t + 2 (1−e )
k k
pies lb−s
Donde g=32.17 2 y k representa el coeficiente de resistencia del aire en
s pies
lb−s
Suponga que so =300 pies y m=0.25 lbs y que k =0.1 . Calcule
pies
con una exactitud de 0.01 s, el tiempo que tarda este peso de cuarto de libra en
caer al suelo.
DESARROLLO EN MATLAB
This is the Fixed-Point Method.
Input the function G(x) in terms of x
For example: cos(x)
6.230183401-2.5*exp(-0.4*x)
Input initial approximation
1
Input tolerance
0.01
Input maximum number of iterations - no decimal point
20
Select output destination
1. Screen
2. Text file
Enter 1 or 2
1
Select amount of output
1. Answer only
2. All intermediate approximations
Enter 1 or 2
2
FIXED-POINT METHOD
I P
1 4.55438329e+00
2 5.82582861e+00
3 5.98702464e+00
4 6.00220836e+00
5 6.00358877e+00
DESARROLLO EN MATLAB
This is Newtons Method
Input the function F(x) in terms of x
For example: cos(x)
-(32.17/(2*x^2))*(((exp(x)-exp(-x))/2)-sin(x))-1.7 (Esta ecuación resulta de la suposición del enunciado)
DESARROLLO EN MATLAB
This is Mullers Method.
Input the Polynomial P(x)
For example: to input x^3-2*x+4 enter
[ 1 0 -2 4 ]
[1 -16 -500 8000 -32000]
Input tolerance
0.0001
Input maximum number of iterations - no decimal point
10
Input the first of three starting values
16
Input the second of three starting values
18
Input the third starting value
20
Select output destination
1. Screen
2. Text file
Enter 1 or 2
1
MULLERS METHOD
The output is i, approximation x(i), f(x(i))
Method Succeeds
Approximation is within 1.0000000000e-04
in 8 iterations
x 3
DESARROLLO EN MATLAB APROXIMANDO CON FUNCIÓN f (x)=e A √ e
0.10000000 1.10517092
0.20000000 0.76472449
0.30000000 0.81818882 1.40395068
0.40000000 0.85837422 1.25846501 0.53422831
0.50000000 0.89089872 1.18219217 0.84063766 1.75538441
0.60000000 0.91838590 1.13707735 0.95760780 1.26781745 0.29803161
0.70000000 0.94228658 1.10854268 1.00929729 1.12915015 0.88800341 1.70878683
0.80000000 0.96349248 1.08979747 1.03397310 1.08296381 1.01419093 1.16450864 0.62421054
Utilice diferencias divididas para aproximar la población en los años 1945, 1965y 1985.
DESARROLLO EN MATLAB
Newtons form of the interpolation polynomial
Choice of input method:
1. Input entry by entry from keyboard
2. Input data from a text file
3. Generate data using a function F
Choose 1, 2, or 3 please
1
Input n
5
Input X(0) and F(X(0)) on separate lines
1930
157326
Input X(1) and F(X(1)) on separate lines
1940
179323
Input X(2) and F(X(2)) on separate lines
1950
207892
Input X(3) and F(X(3)) on separate lines
1960
226500
Input X(4) and F(X(4)) on separate lines
1970
249003
Input X(5) and F(X(5)) on separate lines
1980
281522
Select output destination
1. Screen
2. Text file
Enter 1 or 2
1
NEWTONS INTERPOLATION POLYNOMIAL
p ( x ) =157326+2199.7 ( x−1930 ) +32.86 ( x−1930 ) ( x−1940 )−2.7555 ( x−1930 ) ( x−1940 ) ( x−1950 ) +0.12662083
Para determinar la población en los años 1945, 1965 y 1985, se reemplaza x por
cada uno de estos valores para obtener así:
X =1945 p ( x)=194978.3203
X =1965 p ( x)=236254.0076
X =1985 p ( x)=291953.1881
Tiempo (s) 0 3 5 8 13
Distancia (mi) 0 225 383 623 993
Velocidad (mi/s) 75 77 80 74 72
DESARROLLO EN MATLAB
This is Hermite interpolation.
Choice of input method:
1. Input entry by entry from keyboard
2. Input data from a text file
3. Generate data using a function F
Choose 1, 2, or 3 please
1
Input the number of data points minus 1
4
Input X(0), F(X(0)), and F'(X(0)) on separate lines
0
0
75
Input X(1), F(X(1)), and F'(X(1)) on separate lines
3
225
77
Input X(2), F(X(2)), and F'(X(2)) on separate lines
5
383
80
Input X(3), F(X(3)), and F'(X(3)) on separate lines
8
623
74
Input X(4), F(X(4)), and F'(X(4)) on separate lines
13
993
72
Choice of output method:
1. Output to screen
2. Output to text file
Please enter 1 or 2
1
HERMITE INTERPOLATING POLYNOMIAL
0.0000000000e+00
7.5000000000e+01
0.0000000000e+00
2.2222222222e-01
-3.1111111111e-02
-6.4444444444e-03
2.2638888889e-03
-9.1319444444e-04
1.3052679158e-04
-2.0223631973e-05
Do you wish to evaluate this polynomial?
Enter Y or N
Y
Enter a point at which to evaluate
10
x-value and interpolated-value
1.0000000000e+01 7.4250283910e+02
ERROR (Index in position 2 is invalid. Array indices must be positive integers or logical values)