1d wave equation fortran software

This repository contains a fortran implementation of a 2d flow using the projection method, with finite volume method fvm approach. Our next generalization of the 1d wave equation or is to allow for a variable wave velocity \c\. Sign up simualting 1d wave equation using dalemberts formula. Utt c2 uxx over the spatial interval x1,x2 and time interval t1,t2, with initial conditions. Accuracy of the method was proven using mms to be second order. Understand the basic concept of the finite element method applied to the 1d acoustic wave equation. Very little viscous diffusion allowed, boundary conditions arent great. Numerical solutions of the schr odinger equation 1. Similarly, the technique is applied to the wave equation and laplaces equation. Although theyre technically permissible, theyre completely redundant and whats more, make it harder to read since a semicolon at the end of a line which signifies nothing looks like a colon at the end of a line which would indicate that the following code is part. Modified equation and amplification factor are the same as original laxwendroff method. This program describes a moving 1d wave using the finite difference method. Energy must be prescribed before calculating wavefunction.

Solving a simple 1d wave equation with rnpl the goal of this tutorial is quickly guide you through the use of a precoded rnpl application that solves a simple timedependent pde using finite difference techniques. Fosite advection problem solver fosite is a generic framework for the numerical solution of hyperbolic conservation laws in generali. Fortran code for the numerical simulation of plane. There is a diverse range of other acousticsrelated software available, both commercially and opensource. The latter scheme is able to generate responses to p, sv, and shwaves with different incident angles and azimuth. After making a sequence of symbolic transformations on the pde and its initial and boundary conditions, mathpde automatically generates a problemspecific set of mathematica functions to solve the numerical problem, which is essentially a system of. A fortran computer program for modeling full waveform propagation through a layered homogeneous onedimensional medium is presented. Fortran code to solve wave equation with multiple methods. Numerical solution of 1d time independent schrodinger.

This paper introduces the fourth order compact finite difference method for solving the numerical solution of onedimensional wave equations. I have managed set all boundary and initial conditions as well as a mesh. Jul 19, 2015 the equation above is a partial differential equation pde called the wave equation and can be used to model different phenomena such as vibrating strings and propagating waves. Their algorithm calculates seismic psv response of vertically heterogeneous attenuative media subjected to oblique incident waves. Coolprop a crossplatform, opensource, alternative to nist refprop. The code compiles perfectly but the problem arises when i want to plot the odd solutions. Includes also wave equation solver for simulating shallow water.

A fortran computer program for modeling full waveform propagation through a layered homogeneous onedimensional medium is. It is an implicit method and you will have to solve a system of linear equations at each timestep. Or more precisely, fortran is not able return an array from a function, but we. A reservoir approach theory and soil properties are used to differ between surface runoff and subsurface flow. A package for solving timedependent partial differential equations pdes, mathpde, is presented. There is also a pdf version of this document project 1. Most books on finite difference methods, or books on theory with computer examples, have their emphasis on diffusion phenomena. The 3d wave equation and plane waves before we introduce the 3d wave equation, lets think a bit about the 1d wave equation, 2 2 2 2 2 x q c t. There are also some explicit schemes that may work, but they are more involved, not the naive scheme you tried. But i have reached the point where i cant understand why the program does what it does. One of the main reasons fortran has survived and will survive is software inertia. Solving the 1d wave equation consider the initialboundary value problem. Shallow water wave cfd tsunami modelling file exchange. The waves start travelling towards the wall and are reflected off the wall.

Problems involving partial differential equations from several branches of physics, such as fluidstructure interactions, require interpolations of data on several meshes and. Cranknicolsan scheme to solve heat equation in fortran. Employs cranknicholson scheme, 2nd order accurate, cfd calculation of shallow water wave equation. A matlab toolbox for the time domain simulation of.

Solving the heat, laplace and wave equations using. Implementation of the numerov method for the 1d square well. Software to download usgs earthquake hazard program. Howard aerospace engineering department, university of colorado, boulder, co april 7, 1999 1. This partial differential equation pde applies to scenarios such as the vibrations of a continuous string. Openflood is a fully dynamic 1d 2d flood simulation engine intended to simulate fluvial and tidal flooding using the. Numerical methods for solving the heat equation, the wave. Finite difference computing with pdes a modern software.

