Está en la página 1de 9

Datos:

1.Condiciones iniciales:

ti = 0.0 ! initial value for variable t

v0 = 50.0 ! initial speed (m/s)

a0 = 30.0 ! initial angle (degrees)

xi(1) = 0.0 ! initial position in x (m)

xi(2) = 10.0 ! initial position in y (m

t x y dx/dt dy/dt energía


0.00E+00 0.00E+00 1.00E+01 4.33E+01 2.50E+01 1.35E+03
2.00E-01 8.66E+00 1.48E+01 4.33E+01 2.30E+01 1.35E+03
4.00E-01 1.73E+01 1.92E+01 4.33E+01 2.11E+01 1.35E+03
6.00E-01 2.60E+01 2.32E+01 4.33E+01 1.91E+01 1.35E+03
8.00E-01 3.46E+01 2.69E+01 4.33E+01 1.72E+01 1.35E+03
1.00E+00 4.33E+01 3.01E+01 4.33E+01 1.52E+01 1.35E+03
1.20E+00 5.20E+01 3.29E+01 4.33E+01 1.32E+01 1.35E+03
1.40E+00 6.06E+01 3.54E+01 4.33E+01 1.13E+01 1.35E+03
1.60E+00 6.93E+01 3.74E+01 4.33E+01 9.30E+00 1.35E+03
1.80E+00 7.79E+01 3.91E+01 4.33E+01 7.34E+00 1.35E+03
2.00E+00 8.66E+01 4.04E+01 4.33E+01 5.38E+00 1.35E+03
2.20E+00 9.53E+01 4.13E+01 4.33E+01 3.42E+00 1.35E+03
2.40E+00 1.04E+02 4.18E+01 4.33E+01 1.46E+00 1.35E+03
2.60E+00 1.13E+02 4.18E+01 4.33E+01 -5.06E-01 1.35E+03
2.80E+00 1.21E+02 4.15E+01 4.33E+01 -2.47E+00 1.35E+03
3.00E+00 1.30E+02 4.09E+01 4.33E+01 -4.43E+00 1.35E+03
3.20E+00 1.39E+02 3.98E+01 4.33E+01 -6.39E+00 1.35E+03
3.40E+00 1.47E+02 3.83E+01 4.33E+01 -8.35E+00 1.35E+03
3.60E+00 1.56E+02 3.64E+01 4.33E+01 -1.03E+01 1.35E+03
3.80E+00 1.65E+02 3.42E+01 4.33E+01 -1.23E+01 1.35E+03
4.00E+00 1.73E+02 3.15E+01 4.33E+01 -1.42E+01 1.35E+03
4.20E+00 1.82E+02 2.85E+01 4.33E+01 -1.62E+01 1.35E+03
4.40E+00 1.91E+02 2.50E+01 4.33E+01 -1.82E+01 1.35E+03
4.60E+00 1.99E+02 2.12E+01 4.33E+01 -2.01E+01 1.35E+03
4.80E+00 2.08E+02 1.70E+01 4.33E+01 -2.21E+01 1.35E+03
5.00E+00 2.17E+02 1.24E+01 4.33E+01 -2.41E+01 1.35E+03
5.20E+00 2.25E+02 7.37E+00 4.33E+01 -2.60E+01 1.35E+03
5.40E+00 2.34E+02 1.97E+00 4.33E+01 -2.80E+01 1.35E+03
5.60E+00 2.43E+02 -3.82E+00 4.33E+01 -2.99E+01 1.35E+03
2. Condiciones iniciales:

ti = 0.0 ! initial value for variable t

v0 = 100.0 ! initial speed (m/s)

a0 = 45.0 ! initial angle (degrees)

xi(1) = 0.0 ! initial position in x (m)

xi(2) = 0.0 ! initial position in y (m)

t x y dx/dt dy/dt energнa


0.00E+00 0.00E+00 0.00E+00 7.07E+01 7.07E+01 5.00E+03
2.00E-01 1.41E+01 1.40E+01 7.07E+01 6.88E+01 5.00E+03
4.00E-01 2.83E+01 2.75E+01 7.07E+01 6.68E+01 5.00E+03
6.00E-01 4.24E+01 4.07E+01 7.07E+01 6.48E+01 5.00E+03
8.00E-01 5.66E+01 5.34E+01 7.07E+01 6.29E+01 5.00E+03
1.00E+00 7.07E+01 6.58E+01 7.07E+01 6.09E+01 5.00E+03
1.20E+00 8.49E+01 7.78E+01 7.07E+01 5.89E+01 5.00E+03
1.40E+00 9.90E+01 8.94E+01 7.07E+01 5.70E+01 5.00E+03
1.60E+00 1.13E+02 1.01E+02 7.07E+01 5.50E+01 5.00E+03
1.80E+00 1.27E+02 1.11E+02 7.07E+01 5.31E+01 5.00E+03
2.00E+00 1.41E+02 1.22E+02 7.07E+01 5.11E+01 5.00E+03
2.20E+00 1.56E+02 1.32E+02 7.07E+01 4.91E+01 5.00E+03
2.40E+00 1.70E+02 1.42E+02 7.07E+01 4.72E+01 5.00E+03
2.60E+00 1.84E+02 1.51E+02 7.07E+01 4.52E+01 5.00E+03
2.80E+00 1.98E+02 1.60E+02 7.07E+01 4.32E+01 5.00E+03
3.00E+00 2.12E+02 1.68E+02 7.07E+01 4.13E+01 5.00E+03
3.20E+00 2.26E+02 1.76E+02 7.07E+01 3.93E+01 5.00E+03
3.40E+00 2.40E+02 1.84E+02 7.07E+01 3.74E+01 5.00E+03
3.60E+00 2.55E+02 1.91E+02 7.07E+01 3.54E+01 5.00E+03
3.80E+00 2.69E+02 1.98E+02 7.07E+01 3.34E+01 5.00E+03
4.00E+00 2.83E+02 2.04E+02 7.07E+01 3.15E+01 5.00E+03
4.20E+00 2.97E+02 2.11E+02 7.07E+01 2.95E+01 5.00E+03
4.40E+00 3.11E+02 2.16E+02 7.07E+01 2.76E+01 5.00E+03
4.60E+00 3.25E+02 2.22E+02 7.07E+01 2.56E+01 5.00E+03
4.80E+00 3.39E+02 2.26E+02 7.07E+01 2.36E+01 5.00E+03
5.00E+00 3.54E+02 2.31E+02 7.07E+01 2.17E+01 5.00E+03
5.20E+00 3.68E+02 2.35E+02 7.07E+01 1.97E+01 5.00E+03
5.40E+00 3.82E+02 2.39E+02 7.07E+01 1.77E+01 5.00E+03
5.60E+00 3.96E+02 2.42E+02 7.07E+01 1.58E+01 5.00E+03
5.80E+00 4.10E+02 2.45E+02 7.07E+01 1.38E+01 5.00E+03
6.00E+00 4.24E+02 2.48E+02 7.07E+01 1.19E+01 5.00E+03
6.20E+00 4.38E+02 2.50E+02 7.07E+01 9.89E+00 5.00E+03
6.40E+00 4.53E+02 2.52E+02 7.07E+01 7.93E+00 5.00E+03
6.60E+00 4.67E+02 2.53E+02 7.07E+01 5.97E+00 5.00E+03
6.80E+00 4.81E+02 2.54E+02 7.07E+01 4.00E+00 5.00E+03
7.00E+00 4.95E+02 2.55E+02 7.07E+01 2.04E+00 5.00E+03
7.20E+00 5.09E+02 2.55E+02 7.07E+01 7.87E-02 5.00E+03
7.40E+00 5.23E+02 2.55E+02 7.07E+01 -1.88E+00 5.00E+03
7.60E+00 5.37E+02 2.54E+02 7.07E+01 -3.85E+00 5.00E+03
7.80E+00 5.52E+02 2.53E+02 7.07E+01 -5.81E+00 5.00E+03
8.00E+00 5.66E+02 2.52E+02 7.07E+01 -7.77E+00 5.00E+03
8.20E+00 5.80E+02 2.50E+02 7.07E+01 -9.73E+00 5.00E+03
8.40E+00 5.94E+02 2.48E+02 7.07E+01 -1.17E+01 5.00E+03
8.60E+00 6.08E+02 2.45E+02 7.07E+01 -1.37E+01 5.00E+03
8.80E+00 6.22E+02 2.42E+02 7.07E+01 -1.56E+01 5.00E+03
9.00E+00 6.36E+02 2.39E+02 7.07E+01 -1.76E+01 5.00E+03
9.20E+00 6.51E+02 2.35E+02 7.07E+01 -1.95E+01 5.00E+03
9.40E+00 6.65E+02 2.31E+02 7.07E+01 -2.15E+01 5.00E+03
9.60E+00 6.79E+02 2.27E+02 7.07E+01 -2.35E+01 5.00E+03
9.80E+00 6.93E+02 2.22E+02 7.07E+01 -2.54E+01 5.00E+03
1.00E+01 7.07E+02 2.17E+02 7.07E+01 -2.74E+01 5.00E+03
1.02E+01 7.21E+02 2.11E+02 7.07E+01 -2.94E+01 5.00E+03
1.04E+01 7.35E+02 2.05E+02 7.07E+01 -3.13E+01 5.00E+03
1.06E+01 7.50E+02 1.98E+02 7.07E+01 -3.33E+01 5.00E+03
1.08E+01 7.64E+02 1.92E+02 7.07E+01 -3.52E+01 5.00E+03
1.10E+01 7.78E+02 1.84E+02 7.07E+01 -3.72E+01 5.00E+03
1.12E+01 7.92E+02 1.77E+02 7.07E+01 -3.92E+01 5.00E+03
1.14E+01 8.06E+02 1.69E+02 7.07E+01 -4.11E+01 5.00E+03
1.16E+01 8.20E+02 1.60E+02 7.07E+01 -4.31E+01 5.00E+03
1.18E+01 8.34E+02 1.51E+02 7.07E+01 -4.51E+01 5.00E+03
1.20E+01 8.49E+02 1.42E+02 7.07E+01 -4.70E+01 5.00E+03
1.22E+01 8.63E+02 1.33E+02 7.07E+01 -4.90E+01 5.00E+03
1.24E+01 8.77E+02 1.23E+02 7.07E+01 -5.09E+01 5.00E+03
1.26E+01 8.91E+02 1.12E+02 7.07E+01 -5.29E+01 5.00E+03
1.28E+01 9.05E+02 1.02E+02 7.07E+01 -5.49E+01 5.00E+03
1.30E+01 9.19E+02 9.03E+01 7.07E+01 -5.68E+01 5.00E+03
1.32E+01 9.33E+02 7.87E+01 7.07E+01 -5.88E+01 5.00E+03
1.34E+01 9.48E+02 6.68E+01 7.07E+01 -6.07E+01 5.00E+03
1.36E+01 9.62E+02 5.44E+01 7.07E+01 -6.27E+01 5.00E+03
1.38E+01 9.76E+02 4.17E+01 7.07E+01 -6.47E+01 5.00E+03
1.40E+01 9.90E+02 2.86E+01 7.07E+01 -6.66E+01 5.00E+03
1.42E+01 1.00E+03 1.51E+01 7.07E+01 -6.86E+01 5.00E+03
1.44E+01 1.02E+03 1.13E+00 7.07E+01 -7.06E+01 5.00E+03
1.46E+01 1.03E+03 -1.32E+01 7.07E+01 -7.25E+01 5.00E+03

Análisis y Resultados:

1.Para las condiciones iniciales:

ti = 0.0 ! initial value for variable t

v0 = 100.0 ! initial speed (m/s)

a0 = 45.0 ! initial angle (degrees)

xi(1) = 0.0 ! initial position in x (m)

xi(2) = 0.0 ! initial position in y (m)


2. Para las condiciones:

ti = 0.0 ! initial value for variable t

v0 = 50.0 ! initial speed (m/s)

a0 = 30.0 ! initial angle (degrees)

xi(1) = 0.0 ! initial position in x (m)

xi(2) = 10.0 ! initial position in y (m


Discusión:

Cuestionario:

2. implicit none

call projectile

end program proyectil

subroutine projectile

implicit none
integer, parameter:: n=4 ! number of first-order equations
double precision ti, tf, dt, tmax
double precision xi(n), xf(n)
double precision v0, a0, energy0, energy
double precision, parameter :: rad = 3.1415926/180.0 ! radians
double precision, parameter :: g = 9.81 ! m/s**2
integer i
external d2x

! open file for writing results


open (unit=6, file='projectile.dat')

!*** initial data


ti = 0.0 ! initial value for variable t
v0 = 100.0 ! initial speed (m/s)
a0 = 45.0 ! initial angle (degrees)
xi(1) = 0.0 ! initial position in x (m)
xi(2) = 0.0 ! initial position in y (m)
!*** the itegration limit and step
dt = 0.2 ! step size for integration (s)
tmax = 60.0 ! integrate till tmax (s)
!*** end of initial data

xi(3) = v0*cos(a0*rad) ! initial speed in x direction (m/s)


xi(4) = v0*sin(a0*rad) ! initial speed in y direction (m/s)
energy0 = (xi(3)**2+xi(4)**2)/2+g*xi(2)

!* print the header and initial conditions


write (6,*) ' Projectile motion in the (x,y) plane '
write (6,*) ' Method: Runge-Kutta 4th order '
write (6,100)
write (6,102) ti, xi(1), xi(2), xi(3), xi(4), energy0

! integration of ODEs
do while (ti <= tmax)
tf = ti + dt

call rk4n(d2x,ti, tf, xi, xf, n)

energy = (xf(3)**2+xf(4)**2)/2+g*xf(2)

write(6,102) tf, xf(1), xf(2), xf(3), xf(4), energy


if (xf(2) <= 0.0) exit ! the projectile is under the ground
! prepare for the next step
ti = tf
do i = 1,n
xi(i) = xf(i)
end do
end do

100 format(5x,'t',11x,'x',11x,'y',11x,'dx/dt',11x,'dy/dt',11x,'energía')
102 format(6(1pe12.3))
end subroutine projectile

subroutine d2x(t, x, dx, n)

implicit none
integer n
double precision t
double precision x(n), dx(n)

! simple projectile motion in the (x,y) plane


double precision, parameter :: g = 9.81 ! free fall acceleration in m/s^2
!* first order
dx(1) = x(3)
dx(2) = x(4)
!* second order
dx(3) = 0.0 ! x direction
dx(4) = (-1.0)*g ! y direction
end subroutine d2x

subroutine rk4n(fcn,ti, tf, xi, xf, n)


implicit none
integer n
double precision ti, tf
double precision xi(n), xf(n)

integer j
double precision h, t
double precision x(n), dx(n)
double precision k1(n),k2(n),k3(n),k4(n)

3.

El Sistema de Runge Kutta funciona de la forma anterior, pero para nuestro caso tenemos que
adaptarlo al uso de una derivada de Segundo orden, por lo que hacemos un cambio de variable de
las derivadas y aplicamos el método, luego volvemos a palicar el método para las variables
originales.

4. external fcn

h = tf-ti
t = ti

!* evaluate k1
call fcn(t, xi, dx, n)
do j=1,n
k1(j) = h*dx(j)
x(j) = xi(j) + k1(j)/2.0
end do

!* evaluate k2
call fcn(t+h/2.0, x, dx, n)
do j=1,n
k2(j) = h*dx(j)
x(j) = xi(j) + k2(j)/2.0
end do

!* evaluate k3
call fcn(t+h/2.0, x, dx, n)
do j=1,n
k3(j) = h*dx(j)
x(j) = xi(j) + k3(j)
end do

!* evaluate k4 and the result


call fcn(t+h, x, dx, n)
do j=1,n
k4(j) = h*dx(j)
xf(j) = xi(j) + k1(j)/6.0+k2(j)/3.0+k3(j)/3.0+k4(j)/6.0
end do

end subroutine rk4n

5.

Cuando hay resistencia del aire el movimiento ya no es parabólico sino tal como se muestra en la
figura . Ya que ahora deben usarse para describir su movimiento las ecuaciones de Lagrange para
fuerzas no conservativas.

También podría gustarte