SlideShare une entreprise Scribd logo
1  sur  18
Télécharger pour lire hors ligne
Com Apoio de :
Marcos Mateus e Guillaume Riflet
Objectivos da Disciplina
• O que é um modelo,
• Os modelos matemáticos,
• Elementos que constituem um modelo,
• Os processos de transporte e as
  equações de evolução,
• Os métodos Numéricos,
• Programação/Linguagens gráficas,
• Gestão Ambiental, Modelos,
  Monitorização e Estudos de processos.
Programa
• Conceitos básicos de métodos
  numéricos,
• Programação em Visual Basic,
• Programação em PowerSim / Matlab,
• Modelos Presa-Predador
• Modelos Ecológicos,
• Modelos Hidrodinâmicos,
• Modelos de Transporte de
  Sedimentos.
Conhecimentos requeridos
• Mecânica dos Fluidos e Processos de
  Transporte,
• Programação,
• Ecologia e funcionamento dos
  ecossistemas,
• Ciclo dos Elementos e Ecologia,
• Fluxos de massa e de Energia
  através de um ecossistema.
Dificuldades Encontradas em
        Anos Anteriores
• Programação é a grande dificuldade.
• Mecânica dos Fluidos é uma
  dificuldade adicional, mas menor.

• Soluções: Acelerar o processo de
  aprendizagem de programação.
Equações que vamos
                 resolver
 • Conservação da massa:
∂ ck ∂ u j ck ∂
∂t
            =  ν
      ∂xj ∂ xj ∂xj
                  ∂c
                      
                      F k−P k 
 • Num modelo Hidrodinâmico também
   a equação de Transporte de
   Quantidade de Movimento:

ρ
 ∂t
     ∂ ui
     u j
             ∂ ui
               =
                 ∂
                      
                    ν
                      ∂u i
          ∂ x j ∂ xj ∂ x j
                            PressãoGravidade 
Onde aparecem os conceitos
         requeridos
• Equação de Evolução (ou de
  Transporte),
• Na equação de Transporte de
  Quantidade de Movimento,
• Em(F-P)
• Se isto fosse conhecido bem como a
  programação, a disciplina poderia ser
  chamada de “Mecânica dos Fluidos
  Computacional….”
Como se resolvem as
            equações
• Métodos Numéricos:
• Diferenças finitas/Volumes Finitos
• Elementos Finitos/Elementos de
  Fronteira.

• Como se constrói o método das
  diferenças finitas?
• Sériet  t ∂Taylor:c  t ∂ c .. . . t n ∂n c
                       t       t                             t
         de c  t ∂
                                                
               t  2 2     3 3
    t t
   c =c
    i    i
             ∂t   i   2! ∂ t2   i
                                    3! ∂ t3   i
                                                  n ! ∂ tn   i
O que representa a série de
          Taylor?                       t           t            t

                                                       
                        t       2   2       3   3       n    n
                    ∂c    t ∂ c   t ∂ c           t ∂ c
 c t t =c ti 
   i              t          2
                                     3
                                         .. . .
                    ∂t i 2! ∂t i 3! ∂t i          n ! ∂ tn       i
  c


Outras
derivada
s                       Δc   1ª Derivada: Δc/
                             Δt
                   Δt




             t1         t1+Δt                                    t
Como usar para calcular as
              derivadas? t
                    t                                                                                      t

                                                                                            
            t  2  2   3 3      n n
   tt      t         ∂c    t ∂ c   t ∂ c            t ∂ c
  ci     =c i      t          2
                                       3
                                           .. . .
                      ∂t i 2! ∂t i 3! ∂t i          n ! ∂ tn                                               i
                                             t
            t t t
           ci =ci  t
                      ∂c
                      ∂t i          
                           ° t 2 
                                                                        Método Explícito
                    t
                        cti  t −cit
           
           ∂c
               =
           ∂t i t
                                         ° t 
                                                         t t                t t                      t t

                                                                                              
                            t t         2       2                 3    3                    n    n
  t    t t
c i =c i −
             
              t
                ∂c
                ∂t          i
                                   
                                     t ∂ c
                                     2 ! ∂t 2            i
                                                                −
                                                                  t ∂ c
                                                                  3 ! ∂t 3   i
                                                                                    .. ..
                                                                                            t ∂ c
                                                                                            n ! ∂ tn   i
                                     t t
           t    t t
          ci =c i − t
                t t
                      ∂c
                      ∂t         
                              t t t
                                     i
                                             ° t 
                                                     2

                                                                        Método Implícito
                            c i −c i
           
           ∂c
           ∂t   i
                        =
                            t
                                         ° t 
Outro Método
                                                                        2            t t / 2                   3            t t / 2                         n                t t / 2


                                                                                                                                                               
                                           tt / 2
                                                               t /2       ∂2c                      t / 2        ∂3c                             t / 2       ∂nc
 tt
ci
          t t / 2
       =c i                  t /2
                                     
                                     ∂c
                                     ∂t    i
                                                        
                                                                2!          ∂ t2     i
                                                                                                
                                                                                                        3!          ∂t 3     i
                                                                                                                                        . .. .
                                                                                                                                                      n!          ∂ tn         i



                                                                        2            t t / 2                   3            t t / 2                         n            t t / 2


                                                                                                                                                               
                                               t t / 2
                                                               t /2       ∂2c                      t / 2        ∂3c                             t / 2       ∂nc
  t− t t t / 2
c i =c i        −             t /2
                                     
                                     ∂c
                                     ∂t        i
                                                          
                                                                2!          ∂t
                                                                                 2
                                                                                     i
                                                                                                −
                                                                                                        3!          ∂t
                                                                                                                         3
                                                                                                                             i
                                                                                                                                        . .. .
                                                                                                                                                     n!           ∂t
                                                                                                                                                                       n
                                                                                                                                                                           i




Subtraindo uma da outra:
                                                                  t t /2
                t t t
               ci −ci =+ t
                           ∂c
                           ∂t                                   i
                                                                             °  t /2  [              3
                                                                                                            ]
                                t  t /2
                                                   c ti  t −c ti
               
                ∂c
                ∂t              i
                                           =
                                                    t
                                                                              [
                                                                        °  t /2 
                                                                                                2
                                                                                                    ]
       Este método calcula a derivada no centro do intervalo de tempo e tem 
       precisão de 2ª ordem. Dá a solução exacta até uma evolução parabólica
O que representa a série de
          Taylor?                       t           t            t

                                                       
                        t       2   2       3   3       n    n
                    ∂c    t ∂ c   t ∂ c           t ∂ c
 c t t =c ti 
   i              t          2
                                     3
                                         .. . .
                    ∂t i 2! ∂t i 3! ∂t i          n ! ∂ tn       i
  c
        Método Explícito Método Implícito

Outras
derivada
s                       Δc   1ª Derivada: Δc/
                             Δt
                   Δt


           Método Diferenças
           Centrais



             t1         t1+Δt                                    t
Derivadas no espaço?
                                                                    t                       t                       t

                                                                                                   
                                   t                2       2               3       3               n       n
     t        t             ∂c     x ∂ c    x ∂ c            x ∂ c
   c i  x =c i x                     2
                                                3
                                                    . .. .
                            ∂ x i 2! ∂ x i 3! ∂ x i          n ! ∂ xn                                               i
                                                t
             t      t
            ci x =ci          x
                                    
                                  ∂c
                                  ∂t i
                                            2
                                       ° x 
                                                                                Método downwind
                           ci x −cit
                     t      t

             
            ∂c
                =
            ∂x i x
                                            ° x 
                                                                t                       t                       t

                                                                                               
                               t            2           2               3       3               n       n
  t        t       ∂c     x ∂ c    x ∂ c            x ∂ c
c i−x   =c i −   x            2
                                 −      3
                                           . .. .
                   ∂ x i 2! ∂ x i 3! ∂ x i          n ! ∂ xn                                                    i
                                        t
           t      t
          ci− x =ci − x
                        ∂c
                        ∂t i    
                             ° x 2 
                                                                                Método upwind
                 t
                         cit −c ti− x
           
           ∂c
               =
           ∂x i x
                                        ° x 
Subtraindo uma equação da
           Outra
                             t
  t
 cix   =ci−x −2
        t
          t


             t
                     x
                     t
                        
                       ∂c
                       ∂t i
                                 3
                            ° x 

            cix
  
 ∂c
     =
 ∂x i 2x
                   −ci−x
                           ° x 
                                  2



            Diferenças centrais
Derivadas no espaço?
                    
                                                        ¿                        ¿                       ¿


                                                                                              
                            ¿           2       2                3       3               n       n
 ¿     ¿       ∂c     x ∂ c     x ∂ c            x ∂ c
c ix =c i  x             2
                                    3
                                        . .. .
               ∂ x i 2 ! ∂ x i 3! ∂ x i          n ! ∂xn                                                 i




                        
                                                             ¿                       ¿                       ¿


                                                                                               
                                ¿           2       2                3       3               n       n
 ¿         ¿   ∂c     x ∂ c    x ∂ c            x ∂ c
c i−x =c i − x            2
                             −      3
                                       . .. .
               ∂ x i 2 ! ∂x i 3! ∂ x i          n ! ∂ xn                                                     i


     Adicionando:



                                                 
                                                         ¿
                                                 2
       ¿           ¿                ¿       2   ∂ c                  4
      ci x ci− x =2c i − x                                 ° x 
                                                ∂t 2     i
               ¿


                     c ¿ x −2c ¿ c¿ x
           2
       ∂ c               i−      i   i−                          2
                   =                                    ° x 
       ∂ x2    i       x2
Equações Algébricas
• Obtêm-se substituindo as derivadas
  pelas aproximações:

    c
        t t
               −c
                    t                 c t  x −c tx− x
                                        x                              c t  x −2c txc t − x
                                                                         x              x
                        °  t  u                      °  x  =ϑ
                                                              2
                                                                                                °  x 2 
          t                                2x                                   x2
           • Explícito, diferenças centrais. Precisão de 2ª
             ordem no espaço e 1ªno tempo.

                          c t  tx/ 2 −c tx− tx/ 2              c t  tx/ 2 −2c tx t / 2 c t  tx/ 2
                                           
  c t  t −c t         2
               °  t  u x                      °  x 2  =ϑ x                                    °  x 2 
                                                                                             x−
        t                           2x                                           x2

         • Semi-implícito (Crank-Nicholson) diferenças
           centrais espaço. Precisão de 2ª ordem no
           tempo e no espaço.
        O que se paga pela precisão de 2ª ordem no tempo?
Explícito Upwind
   c
       t t
              −c
                 t             c t −ctx − x
                                 x                     c tx x −2c tx c tx− x
                   °  t  u              °  x =ϑ
                                                  2
                                                                               °  x 2 
              t                     x                            x2


• Precisão de 1ª ordem no tempo e no espaço para
  advecção. Segunda ordem para difusão.
Qual é o melhor método?
• Se o erro de truncatura fosse o único
  indicador seria Crank-Nicholson, com
  diferenças centrais!
• Mas não é o único. Temos também
  que ver a consistência com os
  processos que estamos a estudar.
• Como se faz fisicamente a Advecção
  (propriedade transportiva) e a
  Difusão?
• O método upwind respeita

Contenu connexe

En vedette

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

En vedette (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Modelos Numéricos Ambientais

  • 2. Objectivos da Disciplina • O que é um modelo, • Os modelos matemáticos, • Elementos que constituem um modelo, • Os processos de transporte e as equações de evolução, • Os métodos Numéricos, • Programação/Linguagens gráficas, • Gestão Ambiental, Modelos, Monitorização e Estudos de processos.
  • 3. Programa • Conceitos básicos de métodos numéricos, • Programação em Visual Basic, • Programação em PowerSim / Matlab, • Modelos Presa-Predador • Modelos Ecológicos, • Modelos Hidrodinâmicos, • Modelos de Transporte de Sedimentos.
  • 4. Conhecimentos requeridos • Mecânica dos Fluidos e Processos de Transporte, • Programação, • Ecologia e funcionamento dos ecossistemas, • Ciclo dos Elementos e Ecologia, • Fluxos de massa e de Energia através de um ecossistema.
  • 5. Dificuldades Encontradas em Anos Anteriores • Programação é a grande dificuldade. • Mecânica dos Fluidos é uma dificuldade adicional, mas menor. • Soluções: Acelerar o processo de aprendizagem de programação.
  • 6. Equações que vamos resolver • Conservação da massa: ∂ ck ∂ u j ck ∂ ∂t  = ν ∂xj ∂ xj ∂xj ∂c    F k−P k  • Num modelo Hidrodinâmico também a equação de Transporte de Quantidade de Movimento: ρ ∂t ∂ ui u j ∂ ui = ∂    ν ∂u i ∂ x j ∂ xj ∂ x j  PressãoGravidade 
  • 7. Onde aparecem os conceitos requeridos • Equação de Evolução (ou de Transporte), • Na equação de Transporte de Quantidade de Movimento, • Em(F-P) • Se isto fosse conhecido bem como a programação, a disciplina poderia ser chamada de “Mecânica dos Fluidos Computacional….”
  • 8. Como se resolvem as equações • Métodos Numéricos: • Diferenças finitas/Volumes Finitos • Elementos Finitos/Elementos de Fronteira. • Como se constrói o método das diferenças finitas? • Sériet  t ∂Taylor:c  t ∂ c .. . . t n ∂n c t t t de c  t ∂         t 2 2 3 3 t t c =c i i ∂t i 2! ∂ t2 i 3! ∂ t3 i n ! ∂ tn i
  • 9. O que representa a série de Taylor? t t t         t 2 2 3 3 n n ∂c t ∂ c t ∂ c t ∂ c c t t =c ti  i t  2  3 .. . . ∂t i 2! ∂t i 3! ∂t i n ! ∂ tn i c Outras derivada s Δc 1ª Derivada: Δc/ Δt Δt t1 t1+Δt t
  • 10. Como usar para calcular as derivadas? t t t         t 2 2 3 3 n n tt t ∂c t ∂ c t ∂ c t ∂ c ci =c i  t  2  3 .. . . ∂t i 2! ∂t i 3! ∂t i n ! ∂ tn i t t t t ci =ci  t ∂c ∂t i   ° t 2  Método Explícito t cti  t −cit   ∂c = ∂t i t ° t  t t t t t t       t t 2 2 3 3 n n t t t c i =c i −   t ∂c ∂t i  t ∂ c 2 ! ∂t 2 i − t ∂ c 3 ! ∂t 3 i .. .. t ∂ c n ! ∂ tn i t t t t t ci =c i − t t t ∂c ∂t   t t t i ° t  2 Método Implícito c i −c i   ∂c ∂t i = t ° t 
  • 11. Outro Método 2 t t / 2 3 t t / 2 n t t / 2       tt / 2  t /2 ∂2c  t / 2 ∂3c  t / 2 ∂nc tt ci t t / 2 =c i   t /2   ∂c ∂t i  2! ∂ t2 i  3! ∂t 3 i . .. . n! ∂ tn i 2 t t / 2 3 t t / 2 n t t / 2       t t / 2  t /2 ∂2c  t / 2 ∂3c  t / 2 ∂nc t− t t t / 2 c i =c i −  t /2   ∂c ∂t i  2! ∂t 2 i − 3! ∂t 3 i . .. . n! ∂t n i Subtraindo uma da outra: t t /2 t t t ci −ci =+ t ∂c ∂t   i °  t /2  [ 3 ] t  t /2 c ti  t −c ti   ∂c ∂t i = t [ °  t /2  2 ] Este método calcula a derivada no centro do intervalo de tempo e tem  precisão de 2ª ordem. Dá a solução exacta até uma evolução parabólica
  • 12. O que representa a série de Taylor? t t t         t 2 2 3 3 n n ∂c t ∂ c t ∂ c t ∂ c c t t =c ti  i t  2  3 .. . . ∂t i 2! ∂t i 3! ∂t i n ! ∂ tn i c Método Explícito Método Implícito Outras derivada s Δc 1ª Derivada: Δc/ Δt Δt Método Diferenças Centrais t1 t1+Δt t
  • 13. Derivadas no espaço? t t t         t 2 2 3 3 n n t t ∂c x ∂ c x ∂ c x ∂ c c i  x =c i x  2  3 . .. . ∂ x i 2! ∂ x i 3! ∂ x i n ! ∂ xn i t t t ci x =ci  x   ∂c ∂t i 2 ° x  Método downwind ci x −cit t t   ∂c = ∂x i x ° x  t t t         t 2 2 3 3 n n t t ∂c x ∂ c x ∂ c x ∂ c c i−x =c i − x  2 − 3 . .. . ∂ x i 2! ∂ x i 3! ∂ x i n ! ∂ xn i t t t ci− x =ci − x ∂c ∂t i   ° x 2  Método upwind t cit −c ti− x   ∂c = ∂x i x ° x 
  • 14. Subtraindo uma equação da Outra t t cix =ci−x −2 t t t x t   ∂c ∂t i 3 ° x  cix   ∂c = ∂x i 2x −ci−x ° x  2 Diferenças centrais
  • 15. Derivadas no espaço?       ¿ ¿ ¿   ¿ 2 2 3 3 n n ¿ ¿ ∂c x ∂ c x ∂ c x ∂ c c ix =c i  x  2  3 . .. . ∂ x i 2 ! ∂ x i 3! ∂ x i n ! ∂xn i       ¿ ¿ ¿   ¿ 2 2 3 3 n n ¿ ¿ ∂c x ∂ c x ∂ c x ∂ c c i−x =c i − x  2 − 3 . .. . ∂ x i 2 ! ∂x i 3! ∂ x i n ! ∂ xn i Adicionando:   ¿ 2 ¿ ¿ ¿ 2 ∂ c 4 ci x ci− x =2c i − x ° x  ∂t 2 i ¿   c ¿ x −2c ¿ c¿ x 2 ∂ c i− i i− 2 = ° x  ∂ x2 i x2
  • 16. Equações Algébricas • Obtêm-se substituindo as derivadas pelas aproximações: c t t −c t c t  x −c tx− x x c t  x −2c txc t − x x x °  t  u °  x  =ϑ 2 °  x 2  t 2x x2 • Explícito, diferenças centrais. Precisão de 2ª ordem no espaço e 1ªno tempo. c t  tx/ 2 −c tx− tx/ 2 c t  tx/ 2 −2c tx t / 2 c t  tx/ 2  c t  t −c t 2 °  t  u x  °  x 2  =ϑ x  °  x 2  x− t 2x x2 • Semi-implícito (Crank-Nicholson) diferenças centrais espaço. Precisão de 2ª ordem no tempo e no espaço. O que se paga pela precisão de 2ª ordem no tempo?
  • 17. Explícito Upwind c t t −c t c t −ctx − x x c tx x −2c tx c tx− x °  t  u °  x =ϑ 2 °  x 2  t x x2 • Precisão de 1ª ordem no tempo e no espaço para advecção. Segunda ordem para difusão.
  • 18. Qual é o melhor método? • Se o erro de truncatura fosse o único indicador seria Crank-Nicholson, com diferenças centrais! • Mas não é o único. Temos também que ver a consistência com os processos que estamos a estudar. • Como se faz fisicamente a Advecção (propriedade transportiva) e a Difusão? • O método upwind respeita