The wave equations may also be used to simulate large destructive waves waves in fjords, lakes, or the ocean, generated by slides earthquakes subsea volcanos meteorittes human activity, like nuclear detonations, or slides generated by oil drilling, may also generate tsunamis propagation over large distances wave amplitude increases near. Nov, 2018 in this video, we solve the 1d wave equation. Problems involving partial differential equations from several branches of physics, such as fluidstructure interactions, require interpolations of data on several meshes and their manipulation within one program. Inserting the fourier component into the dicrete 2d wave equation, and using formulas from the 1d analysis. Many facts about waves are not modeled by this simple system, including that wave motion in water can depend on the depth of the medium, that waves tend to disperse, and.

The one dimensional euler equations of gas dynamics lax wendroff fortran module. When applied to linear wave equation, twostep laxwendroff method. Among the wide variety of numerical schemes to approximate the 1d acoustic wave equation, we choose the simplest one. The simple harmonic oscillator contents index the 1d wave equation. Cython is an extension of python that offers the easiest way. The equation describes the propagation of pressure variations or sound waves in a. The idealstring wave equation applies to any perfectly elastic medium which is displaced along one dimension. Finitedifference solver of the elastic wave equation in a spherical section. Finite difference scheme % matlab script waveeq1dfd. The code solves navier stokes equations in a 2d lid driven cavity, with computation of the rotational as well. Two dimensional wave equation with inflow in x and periodic in y. Prism is opensource software used for automatically processing strongmotion records, and is intended to be used by individuals or strongmotion networks. For example, the air column of a clarinet or organ pipe can be modeled using the onedimensional wave equation by substituting airpressure deviation for string displacement, and longitudinal volume velocity for transverse string velocity. In other words, future solution are being solved for at more than one.

The kwave toolbox is a powerful tool for general acoustic modelling. Solving the advection pde in explicit ftcs, lax, implicit. Apr 21, 2016 for the love of physics walter lewin may 16, 2011 duration. Reference request for computational fluid dynamics. What may be required here is to add a regularization of some sort to make the resulting matrix equation system nondegenerate to ensure it has a unique solution. Numerical simulations produce large arrays as results and the software needs to. Codes for wave propagation and earthquake dynamics. And for that i have used the thomas algorithm in the subroutine. The one dimensional wave equation using upwind parallel mpi fortran module. Applications of 2d surface flow modeling in the new hec. Half of this book the chapters vibration odes, wave equations, and appendix. The wave equation considered here is an extremely simplified model of the physics of waves. Pdf fourth order compact finite difference method for.

The routine listed below solves the 1d wave equation using the cranknicholson scheme discussed above. Jun 03, 2018 hey everyone, im trying to simulate a 1d shallow water wave in fortran using the lax wendroff method. For the numerical simulation of 2d earthquake dynamics, the spectral boundary integral equation code bimat is well suited for planar faults in homogeneous and bimaterial media, and the spectral element code sem2dpack is well suited for nonplanar faults in heterogeneous or nonlinear media. Nov 15, 2018 in this video we simplify the general heat equation to look at only a single spatial variable, thereby obtaining the 1d heat equation. This can quite easily be done by adding a little extra code to our program.

The technique is illustrated using excel spreadsheets. Writing a matlab program to solve the advection equation duration. It is quite simple in 1d as the system is tridiagonal. Conservation form of burgers equation lax wendroff fortran module. In this video we simplify the general heat equation to look at only a single spatial variable, thereby obtaining the 1d heat equation. In other words, future solution are being solved for at more than one node in terms of the solution at earlier time. In this code, a potential well is taken particle in a box and the wavefunction of the particle is calculated by solving schrodinger equation. A 2d parallel diffusive wave model for floodplain inundation with variable time step pdwave author links open overlay panel. Nov 11, 2018 in this video, we derive the 1d wave equation. Fdtd3ca fortran program to model multicomponent seismic. A fortran code is written to implement the procedure of forward difference solution of the wave equation in one dimension the homogenous wave equation is.

Extended material on this topic is not so easy find in the. However, this doesnt mean its the best tool for every purpose. Jafargandomi and takenaka 2010 extended the scheme to solve threecomponent wave equation. The one dimensional euler equations of gas dynamics leap frog fortran module. We shall therefore, in all our pde solving programs, have the unknown in. The 3d wave equation, plane waves, fields, and several 3d differential operators.

Johnsons excellent pml perfectly matched layer an absorbing boundary condition tutorial, i cameup with the following implementation of a pml for the 1d scalar wave equation. The wave equation we consider the scalar wave equation modelling acoustic wave. The 1d wave equation can be generalized to a 2d or 3d wave equation, in scaled coordinates, u 2. An implicit method is one in which the nite di erence equation contains the solution at a at future time at more than one node. This program solves the 1d wave equation of the form. This simulation was computed using fortran90 with mpi packages to allow parallel computing. We utilize the separation of variables method to solve this 2nd order, linear, homogeneous, partial differential equation. Problem with a plot for 1d wave equation solution using. We begin our study of wave equations by simulating onedimensional waves on. Freefem is a partial differential equation solver for nonlinear multiphysics systems in 2d and 3d. The output synthetic seismograms are generated using a finitedifference approximation to the wave equation, as opposed to the more conventional approach of simply convolving the calculated reflection coefficient wavetrains with representative wavelets. Not directly about your question, but a note about python.

How can i animate this 1d wave eqaution where i can see how the wave evolves from a gaussian and split into two waves of the same height. Writing a matlab program to solve the advection equation. Numerical simulation of plane wave propagation in a lined twodimensional channel users manual r. The constant term c has dimensions of ms and can be interpreted as the wave speed. Introduction liner is a system of fortran 77 codes which performs a 2d analysis of acoustic wave. Fortran is the most enduring computer programming language in history. Finite difference methods for wave motion finite difference. Once a company has spent many peopleyears and perhaps millions of dollars on a software product, it is unlikely to try to translate the software to a different language. Method, the heat equation, the wave equation, laplaces equation. It uses a novel parallel strategy for compact scheme boundery closure. I have a wave generator on one end of a water pool and a wall boundary on another. I am trying to solve the 1d heat equation using cranknicolson scheme. What is usually the case when one gets strange results with this method is that the regularization is not good enough.

Hecras 2d project advantages 27 public domain no license fees large community of practitioners widely accepted as hec product pre and postprocessing in mapper and georas can easily integrate 2d flow areas into existing hecras models update old 1d hecras models no need to decide 1d or 2d when selecting modeling software. Building a general 1d wave equation solver collection of initial conditions finite difference methods for 2d and 3d wave equations examples on wave equations written out in 2d3d boundary and initial conditions example. Solving the 1d wave equation a threelevel scheme in time. Numerical solutions of the schr odinger equation anders w. Excerpt from geol557 numerical modeling of earth systems by becker and kaus 2016 1 finite difference example. You can use the code from this example as a template for your work in project 1. It turns out that the problem above has the following general solution. The advection equation using upwind parallel mpi fortran module. The routine first fourier transforms and, takes a timestep using eqs. The convergence of the method for the problem under. Can you please check my subroutine too, did i missed some codes.

Find the analytical solution to a damped wave equation. Solving the 1d wave equation step 3 write the discrete equations for all nodes in a matrix. Finite difference methods for 2d and 3d wave equations a natural next step is to consider extensions of the methods for various variants of the onedimensional wave equation to twodimensional 2d and threedimensional 3d versions of the wave equation. We solving the resulting partial differential equation using.

73 638 1315 349 1195 567 1540 454 676 1276 1192 1015 1418 1384 1507 459 692 1483 246 1542 1401 344 1433 1103 1339 559 1278 1497 1225 1151 1210 808 1224 1355 428 696 1030 1196 105 346 318 1494