Advertisement
Thomas_Lillieskold

Proyecto Tronador Aprox

Mar 19th, 2023
684
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Fortran 1.88 KB | Science | 0 0
  1. !Este Programa fue realizado por Lillieskold, Thomas Enrique
  2. !Instituto Universitario Aeronautico - 2023
  3. !Docentes: Giovacchini, Juan Pablo; Sacco, Carlos
  4. !Asignatura: Calculo Numerico
  5. !-------------------------------------------------------------------------------
  6. MODULE Datos
  7. REAL(8),PARAMETER:: t_min=0.541
  8. REAL(8),PARAMETER:: t_max=9.d0
  9. REAL(8),PARAMETER:: k=5e-4
  10. REAL(8),PARAMETER:: g=9.80665
  11. REAL(8),PARAMETER:: C_d=0.5
  12. REAL(8),PARAMETER:: rho=1.225
  13. REAL(8),PARAMETER:: s=0.05
  14. REAL(8),PARAMETER:: phi_1=10.d0*sqrt(3.d0)/2.d0
  15. REAL(8),PARAMETER:: phi_2=37.33*sqrt(3.d0)/2.d0
  16. REAL(8),PARAMETER:: phi_3=5.d0
  17. REAL(8),PARAMETER:: phi_4=37.33/2.d0
  18. INTEGER,PARAMETER:: dim =((t_max-t_min)/k) + 25
  19. INTEGER,PARAMETER:: neq=4
  20. END MODULE
  21.  
  22. Program Euler_explicito_vectorial
  23. USE DATOS
  24. IMPLICIT NONE
  25. REAL(8),DIMENSION(dim,neq)::Numerical_sol
  26.  
  27. Numerical_sol(1,1)=phi_1
  28. Numerical_sol(1,2)=phi_2
  29. Numerical_sol(1,3)=phi_3
  30. Numerical_sol(1,4)=phi_4
  31.  
  32. CALL Euler_exp_vec(Numerical_sol)
  33.  
  34. END PROGRAM Euler_explicito_vectorial
  35.  
  36. SUBROUTINE Euler_exp_vec(Vn)
  37. USE DATOS
  38. IMPLICIT NONE
  39. REAL(8),DIMENSION(dim,neq)::Vn
  40. REAL(8),DIMENSION(neq)::f
  41. REAL(8) t_i
  42. INTEGER i,j
  43. i=1
  44. t_i=t_min
  45. OPEN(10,FILE="write_outs_k=0.001")
  46.  
  47. DO WHILE (t_i .le. t_max)
  48.    
  49.     CALL Fun(Vn(i,:),f,t_i)
  50.    
  51.     DO j=1,neq,1
  52.         Vn(i+1,j)=Vn(i,j)+k*f(j)
  53.     END DO
  54.     Write(10,*) t_i,Vn(i,1),Vn(i,2),Vn(i,3),Vn(i,4)
  55.  
  56.     i=i+1
  57.     t_i=t_i+k
  58.    
  59. END DO
  60. END SUBROUTINE
  61.  
  62. SUBROUTINE Fun(aprox,f,t)
  63. USE DATOS
  64. IMPLICIT NONE
  65. REAL(8),DIMENSION(neq)::f
  66. REAL(8),DIMENSION(neq)::aprox
  67. REAL(8) t,cos,sin,m,d,thrust
  68.  
  69.     thrust=5000
  70.     D= 0.5 *C_d *s * rho * (aprox(2)**2+aprox(4)**2)
  71.    
  72.     cos=aprox(2)/sqrt(aprox(2)**2+aprox(4)**2)
  73.    
  74.     sin=aprox(4)/sqrt(aprox(2)**2+aprox(4)**2)
  75.    
  76.     m= (-40.d0/9.d0)*t + 70.d0
  77.    
  78.     f(1)=aprox(2)
  79.    
  80.     f(2)= (-(D-thrust)*cos)/m
  81.    
  82.     f(3)= aprox(3)
  83.    
  84.     f(4)= (-(m*g) - sin*(D-thrust))/m
  85.  
  86. END SUBROUTINE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement