Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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
𝑚𝑔 𝑚2 𝑔 −𝑘𝑡
𝑠(𝑡) = 𝑠𝑜 − 𝑡 + 2 (1 − 𝑒 𝑚 )
𝑘 𝑘
𝑝𝑖𝑒𝑠 𝑙𝑏−𝑠
Donde 𝑔 = 32.17 y 𝑘 representa el coeficiente de resistencia del aire en
𝑠2 𝑝𝑖𝑒𝑠
𝑙𝑏−𝑠
Suponga que 𝑠𝑜 = 300 𝑝𝑖𝑒𝑠 y 𝑚 = 0.25 𝑙𝑏𝑠 y que 𝑘 = 0.1 . Calcule
𝑝𝑖𝑒𝑠
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
3
DESARROLLO EN MATLAB APROXIMANDO CON FUNCIÓN 𝑓(𝑥) = 𝑒 𝑥 A √𝑒
This is Nevilles Method.
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
7
Input X(0) and F(X(0)) on separate lines.
0.1
1.105170918
Input X(1) and F(X(1)) on separate lines.
0.2
1.221402758
Input X(2) and F(X(2)) on separate lines.
0.3
1.349858808
Input X(3) and F(X(3)) on separate lines.
0.4
1.491824698
Input X(4) and F(X(4)) on separate lines.
0.5
1.648721271
Input X(5) and F(X(5)) on separate lines.
0.6
1.8221188
Input X(6) and F(X(6)) on separate lines.
0.7
2.013752707
Input X(7) and F(X(7)) on separate lines.
0.8
2.225540928
Input point at which the polynomial is to be evaluated
1.395612425
Select output destination
1. Screen
2. Text file
Enter 1 or 2
1
NEVILLES METHOD
Table for P evaluated at X = 1.39561242 , follows:
Entries are XX(I), Q(I,0), ..., Q(I,I) for each I = 0, ..., N where N = 7
0.10000000 1.10517092
0.20000000 1.22140276 2.61108508
0.30000000 1.34985881 2.75723925 3.55788090
0.40000000 1.49182470 2.90525474 3.64208502 3.92153393
0.50000000 1.64872127 3.05390647 3.71957818 3.95092429 4.01673022
0.60000000 1.82211880 3.20169109 3.78958745 3.97525495 4.02364939 4.03465936
0.70000000 2.01375271 3.34678197 3.85141710 3.99478200 4.02874015 4.03582254 4.03717109
0.80000000 2.22554093 3.48697789 3.90449002 4.00985966 4.03231077 4.03656417 4.03730037 4.03741038
3
RESPUESTA: El valor aproximado para √𝑒 es 4.03741038
6 3
DESARROLLO EN MATLAB APROXIMANDO CON FUNCIÓN 𝑓(𝑥) = √𝑥 A √𝑒 SE DESCARTA EL
PRIMER VALOR DE 0.1, TOMANDO 𝒏 = 𝟔 COMO LO INDICA EL ENUNCIADO
This is Nevilles Method.
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
6
Input X(0) and F(X(0)) on separate lines.
0.2
0.7647244913
Input X(1) and F(X(1)) on separate lines.
0.3
0.818188823
Input X(2) and F(X(2)) on separate lines.
0.4
0.8583742189
Input X(3) and F(X(3)) on separate lines.
0.5
0.8908987181
Input X(4) and F(X(4)) on separate lines.
0.6
0.9183859022
Input X(5) and F(X(5)) on separate lines.
0.7
0.9422865815
Input X(6) and F(X(6)) on separate lines.
0.8
0.963492484
Input point at which the polynomial is to be evaluated
1.395612425
Select output destination
1. Screen
2. Text file
Enter 1 or 2
1
NEVILLES METHOD
Table for P evaluated at X = 1.39561242 , follows:
Entries are XX(I), Q(I,0), ..., Q(I,I) for each I = 0, ..., N where N = 6
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
3 6
RESPUESTA: El valor aproximado para √𝑒 es 0.62421054 con 𝑓(𝑥) = √𝑥
6. DIFERENCIAS DIVIDIDAS: La tabla siguiente contiene la población de Estados
Unidos en ciertos años desde 1930 a 1980.
Año 1930 1940 1950 1960 1970 1980
Población 157326 179323 207892 226500 249003 281522
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
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)