TrabalhosGratuitos.com - Trabalhos, Monografias, Artigos, Exames, Resumos de livros, Dissertações
Pesquisar

O Trabalho de Métodos Números I - UFF

Por:   •  12/6/2019  •  Trabalho acadêmico  •  6.888 Palavras (28 Páginas)  •  180 Visualizações

Página 1 de 28

C      UNIVERSIDADE FEDERAL FLUMINENSE

C      TRABALHO DE MɐTODOS NUMÉRICOS

C      ALUNOS: Vitor Ivens Guimarães & Luan Guerra Garcia

C      PROFESSOR: Mauricio M. Kischinhevsky

C      DATA: 03/01/2017

      program Trabalho_3

      implicit none

C             DECLARAÇÃO DE VARIÁVEIS, VETORES E MATRIZES:

C      ESTIMATIVA INICIAL:

      real ei(3)

C      CONTAGEM DE ITERAÇÕES:

      integer i

C      CONDIÇÃO DE PARADA E CONTROLE AUTOMÁTICO/MANUAL:

      character condicao*1

      logical e, n

      integer auto

      real erro, ermac

C      VARIÁVEIS:

      real x, y, z

      real m

C      RESULTADO FUNÇÕES:

      real f1, f2, f3

C      RESULTADO FUNÇÕES DERIVADAS:

      real f11, f12, f13, f21, f22, f23, f31, f32, f33

C      MATRIZ E VETORES S:

      real s(3,1)

C      MATRIZ FUNÇÕES E JACOBIANA:

      real f(3,1), j(3,3)

      print*, 'PROGRAMA PARA RESOLUÇÃO DE INTERSEÇÃO DE SUPERFÍCIES',

     &        'PELO MɐTODO DE NEWTON-RAPHSON:'

C     ------------------------------------------------------------------

C                    1º PASSO - ENTRAR COM VALORES:

1     format (/,A,' ',$)

      print 1, ' Insira valor da componente X da estimativa inicial:'

      read*, ei(1)

      print 1, ' Insira valor da componente Y da estimativa inicial:'

      read*, ei(2)

      print 1, ' Insira valor da componente Z da estimativa inicial:'

      read*, ei(3)

C     ------------------------------------------------------------------

C                               CALCULAR:

2     format (F14.7,' ',F14.7,' ',F14.7,//,F14.7,' ',F14.7,' ',

     &        F14.7,//,

     &        F14.7,' ',F14.7,' ',F14.7)

3     format (F14.7, //, F14.7, //, F14.7)

31    format (/)

32    format (' ')

33    format (A1)

34    format ('x = ',F14.7, //, 'y = ', F14.7, //,'z = ', F14.7)

35    format (/,A,' ',$)

36    format (F14.7)

C      PARÂMETROS:

         x = ei(1)

         y = ei(2)

         z = ei(3)

         i = 0

         auto = 0

         e = .true.

         erro = 1

         print 31

         print*, 'DADOS INICIAIS:'

      do while (e)

C      CONDUÇÃO AUTOMÁTICA DAS ITERAÇÕES:

C      OBS: COM PARADA ESTIPULADA POR PARÂMETRO

         if ((i.ne.0).and.(auto.eq.0)) then

            print 35, 'DESEJA LIGAR O MODO AUTOMÁTICO? S/N -> '

            read 33, condicao

                 if ((condicao.eq.'S').or.(condicao.eq.'s')) then

                     auto = 1

                 else

                     if ((condicao.eq.'N').or.(condicao.eq.'n')) then

                        auto = 2

                     end if

                 end if

         end if

C      DETERMINAÇÃO DAS CONDIÇÕES DE PARADA:

         if ((i.ne.0).and.(auto.eq.1)) then

            print 32

            print*, 'MODO AUTOMÁTICO LIGADO'

            print 32

C           print 35, 'QUAL O RESULTADO (EM MÓDULO) ESPERADO? EX: 1 -> '

C           read*, erro

            print 35,'QUAL A APROXIMAÇÃO DESEJADA?  VALOR >= 0.0001 -> '

            n = .true.

               do while (n)

                  read 36, ermac

                  if (ermac.lt.0.0001) then

                     print 32

                     print 35, 'VALOR INADEQUADO. REINSIRA O VALOR: '

                  else

                     n = .false.

                  end if

               end do

            auto = 3

         end if

C      EXECUÇÃO AUTOMÁTICA DO PROGRAMA:

         if ((i.ne.0).and.(auto.eq.3)) then

            call mode(x, y, z, m)

            if (m.eq.erro) then

                  e = .false.

            end if

            do while (e)

               call formula(f1, f2, f3, x, y, z)

               call jacobiana(x, y, z, f11, f12, f13, f21, f22, f23,

     &              f31, f32, f33)

               call matrizes(j, f, f11, f12, f13, f21, f22, f23,

     &              f31, f32, f33, f1, f2, f3)

...

Baixar como (para membros premium)  txt (19.4 Kb)   pdf (69.1 Kb)   docx (15 Kb)  
Continuar por mais 27 páginas »
Disponível apenas no TrabalhosGratuitos.com