Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Anlisis Numrico I
Cuarto Semestre
Actividades
Unidad 1. Fundamentos
Clave
05142424/06142424
La tarea es crear una funcin en Octave que recibe dos parmetros y regresa un escalar que
representar la altura del proyectil en cada tiempo . Debers mostrar la trayectoria
seguida para las siguientes valores de y vectores
V Vectores de T
10 (0,10,100)
25 (0,20,250)
100 (0,50,300)
Para definir la serie de valores donde aplicars tu funcin, es decir, todos los valores tienes
que hacer uso de la funcin linspace de la siguiente manera
>>> t = linspace(0,10,100)
Que quiere decir que es un vector con valores reales entre 0 y 10 con 100 puntos distribuidos
equidistantemente
Recuerda por cada funcin debes crear un archivo que se llame igual que la funcin pero con
extensin .m y en una carpeta de tu eleccin.
Tip: Para definir una funcin, llamada funcX, de n parmetros en Octave la sintaxis es la
siguiente
function y = funcX(n1,n2,,nk)
function y = funcX(x,y)
>>> Z = X*.Y
El operador punto (.) le indica a Octave que tiene que multiplicar el elemento i-simo de X por
el elemento i-simo de Y y construir al mismo tiempo el vector Z de tal forma que
Si tenemos la funcin funcM que es una funcin que recibe un solo parmetro y regresa un
escalar, entonces podemos aplicarla a todo el vector X de la siguiente forma
Z = funcM(X)
La tarea es crear una funcin en Octave que recibe dos parmetros y regresa un escalar que
representar la altura del proyectil en cada tiempo . Debers mostrar la trayectoria
seguida para las siguientes valores de y vectores
function y=parabolico(v);
g=9.8;
x= 10;
y=v*x+((1/2)*-g*x.^2);
endfunction
>>> v=10;
>>> g=9.8;
>>> t=(0);
>>> h=v*t+((1/2)*-g*t^2);
>>> h=v*t+((1/2)*-g*t^2)
h=0
>>> v=10;
>>> g=9.8;
>>> t=(10);
>>> h=v*t+((1/2)*-g*t^2)
h = -390.00
>>> v=25;
>>> t=(0);
>>> g=9.8;
>>> h=v*t+((1/2)*-g*t^2)
h=0
>>> v=25;
>>> t=(20);
>>> g=9.8;
>>> h=v*t+((1/2)*-g*t^2)
h = -1460.0
>>> v=100;
>>> t=(0);
>>> g=9.8;
>>> h=v*t+((1/2)*-g*t^2)
h=0
>>> v=100;
>>> t=(50);
>>> g=9.8;
>>> h=v*t+((1/2)*-g*t^2)
h = -7250
>>> y=parabolico(10)
y = -390.00
y = -390.00
>>> y=parabolico(10)
y = Columns 1 through 6:
0.00000 0.96011 1.82022 2.58035 3.24049 3.80063
Columns 7 through 12:
4.26079 4.62096 4.88113 5.04132 5.10152 5.06173
Columns 13 through 18:
4.92195 4.68218 4.34241 3.90266 3.36292 2.72319
Columns 19 through 24:
1.98347 1.14376 0.20406 -0.83563 -1.97531 -3.21498
Columns 25 through 30:
-4.55464 -5.99429 -7.53393 -9.17355 -10.91317 -12.75278
Columns 31 through 36:
-14.69238 -16.73197 -18.87154 -21.11111 -23.45067 -25.89022
Columns 37 through 42:
-28.42975 -31.06928 -33.80880 -36.64830 -39.58780 -42.62728
Columns 43 through 48:
-45.76676 -49.00622 -52.34568 -55.78512 -59.32456 -62.96398
Columns 49 through 54:
-66.70340 -70.54280 -74.48220 -78.52158 -82.66095 -86.90032
Columns 55 through 60:
-91.23967 -95.67901 -100.21835 -104.85767 -109.59698 -114.43628
Columns 61 through 66:
-119.37557 -124.41486 -129.55413 -134.79339 -140.13264 -145.57188
Columns 67 through 72:
-151.11111 -156.75033 -162.48954 -168.32874 -174.26793 -180.30711
Columns 73 through 78:
-186.44628 -192.68544 -199.02459 -205.46373 -212.00286 -218.64198
Columns 79 through 84:
-225.38108 -232.22018 -239.15927 -246.19835 -253.33741 -260.57647
Columns 85 through 90:
-267.91552 -275.35456 -282.89358 -290.53260 -298.27160 -306.11060
Columns 91 through 96:
-314.04959 -322.08856 -330.22753 -338.46648 -346.80543 -355.24436
Columns 97 through 100:
-363.78329 -372.42220 -381.16111 -390.00000
>>> y=parabolico(0)
y=
Columns 1 through 6:
0.00000 -0.04999 -0.19998 -0.44995 -0.79992 -1.24987
Columns 7 through 12:
-1.79982 -2.44975 -3.19967 -4.04959 -4.99949 -6.04938
Columns 13 through 18:
-7.19927 -8.44914 -9.79900 -11.24885 -12.79869 -14.44853
Columns 19 through 24:
-16.19835 -18.04816 -19.99796 -22.04775 -24.19753 -26.44730
Columns 25 through 30:
-28.79706 -31.24681 -33.79655 -36.44628 -39.19600 -42.0457
Columns 31 through 36:
-44.99541 -48.04510 -51.19478 -54.44444 -57.79410 -61.24375
Columns 37 through 42:
-64.79339 -68.44302 -72.19263 -76.04224 -79.99184 -84.04142
Columns 43 through 48:
-88.19100 -92.44057 -96.79012 -101.23967 -105.78921 -110.43873
Columns 49 through 54:
-115.18825 -120.03775 -124.98725 -130.03673 -135.18621 -140.43567
Columns 55 through 60:
-145.78512 -151.23457 -156.78400 -162.43343 -168.18284 -174.03224
Columns 61 through 66:
-179.98163 -186.03102 -192.18039 -198.42975 -204.77910 -211.22845
Columns 67 through 72:
-217.77778 -224.42710 -231.17641 -238.02571 -244.97500 -252.02428
Columns 73 through 78:
-259.17355 -266.42281 -273.77206 -281.22130 -288.77053 -296.41975
Columns 79 through 84:
-304.16896 -312.01816 -319.96735 -328.01653 -336.16570 -344.41486
Columns 85 through 90:
-352.76400 -361.21314 -369.76227 -378.41139 -387.16049 -396.00959
Columns 91 through 96:
-404.95868 -414.00775 -423.15682 -432.40588 -441.75492 -451.20396
Columns 97 through 100:
-460.75298 -470.40200 -480.15100 -490.00000
>>> y=parabolico(100)
y=
Columns 1 through 6:
0.00000 10.05102 20.00204 29.85308 39.60412 49.25518
Columns 7 through 12: