SlideShare a Scribd company logo
1 of 28
How to solve PDEs using  MATHEMATIA and MATLAB G. Y. Park, S. H. Lee and J.K. Lee Department of Electronic and Electrical Engineering, POSTECH 2006. 5. 17 Plasma Application Modeling POSTECH
Contents ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Plasma Application Modeling POSTECH
References ,[object Object],[object Object],[object Object],Plasma Application Modeling POSTECH
PDE (Partial Differential Equation) ,[object Object],[object Object],Plasma Application Modeling POSTECH - Three Types of PDEs: 1) Elliptic:     Steady heat transfer, flow and diffusion 2) Parabolic:    Transient heat transfer, flow and diffusion 3) Hyperbolic:    Transient wave equation
FTCS method for the heat equation FTCS ( Forward Euler in Time and Central difference in Space ) Heat equation in a slab Plasma Application Modeling POSTECH
FTCS method for the heat equation Initial  conditions Plot FTCS
Stability of FTCS and CTCS FTCS is first-order accuracy in time and second-order accuracy in space. So small time steps are required to achieve reasonable accuracy. CTCS method  for heat equation (Both the time and space derivatives are center-differenced.) However, CTCS method is   unstable   for  any  time step size. ( unstable ) Plasma Application Modeling POSTECH Courant condition  for FTCS
Lax method Simple modification to the CTCS method In the differenced time derivative, The resulting difference equation is ( Second-order accuracy in both time and space ) Plasma Application Modeling POSTECH Replacement by average value from surrounding grid points Courant condition  for Lax method
Crank Nicolson Algorithm ( Implicit Method ) BTCS ( Backward time, centered space ) method for heat equation ( This is stable for any choice of time steps, however it is first-order accurate in time. ) Crank-Nicolson scheme for heat equation taking the average between time steps n-1 and n, ( This is stable for any choice of time steps and second-order accurate in time. ) Plasma Application Modeling POSTECH a set of coupled linear equations for
Crank Nicolson Algorithm Initial  conditions Plot Crank-Nicolson scheme Exact solution
Crank Nicolson Algorithm Plasma Application Modeling POSTECH
Multiple Spatial Dimensions FTCS for 2D heat equation Courant condition for this scheme ( Other schemes such as CTCS and Lax can be easily extended to multiple dimensions. ) Plasma Application Modeling POSTECH
Wave equation with nonuniform wave speed 2D wave equation Initial condition : Boundary condition : Wave speed : CTCS method for the wave equation : Courant condition : Plasma Application Modeling POSTECH
Wave equation with nonuniform wave speed Since evaluation of the nth timestep refers back to the n-2nd step,  for the first step, a trick is employed. Since initial velocity and value, Plasma Application Modeling POSTECH
Wave equation with nonuniform wave speed Plasma Application Modeling POSTECH
Wave equation with nonuniform wave speed Plasma Application Modeling POSTECH
2D Poisson’s equation Poisson’s equation Direct Solution for Poisson’s equation Centered-difference the spatial derivatives
Jacobi’s  method ( Relaxation method ) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],FTCS (Maximum time step satisfying Courant condition)
Jacobi method
Simultaneous OverRelaxation (SOR) The convergence of the Jacobi method is quite slow.  Furthermore, the larger the system, the slower the convergence. Simultaneous OverRelaxation (SOR) : the Jacobi method is modified in two ways, ,[object Object],[object Object],[object Object],Plasma Application Modeling POSTECH
Simultaneous OverRelaxation (SOR)
O.V. Manuilenko MATLAB   The Language of Technical Computing MATLAB PDE Run:  dftcs.m >> dftcs dftcs - Program to solve the diffusion equation using the Forward Time Centered Space scheme. Enter time step: 0.0001 Enter the number of grid points: 51 Solution is expected to be stable Plasma Application Modeling Group POSTECH
O.V. Manuilenko MATLAB   The Language of Technical Computing MATLAB PDE Run:  dftcs.m >> dftcs dftcs - Program to solve the diffusion equation using the Forward Time Centered Space scheme. Enter time step: 0.00015 Enter the number of grid points: 61 WARNING:   Solution is expected to be unstable Plasma Application Modeling Group POSTECH
O.V. Manuilenko MATLAB   The Language of Technical Computing MATLAB PDE Run:  neutrn.m >>  neutrn Program to solve the neutron diffusion equation using the FTCS. Enter time step: 0.0005 Enter the number of grid points: 61 Enter system length: 2 =>  System length is subcritical Solution is expected to be stable Enter number of time steps: 12000 Plasma Application Modeling Group POSTECH
O.V. Manuilenko MATLAB   The Language of Technical Computing MATLAB PDE Run:  neutrn.m >>  neutrn Program to solve the neutron diffusion equation using the FTCS. Enter time step: 0.0005 Enter the number of grid points: 61 Enter system length: 4 =>  System length is supercritical Solution is expected to be stable Enter number of time steps: 12000 Plasma Application Modeling Group POSTECH
O.V. Manuilenko MATLAB   The Language of Technical Computing MATLAB PDE Run:  advect.m >> advect advect - Program to solve the advection equation using the various hyperbolic PDE schemes: FTCS, Lax, Lax-Wendorf Enter number of grid points: 50 Time for wave to move one grid spacing is 0.02 Enter time step: 0.002 Wave circles system in 500 steps Enter number of steps: 500 FTCS FTCS Plasma Application Modeling Group POSTECH
O.V. Manuilenko MATLAB   The Language of Technical Computing MATLAB PDE Run:  advect.m >> advect advect - Program to solve the advection equation using the various hyperbolic PDE schemes: FTCS, Lax, Lax-Wendorf Enter number of grid points: 50 Time for wave to move one grid spacing is 0.02 Enter time step: 0.02 Wave circles system in 50 steps Enter number of steps: 50 Lax Lax Plasma Application Modeling Group POSTECH
O.V. Manuilenko MATLAB   The Language of Technical Computing MATLAB PDE Run:  relax.m >> relax relax - Program to solve the Laplace equation using Jacobi, Gauss-Seidel and SOR methods on a square grid Enter number of grid points on a side: 50 Theoretical optimum omega = 1.88184  Enter desired omega: 1.8 Potential at y=L equals 1  Potential is zero on all other boundaries Desired fractional change = 0.0001 Plasma Application Modeling Group POSTECH

More Related Content

What's hot

Lu decomposition
Lu decompositionLu decomposition
Lu decomposition
gilandio
 
Newton-Raphson Method
Newton-Raphson MethodNewton-Raphson Method
Newton-Raphson Method
Jigisha Dabhi
 
Chapter 3 finite difference calculus (temporarily)
Chapter 3 finite difference calculus (temporarily)Chapter 3 finite difference calculus (temporarily)
Chapter 3 finite difference calculus (temporarily)
MichaelDang47
 

What's hot (20)

Iterative methods
Iterative methodsIterative methods
Iterative methods
 
A brief introduction to finite difference method
A brief introduction to finite difference methodA brief introduction to finite difference method
A brief introduction to finite difference method
 
trapezoidal and simpson's 1/3 and 3/8 rule
trapezoidal and simpson's 1/3 and 3/8 ruletrapezoidal and simpson's 1/3 and 3/8 rule
trapezoidal and simpson's 1/3 and 3/8 rule
 
FDM Numerical solution of Laplace Equation using MATLAB
FDM Numerical solution of Laplace Equation using MATLABFDM Numerical solution of Laplace Equation using MATLAB
FDM Numerical solution of Laplace Equation using MATLAB
 
Boundary Value Problems - Finite Difference
Boundary Value Problems - Finite DifferenceBoundary Value Problems - Finite Difference
Boundary Value Problems - Finite Difference
 
Numerical integration;Gaussian integration one point, two point and three poi...
Numerical integration;Gaussian integration one point, two point and three poi...Numerical integration;Gaussian integration one point, two point and three poi...
Numerical integration;Gaussian integration one point, two point and three poi...
 
Initial Value Problems
Initial Value ProblemsInitial Value Problems
Initial Value Problems
 
Finite difference Matlab Code
Finite difference Matlab CodeFinite difference Matlab Code
Finite difference Matlab Code
 
Lu decomposition
Lu decompositionLu decomposition
Lu decomposition
 
shooting method with Range kutta method
shooting method with Range kutta methodshooting method with Range kutta method
shooting method with Range kutta method
 
On the Numerical Solution of Differential Equations
On the Numerical Solution of Differential EquationsOn the Numerical Solution of Differential Equations
On the Numerical Solution of Differential Equations
 
Newton-Raphson Method
Newton-Raphson MethodNewton-Raphson Method
Newton-Raphson Method
 
Introduction of Partial Differential Equations
Introduction of Partial Differential EquationsIntroduction of Partial Differential Equations
Introduction of Partial Differential Equations
 
Euler and improved euler method
Euler and improved euler methodEuler and improved euler method
Euler and improved euler method
 
Numerical solution of ordinary differential equations GTU CVNM PPT
Numerical solution of ordinary differential equations GTU CVNM PPTNumerical solution of ordinary differential equations GTU CVNM PPT
Numerical solution of ordinary differential equations GTU CVNM PPT
 
Partial Differential Equations, 3 simple examples
Partial Differential Equations, 3 simple examplesPartial Differential Equations, 3 simple examples
Partial Differential Equations, 3 simple examples
 
Chapter 3 finite difference calculus (temporarily)
Chapter 3 finite difference calculus (temporarily)Chapter 3 finite difference calculus (temporarily)
Chapter 3 finite difference calculus (temporarily)
 
NUMERICAL METHODS
NUMERICAL METHODSNUMERICAL METHODS
NUMERICAL METHODS
 
Applied numerical methods lec13
Applied numerical methods lec13Applied numerical methods lec13
Applied numerical methods lec13
 
Bisection method
Bisection methodBisection method
Bisection method
 

Similar to Finite DIfference Methods Mathematica

Secrets of supercomputing
Secrets of supercomputingSecrets of supercomputing
Secrets of supercomputing
fikrul islamy
 
Secrets of supercomputing
Secrets of supercomputingSecrets of supercomputing
Secrets of supercomputing
fikrul islamy
 
Virus, Vaccines, Genes and Quantum - 2020-06-18
Virus, Vaccines, Genes and Quantum - 2020-06-18Virus, Vaccines, Genes and Quantum - 2020-06-18
Virus, Vaccines, Genes and Quantum - 2020-06-18
Aritra Sarkar
 
MOLECULAR SIMULATION TECHNIQUES
MOLECULAR SIMULATION TECHNIQUESMOLECULAR SIMULATION TECHNIQUES
MOLECULAR SIMULATION TECHNIQUES
Mysha Malar M
 
Parallel-in-Time Object-Oriented Electromagnetic Transient Simulation of Powe...
Parallel-in-Time Object-Oriented Electromagnetic Transient Simulation of Powe...Parallel-in-Time Object-Oriented Electromagnetic Transient Simulation of Powe...
Parallel-in-Time Object-Oriented Electromagnetic Transient Simulation of Powe...
Power System Operation
 
EGUE Technikrom Final_8_12_13
EGUE Technikrom Final_8_12_13EGUE Technikrom Final_8_12_13
EGUE Technikrom Final_8_12_13
Paul Brodbeck
 

Similar to Finite DIfference Methods Mathematica (20)

DFT.docx
DFT.docxDFT.docx
DFT.docx
 
DFT.docx
DFT.docxDFT.docx
DFT.docx
 
Secrets of supercomputing
Secrets of supercomputingSecrets of supercomputing
Secrets of supercomputing
 
Secrets of supercomputing
Secrets of supercomputingSecrets of supercomputing
Secrets of supercomputing
 
Virus, Vaccines, Genes and Quantum - 2020-06-18
Virus, Vaccines, Genes and Quantum - 2020-06-18Virus, Vaccines, Genes and Quantum - 2020-06-18
Virus, Vaccines, Genes and Quantum - 2020-06-18
 
MOLECULAR SIMULATION TECHNIQUES
MOLECULAR SIMULATION TECHNIQUESMOLECULAR SIMULATION TECHNIQUES
MOLECULAR SIMULATION TECHNIQUES
 
DESIGN OF DELAY COMPUTATION METHOD FOR CYCLOTOMIC FAST FOURIER TRANSFORM
DESIGN OF DELAY COMPUTATION METHOD FOR CYCLOTOMIC FAST FOURIER TRANSFORMDESIGN OF DELAY COMPUTATION METHOD FOR CYCLOTOMIC FAST FOURIER TRANSFORM
DESIGN OF DELAY COMPUTATION METHOD FOR CYCLOTOMIC FAST FOURIER TRANSFORM
 
Current Research on Quantum Algorithms.ppt
Current Research on Quantum Algorithms.pptCurrent Research on Quantum Algorithms.ppt
Current Research on Quantum Algorithms.ppt
 
Advanced Molecular Dynamics 2016
Advanced Molecular Dynamics 2016Advanced Molecular Dynamics 2016
Advanced Molecular Dynamics 2016
 
Parallel-in-Time Object-Oriented Electromagnetic Transient Simulation of Powe...
Parallel-in-Time Object-Oriented Electromagnetic Transient Simulation of Powe...Parallel-in-Time Object-Oriented Electromagnetic Transient Simulation of Powe...
Parallel-in-Time Object-Oriented Electromagnetic Transient Simulation of Powe...
 
Quantum Computation for Predicting Electron and Phonon Properties of Solids
Quantum Computation for Predicting Electron and Phonon Properties of SolidsQuantum Computation for Predicting Electron and Phonon Properties of Solids
Quantum Computation for Predicting Electron and Phonon Properties of Solids
 
EGUE Technikrom Final_8_12_13
EGUE Technikrom Final_8_12_13EGUE Technikrom Final_8_12_13
EGUE Technikrom Final_8_12_13
 
ECET 345 Entire Course NEW
ECET 345 Entire Course NEWECET 345 Entire Course NEW
ECET 345 Entire Course NEW
 
Digital Wave Formulation of Quasi-Static Partial Element Equivalent Circuit M...
Digital Wave Formulation of Quasi-Static Partial Element Equivalent Circuit M...Digital Wave Formulation of Quasi-Static Partial Element Equivalent Circuit M...
Digital Wave Formulation of Quasi-Static Partial Element Equivalent Circuit M...
 
DIGITAL WAVE FORMULATION OF PEEC METHOD (SLIDES)
DIGITAL WAVE FORMULATION OF PEEC METHOD (SLIDES)DIGITAL WAVE FORMULATION OF PEEC METHOD (SLIDES)
DIGITAL WAVE FORMULATION OF PEEC METHOD (SLIDES)
 
introduction-to-numerical-methods-in-chemical-engineering
 introduction-to-numerical-methods-in-chemical-engineering introduction-to-numerical-methods-in-chemical-engineering
introduction-to-numerical-methods-in-chemical-engineering
 
Parallel Left Ventricle Simulation Using the FEniCS Framework
Parallel Left Ventricle Simulation Using the FEniCS FrameworkParallel Left Ventricle Simulation Using the FEniCS Framework
Parallel Left Ventricle Simulation Using the FEniCS Framework
 
WHAT IS COMPUTATIONAL FLUID DYNAMICS (CFD)
WHAT IS COMPUTATIONAL FLUID DYNAMICS (CFD)WHAT IS COMPUTATIONAL FLUID DYNAMICS (CFD)
WHAT IS COMPUTATIONAL FLUID DYNAMICS (CFD)
 
Slides TSALBP ACO 2008
Slides TSALBP ACO 2008Slides TSALBP ACO 2008
Slides TSALBP ACO 2008
 
Optimal control of electrodynamic tether orbit transfers
Optimal control of electrodynamic tether orbit transfersOptimal control of electrodynamic tether orbit transfers
Optimal control of electrodynamic tether orbit transfers
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

Finite DIfference Methods Mathematica

  • 1. How to solve PDEs using MATHEMATIA and MATLAB G. Y. Park, S. H. Lee and J.K. Lee Department of Electronic and Electrical Engineering, POSTECH 2006. 5. 17 Plasma Application Modeling POSTECH
  • 2.
  • 3.
  • 4.
  • 5. FTCS method for the heat equation FTCS ( Forward Euler in Time and Central difference in Space ) Heat equation in a slab Plasma Application Modeling POSTECH
  • 6. FTCS method for the heat equation Initial conditions Plot FTCS
  • 7. Stability of FTCS and CTCS FTCS is first-order accuracy in time and second-order accuracy in space. So small time steps are required to achieve reasonable accuracy. CTCS method for heat equation (Both the time and space derivatives are center-differenced.) However, CTCS method is unstable for any time step size. ( unstable ) Plasma Application Modeling POSTECH Courant condition for FTCS
  • 8. Lax method Simple modification to the CTCS method In the differenced time derivative, The resulting difference equation is ( Second-order accuracy in both time and space ) Plasma Application Modeling POSTECH Replacement by average value from surrounding grid points Courant condition for Lax method
  • 9. Crank Nicolson Algorithm ( Implicit Method ) BTCS ( Backward time, centered space ) method for heat equation ( This is stable for any choice of time steps, however it is first-order accurate in time. ) Crank-Nicolson scheme for heat equation taking the average between time steps n-1 and n, ( This is stable for any choice of time steps and second-order accurate in time. ) Plasma Application Modeling POSTECH a set of coupled linear equations for
  • 10. Crank Nicolson Algorithm Initial conditions Plot Crank-Nicolson scheme Exact solution
  • 11. Crank Nicolson Algorithm Plasma Application Modeling POSTECH
  • 12. Multiple Spatial Dimensions FTCS for 2D heat equation Courant condition for this scheme ( Other schemes such as CTCS and Lax can be easily extended to multiple dimensions. ) Plasma Application Modeling POSTECH
  • 13. Wave equation with nonuniform wave speed 2D wave equation Initial condition : Boundary condition : Wave speed : CTCS method for the wave equation : Courant condition : Plasma Application Modeling POSTECH
  • 14. Wave equation with nonuniform wave speed Since evaluation of the nth timestep refers back to the n-2nd step, for the first step, a trick is employed. Since initial velocity and value, Plasma Application Modeling POSTECH
  • 15. Wave equation with nonuniform wave speed Plasma Application Modeling POSTECH
  • 16. Wave equation with nonuniform wave speed Plasma Application Modeling POSTECH
  • 17. 2D Poisson’s equation Poisson’s equation Direct Solution for Poisson’s equation Centered-difference the spatial derivatives
  • 18.
  • 20.
  • 22. O.V. Manuilenko MATLAB The Language of Technical Computing MATLAB PDE Run: dftcs.m >> dftcs dftcs - Program to solve the diffusion equation using the Forward Time Centered Space scheme. Enter time step: 0.0001 Enter the number of grid points: 51 Solution is expected to be stable Plasma Application Modeling Group POSTECH
  • 23. O.V. Manuilenko MATLAB The Language of Technical Computing MATLAB PDE Run: dftcs.m >> dftcs dftcs - Program to solve the diffusion equation using the Forward Time Centered Space scheme. Enter time step: 0.00015 Enter the number of grid points: 61 WARNING: Solution is expected to be unstable Plasma Application Modeling Group POSTECH
  • 24. O.V. Manuilenko MATLAB The Language of Technical Computing MATLAB PDE Run: neutrn.m >> neutrn Program to solve the neutron diffusion equation using the FTCS. Enter time step: 0.0005 Enter the number of grid points: 61 Enter system length: 2 => System length is subcritical Solution is expected to be stable Enter number of time steps: 12000 Plasma Application Modeling Group POSTECH
  • 25. O.V. Manuilenko MATLAB The Language of Technical Computing MATLAB PDE Run: neutrn.m >> neutrn Program to solve the neutron diffusion equation using the FTCS. Enter time step: 0.0005 Enter the number of grid points: 61 Enter system length: 4 => System length is supercritical Solution is expected to be stable Enter number of time steps: 12000 Plasma Application Modeling Group POSTECH
  • 26. O.V. Manuilenko MATLAB The Language of Technical Computing MATLAB PDE Run: advect.m >> advect advect - Program to solve the advection equation using the various hyperbolic PDE schemes: FTCS, Lax, Lax-Wendorf Enter number of grid points: 50 Time for wave to move one grid spacing is 0.02 Enter time step: 0.002 Wave circles system in 500 steps Enter number of steps: 500 FTCS FTCS Plasma Application Modeling Group POSTECH
  • 27. O.V. Manuilenko MATLAB The Language of Technical Computing MATLAB PDE Run: advect.m >> advect advect - Program to solve the advection equation using the various hyperbolic PDE schemes: FTCS, Lax, Lax-Wendorf Enter number of grid points: 50 Time for wave to move one grid spacing is 0.02 Enter time step: 0.02 Wave circles system in 50 steps Enter number of steps: 50 Lax Lax Plasma Application Modeling Group POSTECH
  • 28. O.V. Manuilenko MATLAB The Language of Technical Computing MATLAB PDE Run: relax.m >> relax relax - Program to solve the Laplace equation using Jacobi, Gauss-Seidel and SOR methods on a square grid Enter number of grid points on a side: 50 Theoretical optimum omega = 1.88184 Enter desired omega: 1.8 Potential at y=L equals 1 Potential is zero on all other boundaries Desired fractional change = 0.0001 Plasma Application Modeling Group POSTECH