Está en la página 1de 4

Licenciatura en Matemticas.

Universidad Abierta y a Distancia


Analisis Numerico I
Unidad 1. Actividad 2. Modelacin matemtica
Rodrigo Galindo Murillo
La ecuacin que describe el tiro parablico desde el origen es:
( )
donde

es la velocidad inicial del cuerpo proyectado.

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 t. Debers mostrar la trayectoria h(t) seguida para las siguientes valores de
v y vectores t.
Se har la iteracin de valores utilizando 100 ciclos. Se define la funcin inicial:
function y=parabolico(v);
g=9.8;
x= 10;
y=v*x+((1/2)*-g*x.^2);
endfunction
Verificamos los datos que arroja la funcin parabolico(v):
>>>
>>>
>>>
>>>
>>>
h =
>>>
>>>
>>>
>>>
h =
>>>
>>>
>>>
>>>
h =
>>>
>>>
>>>
>>>
h =
>>>
>>>
>>>
>>>

v=10;
g=9.8;
t=(0);
h=v*t+((1/2)*-g*t^2);
h=v*t+((1/2)*-g*t^2)
0
v=10;
g=9.8;
t=(10);
h=v*t+((1/2)*-g*t^2)
-390.00
v=25;
t=(0);
g=9.8;
h=v*t+((1/2)*-g*t^2)
0
v=25;
t=(20);
g=9.8;
h=v*t+((1/2)*-g*t^2)
-1460.0
v=100;
t=(0);
g=9.8;
h=v*t+((1/2)*-g*t^2)

h =
>>>
>>>
>>>
>>>
h =
>>>
y =
y =

0
v=100;
t=(50);
g=9.8;
h=v*t+((1/2)*-g*t^2)
-7250
y=parabolico(10)
-390.00
-390.00

Incluimos la funcin reservada linspace:


function y=parabolico(v);%Velocidad inicial
g=9.8;% Gravedad
x=linspace(0,10,100);% Tiempo
y=v*x+((1/2)*-g*x.^2);% Expresin
endfunction
>>> 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.04571
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:
58.80624 68.25732 77.60841 86.85950 96.01061 105.06173
Columns 13 through 18:
114.01286 122.86399 131.61514 140.26630 148.81747 157.26865
Columns 19 through 24:
165.61983 173.87103 182.02224 190.07346 198.02469 205.87593
Columns 25 through 30:
213.62718 221.27844 228.82971 236.28099 243.63228 250.88358

Columns 31 through 36:


258.03489 265.08622 272.03755
Columns 37 through 42:
298.84298 305.29436 311.64575
Columns 43 through 48:
336.05142 341.90287 347.65432
Columns 49 through 54:
369.66024 374.91174 380.06326
Columns 55 through 60:
399.66942 404.32099 408.87256
Columns 61 through 66:
426.07897 430.13060 434.08224
Columns 67 through 72:
448.88889 452.34058 455.69228
Columns 73 through 78:
468.09917 470.95092 473.70268
Columns 79 through 84:
483.70983 485.96164 488.11346
Columns 85 through 90:
495.72084 497.37272 498.92460
Columns 91 through 96:
504.13223 505.18416 506.13611
Columns 97 through 100:
508.94399 509.39598 509.74798

278.88889 285.64024 292.29160


317.89715 324.04857 330.09999
353.30579 358.85726 364.30874
385.11478 390.06632 394.91787
413.32415 417.67575 421.92735
437.93388 441.68554 445.33721
458.94399 462.09570 465.14743
476.35445 478.90623 481.35802
490.16529 492.11713 493.96898
500.37649 501.72840 502.98031
506.98806 507.74003 508.39200
510.0000

También podría gustarte