Wave equation 1d fortran download

A fortran computer program for modeling full waveform propagation through a layered homogeneous onedimensional medium is presented. Introduction liner is a system of fortran 77 codes which performs a 2d analysis of acoustic wave. Also, in order to make comparisons with the fortran compiler gfortran, we use. In this project, i have simulated onedimensional wave equation using dalemberts formula and then a clean and basic wave with different functions sine. Pdf fourth order compact finite difference method for.

Numerical solutions of the schr odinger equation 1. To solve the 3d viscoelastodynamic equation in the planewave domain, we apply a staggeredgrid fdtd with secondorder accuracy in time and fourthorder accuracy in space o2,4 e. But i have reached the point where i cant understand why the program does what it does. Among the wide variety of numerical schemes to approximate the 1d acoustic wave equation, we choose the simplest one. Numerical simulation of plane wave propagation in a lined twodimensional channel users manual r. Such solutions include all events from primary and multiple scattering, and so are used for reverse time migration and waveform inversion. Writing a matlab program to solve the advection equation. Numerical solution of partial di erential equations.

Now, according to maxwells equations, 253 254 where, and is the velocity of light. A demonstration of solutions to the one dimensional wave equation with fixed boundary conditions. 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. We allow variable wave velocity c2xqx, and dirichlet or homogeneous. 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. This chapter introduces some popular numerical methods for approximating solutions to the acoustic and elastic wave equations. Galerkin defg method is a highly accurate method for solving elastic waveequation problems.

A brief derivation of the energy and equation of motion of a wave is done before the numerical part in order to. Note that the rnpl compilation generates a number of fortran source files with. Fdtd3ca fortran program to model multicomponent seismic. Since we need to estimate the spatial derivatives only in the x 3direction, we apply a 1d stencil to locate wavefield variables and material parameters in space. Consistent with geometrical optics, its magnitude is constrained to be proportional to the refractive index n 2.

I have managed set all boundary and initial conditions as well as a mesh. This paper introduces the fourth order compact finite difference method for solving the numerical solution of onedimensional wave equations. Quantum mechanics numerical solutions of the schrodinger. Finite difference scheme is applied to time independent schrodinger equation. In this introductory work i will present the finite difference method for hyperbolic equations, focusing on a method which has second order precision both in time and space the socalled staggered leapfrog method and applying it to the case of the 1d and 2d wave equation. 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. You can use the code from this example as a template for your work in project 1. With numpy arrays, the computations are still done by loops, but in efficient, compiled, highly optimized c or fortran code. In this project, i have simulated onedimensional wave equation using dalemberts formula and then a clean and basic wave with different functions sine, gaussian etc. To solve the 3d viscoelastodynamic equation in the plane wave domain, we apply a staggeredgrid fdtd with secondorder accuracy in time and fourthorder accuracy in space o2,4 e. Or more precisely, fortran is not able return an array from a function, but we. Suppose that the electric and magnetic fields take the form, and. Numerical solutions of the schr odinger equation anders w.

And for that i have used the thomas algorithm in the subroutine. It turns out that the problem above has the following general solution. I am trying to solve the 1d heat equation using cranknicolson scheme. Numerical solution of 1d time independent schrodinger equation using finite difference method. In this short paper, the one dimensional wave equation for a string is derived from first principles.

The 1d wave equation in this chapter, the onedimensional wave equation is introduced. You will need a copy of acrobat reader to view the userguide. Derivative approximation validation and comparison using gnu. Wave equation in 1d part 1 derivation of the 1d wave equation vibrations of an elastic string solution by separation of variables three steps to a solution several worked examples travelling waves more on this in a later lecture dalemberts insightful solution to the 1d wave equation. The simple harmonic oscillator contents index the 1d wave equation. Rnpl, dv and xvs require fortran and c compilers, and before installation the. Numerical solution of partial di erential equations, k. Basic computational fluid dynamics cfd schemes implemented in fortran using finitevolume and finitedifference methods. Though, strictly speaking, it is useful only as a test problem, variants of it serve to describe the behaviour of strings, both linear. Solving the 1d wave equation a threelevel scheme in time. Required to plot model coefficients downloaded from becker and boschis.

As a specific example of a localized function that can be. Suppose that the function hx,t gives the the height of the wave at position x and time t. We conclude that the most general solution to the wave equation, is a superposition of two wave disturbances of arbitrary shapes that propagate in opposite directions, at the fixed speed, without changing shape. Finite difference methods for wave motion github pages. The constant term c has dimensions of ms and can be interpreted as the wave speed. Here is a simple example of solving a onedimensional. Cranknicolsan scheme to solve heat equation in fortran. This simulation was computed using fortran90 with mpi packages to allow parallel computing. Finitedifference numerical methods of partial differential equations. Such array operations can also easily be distributed among many processors on parallel computers. The convergence of the method for the problem under. Although we will not discuss it, plane waves can be used as a basis for any solutions to the 3d wave equation, much as harmonic traveling waves can be used as a basis for solutions to the 1d wave equation. This is a simple 1d scalar wave equation propagator, primarily implemented to test its performance compared to my previous implementations using python, numba, c, and fortran. 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.

The one dimensional wave equation is a partial differential equation which tells us how a wave propagates over time. 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. Fortran code for the numerical simulation of plane. Two dimensional wave equation with inflow in x and periodic in y.

The problem that we consider is the onedimensional wave equation. More precise definition of fourier representations. Accuracy of the method was proven using mms to be second order. With numpy arrays, the computations are still done by loops, but in efficient, compiled, highly optimized code in c or fortran. Numerical methods for solving the heat equation, the wave. It uses a novel parallel strategy for compact scheme boundery closure. Numerical solution of partial differential equations uq espace. Note that the above equations take the form of two coupled advection equations. A simple derivation of the one dimensional wave equation. Fortran code to solve wave equation with multiple methods. Last time we derived the partial differential equation known as the one dimensional wave equation. Introduction to partial di erential equations with matlab, j. Numerical solution of 1d time independent schrodinger. Some of the cases will also have correlating analytical solutions, which will enable us to check our numerical results.

This paper was written in manuscript form in 1985 and was recently rediscovered by the author and is presented for the first time. Finitedifference solver of the elastic wave equation in a spherical section. The 1d wave equation consider a plane polarized electromagnetic wave propagating in vacuo along the axis. How can i animate this 1d wave eqaution where i can see how the wave evolves from a. The 1d secondorder scalar wave equation, also called the 1d twoway wave. Step 3 write the discrete equations for all nodes in a matrix format and solve the system. Solving the 1d wave equation step 3 write the discrete equations for all nodes in a matrix. The equation describes the propagation of pressure variations or sound waves in a. This example draws from a question in a 1979 mathematical physics text by s. It arises in fields like acoustics, electromagnetics, and fluid dynamics. To see how to reference the software, see how to reference sphysics. Finite difference methods for 2d and 3d wave equations. The wave equation is an important secondorder linear partial differential equation for the description of wavesas they occur in classical physicssuch as mechanical waves e.

1216 79 294 1086 1425 606 220 1560 1027 1470 410 704 201 170 470 530 705 223 222 737 406 1456 957 47 246 1340 289 112 436 1068 282 511 1093 1033 666 100 392 1349 202 875