Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MODULE Euler_Metodo
- USE DATOS, ONLY:t_min,t_max,phi_1,phi_2,phi_3,phi_4,neq,dim
- USE FUNCTIONS
- USE CHECK_K
- PRIVATE
- PUBLIC::Euler_exp
- contains
- SUBROUTINE Euler_exp(Vn,Inc)
- REAL(8),DIMENSION(:,:),POINTER,INTENT(IN) :: Vn
- REAL(8),DIMENSION(dim,neq)::Vn2
- REAL(8)Inc
- REAL(8),DIMENSION(neq)::f
- REAL(8),DIMENSION(neq)::f2
- REAL(8) t_i,t_2
- INTEGER i,j, iter,q
- CHARACTER(8):: Est
- vn(1,1)=phi_1
- vn(1,2)=phi_2
- vn(1,3)=phi_3
- vn(1,4)=phi_4
- vn2(1,1)=phi_1
- vn2(1,2)=phi_2
- vn2(1,3)=phi_3
- vn2(1,4)=phi_4
- q=1
- i=1
- t_i=t_min
- t_2=t_min
- OPEN(10,FILE="write_outs")
- DO WHILE (t_i .le. t_max)
- Iter = i
- print*, "Iter",iter,"i",i
- PRINT*, "t_i",t_i,"inc",inc
- CALL Fun(Vn(i,:),t_i, f) !Asignacion temporal de valores a vn
- Vn(i+1,:)= Vn(i,:) + Inc * f
- t_i = t_i + Inc
- i = i + 1
- DO J=1,2,1
- CALL Fun(Vn2(q,:),t_2,f2) !Asignacion temporal de valores a vn2
- Vn2(q+1,:)= Vn2(q,:) + (Inc/2.d0) * f2
- t2= t2 + Inc/2.d0
- q = q + 1
- END DO
- CALL Check(Vn(i,:),Vn2(q,:), Est)
- CALL Control(Est, t_i, Inc, i, q)
- !IF (i /= Iter) THEN !Se acepto la aproximacion
- Write(10,*) t_i,Vn(i,1),Vn(i,2),Vn(i,3),Vn(i,4)
- !END IF
- END DO
- END SUBROUTINE Euler_exp
- END MODULE Euler_Metodo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement