Numerically Approximating the Wave Equation?
ObsessiveMathsFreak writes "I'm an applied mathematician who has recently needed to obtain good numerical approximations to the classic second-order wave equation, preferably in three space dimensions. A lot of googling has not revealed much on what I had assumed would be a well-studied problem. Most of the standard numerical methods, finite difference/finite element methods, don't seem to work very well in the case of variable wave speed at different points in the domain, which is exactly the case that I need. Are any in this community working on numerically solving wave equation problems? What numerical methods do you use, and which programs do you find best suited to the task? How do you deal with stability issues, boundary/initial values, and other pitfalls? Are there different methods for electromagnetic wave problems? Finally, when the numbers have all been crunched, how do you visualize your hard-earned data?"
My head hurts now..
Call Wolfram's tech support, I'm sure they can assist.
Or perhaps you could modify the phase variance. That always works on TV.
You could try putting your question online as an Ask Slashdot post. Use the Submit Story link on the left. Good luck finding your answer!
Why bother.
Not exactly my field, but if the issues with FE/FD are ones of stability and/or convergence, have you looked into using multigrid methods? It requires more memory, but a good preconditioned, multigrid method should help reduce problems of variable speeds, no?
I am not a physicist, but I thought Feynman invented Monte Carlo for this sort of thing.
This is my sig.
You say you want an approximate solution but you give us no clue as to the part of the problem you want to approximate. For variable wave speed, I've used both normal modes and the parabolic equation approximation.
The question you have posed is so unspecific, it would be impossible to fully answer it without writing a text book. There are many good ones, for example, Waves in Layered Media by L. M. Brekhovskikh.
We don't see the world as it is, we see it as we are.
-- Anais Nin
Mathematician here, though this isn't my field. Slashdot isn't a very good place to ask this kind of question, since there aren't many mathematicians on here, and it's a very broad topic. I suggest Usenet -- specificially the sci.math newsgroup. I know at least 50 mathematicians who post regularly, and a lot more lurk (and occassionally answer questions).
After all, I am strangely colored.
and not make fun of this person for asking a question that has nothing to do with our hobby horses. I hope this question has a small number of posts. Only well-meaning and helpful ones.
In what ways does it not work well for you? It doesn't converge, takes too long to converge? What is the problem?
A numerical algorithm would give you the assumptions that guarantee convergence and you should be able to figure out under what conditions it would "not work well". Just look up the assumptions and see what assumption your variable wave speed violates to not give you convergence.
Well, having just taken a basic course in PDE's, I'd automatically say use finite difference, with a crank-nicholson scheme (for convergence), and gauss-seidel iteration. Of course, since it was a basic course, we only dealt with a 1-D wave equation.
I can tell you that the internet is lacking for stuff even as simple as that, and it's hard to find a good textbook. You might have better luck with a text book, since your need is more focused than the course I took.
Your question is rather specific given the crowd here on slashdot. Personally, I think you should ask other professional mathematitians at universities. If your problem is interesting, I'm sure you will have no problem finding someone who will give you advice. I personally only have limited experience in modeling of heat flow, which is somewhat similar to what your problem is. We use a finite element approach, where variables such as porosity, permiability, and composition can be changed for each element. It would likely be computationally expensive to create a functionally variable wave speed, so partioning it so that each element had different velocity paramenters would likely be suitable. As for programs, you might be forced to break out the C (or even FORTRAN) book and create your own. More often than not in specialized physics problems, there are no programs that are specifically applicable to your problem. If there were, you would have already found it.
If you're doing an electromagnetics problem in 3D (I *am* a physicist specialising in this field), there are many options. This is a VERY well studied problem.
If your problem domain is not too many wavelengths big (i.e. near-field), you want a FDTD solver. There are many commercial packages available but most are expensive (just google for FDTD). FDTD is quite simple in concept but there are various details to get right to make a general purpose solver (e.g. boundary conditions). There are a number of hardware-based solvers on the market utilising GPUs for electromagnetics calculations. If you only need a single-frequency (eigenmode) solution, then Finite Element Method might be for you (e.g. see http://people.web.psi.ch/geus/pyfemax/). If you have extreme aspect ratios you need to model (i.e. interaction between widely spaced components), then the Boundary Element Method might suit (but it's harder to understand and implement).
If you're rolling your own solution, Python makes an excellent "glue language" to tie solvers together and visualise results with VTK (www.vtk.org) and add configuration GUIs.
Are you doing the time harmonic case (3-D Helmholtz) or an unsteady case?
What does the domain look like (regular/rectangular and you may be able to use spectral methods)? In irregular domains, multigrid methods seem to converge most quickly for elliptic equations, but again, that depends on their exact form.
You don't say what goes wrong with finite difference codes... For pure Adams-Bashforth schemes often give extremely good numerical stability. You talk about variable wave speeds, but the Mathworld equation you link to doesn't cover that. In many cases you can use multiple-scales/WKB approaches, but that depends on how the wave speed varies (relative to the wavelength).
Finally: there are many things for which Googling sucks. This is one. For an proper overview, try a proper textbook, like "Waves in Layered Media", mentioned above, or "Modern Methods in Analytical Acoustics" (Crighton, Dowling et al).
Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
Point of order: Is it still OK to make fun of the editors for letting this question through?
I move that the Chair recognize kdawson is an idiot.
Breakfast served all day!
Hi, I'm currently doing a Masters Thesis on Diffusion PDE's (Parabolic and Elliptic) correct me If i'm wrong but the wave equation is a hyperbolic PDE. I use a MATLAB Toolbox called PDE Toolbox GUI and although I don't use it I know it includes a hyperbolic solver. I haven't investigated how detailed it is, but I suggest having a look through the manual, to see if it meets your requirements. Cheers
didja try wikipedia? :-)
That was more like Metropolis, Ulam (I think Teller had something to do with it)
see: Wikipedia
-- may you ever drink deep --
Contact Dr. Mohammad Rammaha (analysis) at the University of Nebraska (Lincoln). He's been working on PDE's for the last decade. While he works on analytical solutions, I'm sure that he also is familiar with numberical methods. Dr. David Logan (applied mathematics) surely would have the resources at his fingers. e-mail addresses are: mrammaha1@math.unl.edu, and dlogan@math.unl.edu. Worth a shot.
Aren't you supposed to figure that stuff out if you're a mathmatician? I'm all for asking for advice, but dang... isn't part of the point of math to actually sit down and figure out things?
Have you tried inverting the phase-coils of the quantum induction array?
If that doesn't work, jiggle the handle a bit.
Have you tried CLAWPACK, unless you aren't really solving a hyperbolic problem? Disclamer: I recieved my M.Sc. in Applied Mathematics at the University of Washington and CLAWPACK was written by R.J. Leveque, a professor in that department.
887321 = 337*2633
...using an abacus.
It's been a couple of years, but when I was doing similar sounding calculations in a numerical relativity class, what is called spectral methods were useful. Wikipedia has a short introduction, http://en.wikipedia.org/wiki/Spectral_method
and as I recall there is a little bit of information in Numerical Recipes in .
...PI. Or 42. Duh. What, is everyone stupid?
asking such a question on slashdot is a waste of time since most of the answers will be stupid comments... googling for an answer to your problem must have given you some hits. i suggest you google (i) for people studying problems in this field and ask directly. scientists *always* help; at least i have never made any negative experiences. (ii) look for papers at http://scholar.google.com./ i am sure that in one of the CCP conferences (computational physics) these problems must have been discussed by someone. finally: how come slashdot lets such topics trough? i mean, is the news situation that bad right now?
You're looking at a PDE solver which are rather difficult beasts to solve. Perhaps a look at what methods Maple or Mathematica use would provide some insight. At least it'll be a starting point.
When it comes to display, the programs I've written always dumped the formated output to a text file. I then used gnuplot (http://www.gnuplot.info/) to view the data of interest. It can also dump the graph to a ps for inclusion in a paper is desired.
Hope that was helpful.
Try Jon Claerbout's free books ( http://sepwww.stanford.edu/sep/prof , especially "Imaging the Earth's Interior") and the Madagascar package for seismic data processing, modeling and inversion: http://rsf.sourceforge.net/ , GPL-ed.
Why would a real mathematician post a question like this here? He's obviously just another high-school kid trying to cheat on his PDE homework.
I'm a plasma physicist and I work in the domain of radiofrequency waves propagation and absorption in fusion plasmas. I've been busy developping a code that solves the Maxwell's equations, which are equivalent to the wave equation (3-D full-wave calculation). The case of a plasma is tricky because it both time *and* space dispersive.
I won't be able to even start explaining this stuff in this post, but my code uses finite elements for the radial direction and Fourier decompositions for the two periodic directions of a fusion device. These numerical methods work well. I also know finite difference codes which work well. So, I think you should look a bit harder, because FE or FD methods usually do the trick, even for "variable wave speed at different points in the domain"... Regarding the boundary conditions, well, you'd better be very careful, because they will usually completely determine the solution. Again, it is my experience that Finite elements are well adapted to this task but you'll have to do some research.
Finally, for the vizualisation, matplotlib and vtk work for me.
First, try to determine and explain more precisely what it is you want to do: "to obtain good numerical approximations to the classic second-order wave equation, preferably in three space dimensions" sounds a but vague. Pick up the right textbooks, scientific journals, learn, exchange with the community. I know my post sounds a bit patronizing but this is science, and this kind of effort takes dedication, time and patience. I think Slashdot and Google are hardly the right places to start...
http://kim.oyhus.no/wave.html
It is a Java applet. Note the low dispersion. Try clicking on it!
In order to make this, I avoided the standard textbook methods.
They can give good waves, but at a high cost in computation and memory.
It is not standard finite differencing, since those methods introduce dispersion
and similar errors to an unnecessary degree. But it IS a finite differencing method,
and I have done variants of it with variable speed and in 3 dimensions.
Here is one with variable speed:
http://kim.oyhus.no/seismic.mpg
One of the tricks I use is to use a hexagonal grid.
Kim Øyhus, M.Sc. Physics
And, by the way, everybody knows that all usefull inventions are German
-- may you ever drink deep --
Need some numbers? Try hangin ten!
I caught this gnarly wave once Dude and I just stuck it!
Kowabunga Dude!
WHAT?!
Chill out dude, you're sressin me with those looks...
Slashdot has been getting infested with non-nerds lately. We need some weed-out topics. They should appear as pop-up windows and pop-under windows in addition to appearing as normal articles. Nerds will only see one (very enjoyable) copy; non-nerds will face three terrifying articles that resemble the cruel word problems of their childhood.
It's not entirely clear what you are trying to do, but one of the sweetest ways to 'visualize' wave data is to output it directly to /dev/audio and LISTEN to it as a sound waveform (actually /dev/dsp would work better for this, because it expects uncompressed data). All you have to do is open /dev/dsp, convert your data to a series of 8 bit integers, scaled to where 255 is the maximum and 0 is the minimum, do a write() on your data to /dev/dsp and viola! You have music! If you want to change things like the bitrate, look at the open sound system page.
Qxe4
For these kind of problems, I particularly like Comsol (used to be called Femlab). It is very easy to use (insofar as a PDE solver can be easy to use), and it has great built-in visualization options. It even includes a simple to set up boundary condition module.
Best of luck
This isn't my area, but my Ph.D. is in applied and computational math, and I've spent a great deal of time solving first-order hyperbolic problems where characteristics cross. (In my context, level set methods where the zero contours can split and/or merge.)
For a hyperbolic problem like this, you'll want to be careful. Since the waves have variable propagation speeds, there's a possibility for shock formation. (characteristics can cross) Think of Burger's equation as a nice, tangible first-order analog. In such a case, it will be important to choose a numerical method that satisfies some kind of entropy condition to handle the shock. Similar things have been encountered in level set methods, where you solve an equation of the form ft + V |grad(f)| = 0, where V is the variable speed of an interface that's represented as the zero contour of f.
Since second-order wave equations are so important in physics, you may want to check out the Journal of Computational Physics. You should probably also try the Journal of Scientific Computing.
As for visualization, you'll probably want to check out the "industry standards" Matlab and Mathematica. You could plot the time evolution of level surfaces of your wave equation, for instance. As for other softare, I'd generally advise pulling together what you can find at netlib, although more cutting-edge stuff may require you to roll your own C/C++ or FORTRAN. But any of that stuff will be faster than running in Matlab or Mathematica, and it will take a whole lot less memory.
Best of luck, and have fun! :-) -- Paul
OpenSource.MathCancer.org: open source comp bio
this topic is a breath of fresh air amid the putrid fumes of IT monkey fodder!
Tsunami -- You can't bring a good wave down!
I do not understand exactly what you are talking about, but, this is how I beat the FEM/finite difference techniques.
http://caldron.com/projects/fma/about.html
It may be applicable to your application
As far as I know, when you have such kind of problem, you have to precondition your matrices. Google for preconditioning.
http://adsabs.harvard.edu/abs/1989feaf.proc...54B
Brown, David L.; Henshaw, William D.; Kreiss, Heinz-Otto; Chesshire, Geoffrey
Affiliation: AA(Los Alamos National Laboratory, NM), AB(IBM Thomas J. Watson Research Center, Yorktown Heights, NY), AC(California, University, Los Angeles; Kungliga Tekniska Hogskolan, Stockholm, Sweden)
"The fundamental principles, implementation, and applications of CMPGRD are reviewed; CMPGRD is a software package developed by Brown et al. (1988) to generate two- and three-dimensional curvilinear composite overlapping grids for flow computations. Particular attention is given to the numerical solution of partial differential equations (PDEs) on composite grids: discretization, interpolation, FDM convergence rates, and the treatment of elliptic and time-dependent PDEs. Results for a typical problem involving supersonic channel flow are presented graphically."
Maybe a place to start. Kreiss seems to be specializing in the field. Not exactly new, but the problem is not either, I guess.
Disclaimer: IANAP/M
CC.
TaijiQuan (Huang, 5 loosenings)
Quote from the home page:
- An open-source XML based simulation package
- From Ordinary Differential Equations (ODEs) up to stochastic Partial Differential Equations (PDEs)
[...]XMDS
http://www.xmds.org/
The problem you encounter is well known problem in meteorology. The two methods that are being used most are FE and spectral method. The former is simpler and more flexible and the later being more accurate since it keeps the derivations analytic. The problem with the spectral method is that you have to make your problem periodic, and you have to go from grid-point space to spectral space every timestep. In regard to stability, this is not a problem in many FE methods as long as you fulfill Courant-Friedrich-Levi criterion i.e. as long as your timestep is shorter than the time needed for the fastes wave to pass the distance between two grid points. When aplying FE method you have to make a choice of a scheme and depending on the scheme you can expect different distortions of your wave. Try to look in the book Numerical Methods for Solving Wave Equiations in Geophysical Fluid Dynamics by Dale Durran. Good on-line source is http://www.ecmwf.int/newsevents/training/lecture_n otes/LN_NM.html especially "Numerical methods" by R. W. Riddaway and M. Hortal
I have experience is simulating elastic wave in solid (homogeneous) media. I've successfully used second order finite difference to simulate Lamb waves for a 2D case. My work was based on that by Lee and Staszewski http://www.iop.org/EJ/article/0964-1726/12/5/018/s ms3_5_018.pdf I've also heard of people using spectral elements for this. http://lsec.cc.ac.cn/~cjxu/SEM_mem.html
P.S. I'm a /. lurker. Only created an account to post this, hope it helps.
Strange, My Scottish friend tells me that all useful inventions are socttish
...don't seem to work very well in the case of variable wave speed at different points in the domain, which is exactly the case that I need. Look closer. Wave speed is a parameter in the DE, and all solution methods of linear DEs are local. If you treat the parameter as variable, it will be obvious what you need to do in both FEM and FDM.What numerical methods do you use, and which programs do you find best suited to the task? Well, always fit the method to the problem. As usual, FEM if you've got an odd boundary conditions, FDM otherwise. And don't forget other methods like integral transforms and greens functions, which can simplify or complicate your problem to varying degrees. Mathematica and Maple are good for a lot of things, having features for symbolic manipulation. Of course, D/C/LISP/Python/your-favourite-language-here work well enough for the actual crunching.
How do you deal with stability issues, boundary/initial values, and other pitfalls? Stability issues: The best thing you can do is prove stability. See if you can fit backwards and forwards together a-la Crank-Nicholson, and check that for stability. Or, use something nicer like Runge-Kutta in the time domain.
Boundary/Initial Values: You do what you have to, I guess. That's a lot more problem specific. If you haven't got the standard initial-time/bounded space situation, you can approximate an unbounded region. It's a lot simpler than you would think, but you need to solve it for your specific problem. Bounded-time is different, but you can then do FDM in the time domain.
Other pitfalls: Stiffness can point to a flaw in your reasoning. Scaling is worth a try. Otherwise, there are always methods to deal with your specific problem. Talk to your friendly neighborhood mathematician.
Are there different methods for electromagnetic wave problems? I think they are usually easier with analytic methods. IANA electrodynamicist, but try a few things out.
Finally, when the numbers have all been crunched, how do you visualize your hard-earned data? Matplotlib is good if you work in Python. If your employer uses Matlab/Maple/Mathematica, use those. I find Matlab awkward, and Matplotlib is similar and has most of the same features.
We at slashdot are scientists, specialists and kernel hackers. Your FUD will be found out.
This isn't my specialty, but I'm currently finishing my Ph.D. in regularity theory of nonlinear elliptic pde (so I have some knowledge of PDEs :P). I also have written a few numerical solvers for parabolic, elliptic and hyperbolic PDEs. Basically, I agree with what macklin01 said; especially, the statements regarding convergence of characteristics and solvers preserving an entropy criterion.
Really, I believe you need to understand your equation a little more theoretically before trying to write a solver for it. If you wish to solve for situations where shocks form, this will limit your choices quite a bit (both pseudo-spectral and FD methods will be poor choices in this scenario). If you are trying to numerically solve such an equation, you should be able to do some analytical calculations to see whether or not shocks will form. If you are not familiar with these calculations, they are spelled out in Evans book on PDE (and there are plenty of ways to analytically approximate wave equations). The only info I have on solving with shocks essentially deals with dividing up your spatial domain and then approximating your solution by solutions to the Riemann problem on each of these subdivided domains (with BCs correlating to the solution from the previous time step). That was from a talk I heard from a few years ago from so the details are a bit hazy. Nonetheless, the issues with shocks are HEAVILY studied.... for various military purposes.
If you aren't dealing with shocks and have a somewhat regular spatial domain, pseudo-spectral methods (i.e. using Fourier transforms) will give you good results. Just thinking about it heuristically, you should be able to get an idea for an adequate spectral band for your approximation if you can prove some type of gradient bound for analytic solutions to the problem. If there is no gradient bound (i.e. could mean a shock formation), this probably isn't the place to start.
If you are dealing with irregular domains then my guess is to look into FD methods using adaptive grids (i.e. densities would correlate to increasing gradients of numerical approximations). I assume you already know about implicit and explicit FD methods and various interpolations between the two... so I won't belabour that point.
I have no knowledge of using FE methods or of the level set methods that macklin01 mentioned in the setting of hyperbolic equations. Sorry.
You may also want to look into using fractional time steps. I.e. you take a half time-step using one numerical methodology, then you take the second half of the time step using another. Usually, the first half time step gives you a good approximation with less stability, the second half stabilizes the approximation from the first half. This is a very fast and loose explanation. Fractional time steps are well covered in literature (numerical recipes in C even briefly mentions them). Personally, I have found them very useful when using more exotic numerical methods that weren't so stable.
In regards of what to use to write the solver in. Personally, I always have used F90 or perhaps C to code up anything I wrote in this regard; but if you only plan on doing a few runs of the solver to get a few results, then matlab is a good fast alternative to F90. If you plan to run many simulations using your solver, then nothing will beat the speed of a well-coded solver written in F90.
As for visualization, time evolution of select level sets is the most obvious choice (like macklin01 said). It really depends on what you want to convey with your data though (as with any visualization). Thus, if you are trying to see just spatial representations of solutions, level sets are a good representation for 3D wave equations. You could also try color scales corresponding to your solution and looking at various slices of your domain; but this obviously requires some knowledge of where to look in your solution domain for certain phenomena. If you want to see shock formations, you could make 3D density plots based on the gradient value of your numerical app
Dear Slashdot,
/. reader.
I have recently come across a problem that has been faced before. I, however, do not seem to be able to solve it. Perhaps you could locate for me a person who can solve my problem. Perhaps you can do my homework for me, which I will give to my employer as my own work. Also, after solving the problem, if you could also explain it to me with graphs and suggestions on how to interpret them.
Thanks in advance
- Avid
when the numbers have all been crunched, how do you visualize your hard-earned data?
Well I start off using my fingers, and if the problem is really complicated, I take off my shoes and socks and use my toes too.
Donte Alistair Anderson Roberts - hi son!
Karma: Chameleon
Exploration seismology uses a staggering amount of computer time doing this. Elasticity is not electromagnetism, but close enough to tell you what you need to know. As noted, the primary hard part is variable velocity fields. Propagation appears in two contexts, modeling which is the forward problem and migration which is the inverse problem.
A good starting point for codes is CWP/SU. Or email me.
rhb acm org
I don't think so. And who the hell ever says, I'm a *whatever* who has recently needed to obtain...? Think about it. Or in your lingo, meld your mind into a form that prevents you from coming off as an asshat.
I've found this site to be pretty good for answering any math questions I have. Your question might be a little advanced but it's worth a shot http://www.physicsforums.com/forumdisplay.php?f=4
You're asking the mental midgets at Slashdot this? Just what on Earth were you hoping to accomplish by doing that?
The seismic data processing has been dealing with this computational problem since the 50's. There are scads of different approaches used by all the geophysical data processing companies in processing seismic data for oil exploration. You can check out some free software supplied by the Colorado School of Mine at their Center for Wave Phenomena that does precisely what you want.
Hardest "Ask Slashdot" EVAR?!?!?!
We've patented that. Please apply to http://www.we-dont-do-anything.com/ for a license.
Paul Beardsell
Check out copies of Journal of Computational Physics at your university's library. It should be a good starting place for computational solutions to physical problems.
Gnuplot, POV-Ray & little scripts for automating the process. OGRE3D, if real-time/interactive 3D graphics is needed.
:)), logically implemented so you can usually guess how to obtain what you need. Works beautifully in conjunction with shell-scripting, which was pretty essential when I was slowly getting results from simulations that lasted a calendar year .... And you get all outputs, ie. "quick & dirty" on-screen checks, web-presentation & publication quality with one program. Especially the last: I've still to find a competing package that gives you equal quality & control over quality. Not that I've searched for an alternative though ;-)
Especially gnuplot. It's very easy to get on with, yet when you need features, its got 'em all (minus advanced 3D -- that's what you use POV-Ray for
I like to line up three cameras and synchronize two watches, then pee on bunnies. Unfortunately they usually scamper away...dirtying up all the evidence. I guess I could sedate them...but I laugh when they scamper away.
That's why I failed lab.
I've got a paper in the works that deals with something like what you've got. It's more theoretical than numerical, but it basically lays down a theoretical framework justifying and proving convergence of the finite element method for general coefficients, including discontinuous coefficients. It is based on the work of Lions and Magenes that was published in their PDE book back in the 50's, but isn't terribly widely known. My boss also has a lot of experience on the more strictly numerical side. If you see this and want to know more, email me at my username at Rice University.
Well, do you think there could be some kind of correlation?
-- may you ever drink deep --
Disclaimer: IAAM (I am a mathematician, working on nonlinear wave equations).
You have explicit formulas for the solution, which are especially nice in 3D.
They reduce to computing integrals, for which task tons of efficient libraries
should be available in any language.
But, of course, it all depends what are you asking for. Do you need to add
singular forcing terms? are you interested in the Cauchy problem?
variable coefficients? asymtpotic behaviour? etc etc etc
Dear Slashdot,
My brain exploded all over my monitor after reading that question. Since this is usually the first place I go for legal advice, I ask you: how would you go about starting a personal injury suit against the guy who asked the question?
Thanks!
Um... go to a university and take any class on the subject?
How is this of interest to Slashdot readers?
The nice thing, though, is that they have worked through all the issues of stability, convergence, etc., and it's a lot more "plug and go" than it used to be.
So if you can map your problem onto a physical problem that has engineering interest, you may be able to find a commercial solution out there. I don't know if they exist, but acoustic simulation would be a good mapping to your problem (at least at small amplitudes.)
It's not wasting time, I'm educating myself.
Why don't you use Excel? What's the problem?
If you are looking for a frequency response, then you would use one type of method, a FV or DG approach, If you are looking for a broad frequency response to a general input form you would use something like a FDTD approach. Then there are MoM, boundary element methods as well. All of these work for what you are talking about but are better suited for particular problems. You can look in the electromagnetic community for more info on this, basically, you are simulating EM waves with non-constant dieletric. Now, just a side note, if your wave speed varies over a very large range (many orders of magnitude) then your problem becomes much harder and many of these techniques don't work, at become inaccurate.
Not fair. One is fine, but six are just begging someone to do the work for you. ^^
But have you considered particle modeling? Fill your experiment space with a large number of points representing your medium, and model each one only in how it reacts to its environment and neighbors. Then let it run, and watch the results. It is not determinstic, but you can often get a statistically close simulation of the real thing.
But... does it run Linux?
Just download OpenFOAM suite, then spend a few weeks studying how to use it, and you will learn how to make this code solve numerically almost any system of PDE-s that you throw on it. It's finite volume method.
A really powerful and flexible (generalized) viz tool is OpenDx http://www.opendx.org/ which started as a commercial IBM venture and is now an open source project. It uses visual programming (EG plugging modules together) to generate the visualizations so you don't need to write your on OpenGL or something. Even with just three "modules" plugged together (and all default settings) you'll start to see your data in 2-space or 3-space.
RudeDude
Perl/Linux/PHP hacker
...that Google passes for "literature review" these days.
Hey, we were doing this in an engineering class yesterday afternoon!
,where C = c (wave speed) * dt / dx so dx = c.dt (by memory) for the most stable condition with an exact solution at C=1. (you can have a slightly less accurate solution for 0C1). Of course, if c changes, your mesh size has to change, but I would have thought if you know the extrema of the wave speed c, you can just make sure your mesh is fine enough not to go unstable at sudden changes of c, but it will cost you in time to compute a solution, plus the whole 3d thing, which gives 4 degrees of freedom (x,y,z,t) instead of 2 (x,t). Still, most computer packages can solve this, heck, we do far more complex computational fluid dynamics turbulence modelling etc on current ~2Ghz machines. If all else fails, put a few boxes together, make a beowulf cluster, and Slashdot will certainly have you back!
For a 3d problem, you should be able to just apply something like a Forward-Time-Backwards-Space scheme (which is inherently convergent and stable for a wave equation) but put it in a tensor form x_j = [ x y z ].
The size of the time and space-step for stability is goverened by the Courant Condition C = 1
For plotting a solution, Gnuplot could do it if you have the inclination. You'd want a 3d (perhaps animated in time) plot, or some contour slices (x,y) through z or through t. 3d vector ('cone') plots might be a good way of showing velocity of the wave in 3d space too. For commercial packages, try MATLAB, or Tecplot (I don't work for these people, but they are commonly used at universities so plenty of people can help you out!)
Cheers
From Dan
You might want to check out some electrical engineering control systems books, and electrical engineering texts dealing in Fourier math in general. I forgot a lot of this stuff since getting my BSEE, but like back in '89 or '90 with MathCad for DOS, I was modeling Fourier equations (I think with some feedback loops) to approximate sine waves, then triangle and square waves, futzing with the math to smooth out the spikes that would occur at sharp transitions (like at the corners of the square and triangle waves). Just 2D then because that's all the computers I was using could handle, like it took an hour to model a square wave on a 486. I think control systems math, namely Fourier and possibly Laplace, could provide a way of deriving numerical approximations to your second order wave equations. That's what control math is all about, providing a means to model systems, then machine-implementable ways to stabilize those systems.
-- Bad control systems joke follows --
Q: Why are all the Polish plane flights half full?
A: Because all the poles have to be on the right side of the plane for stability.
tried watching TV for a while? I find that a television can solve any problem in a half an hour, or an hour tops.
The variable velocity is one of the main problems in geophysical data processing. Wave equation migration has been a hot topic for a while now.
Man sod all those others. What you need to do is reconfigure the equations into 4 dimensional waveforms. Use 4D clifford Geometric analysis with the convergence of the scalar and outer product. Thsi will lend to the reformatting of maxwells equations into "DeltaJ=0" and should give similar amazing equations for your quantum work. also lorrentzian tranformations are easy to compute in 4d as they just become a rotaion in spacetime. Once you have all these things, type in your original equations and use simple algorithms to export data into matlab. this givving you a very groovy video of quantum tunnelling and wave particle duality as you see the particle smear. Also you will have found yourself the GUT. well done you. i doff my cap. God your amazing. Your mother must be so proud. The only problem here is that A * B where A and B are multivectors will take 256 unique calculations. Have Fun Tabs
It runs on Linux, but only on Linux. Windows and MacOS are not designed for it.
I haven't worked on such problems myself but I'm quite sure you'll find somebody knowledgeable and willing to help on http://www.physicsforums.com/
you forgot: "I for one welcome our variable wave speed overlords".
I also have a stumper. I need a webpage to automatically select Landscape orientation when the page is printed, and without downloading Active-X controls.
Table-ized A.I.
I work on sonar/seismic/radar inversion problems. Essentially the problem of mapping terrain or subterrain by measuring scattered sound or radio signals, e.g. with synthetic aperture radar. One thing I seriously lack at the moment is a good wave simulation that I can simply play around with to get a feel for both wave mechanics itself and for the equations and techniques of the field.
Analytical, asymptotic and ray tracing methods to approximate the wave equation are all very well, but at some point I feel I need to see a full solution, or a good approximation to one. I also need a method of simulating emitted sonar and radar pulses, their interaction with "obstacles" or features they encounter, and the returned or scattered signals from this interaction. I need a way of doing this with highly irregular scattering obstacles, both in terms of geometry and wave speed.
What I would most like to get is a model of wave propagation in a simulated 3D domain with highly irregular boundaries and speeds, something that would defy most analytical approaches. My goal is to try and simulate actual subterranean features via fractals and other techniques, and use the numerical wave equation simulation to get a good simulation of what real life returned signals would look like. I need a good simulation because, as you would expect, the inversion algorithms that map out the terrain from the returned signals, can be very sensitive to variations in the signals they receive.
I'll be working in the unsteady case as I have reservations about transforming to the Helmholtz equation, not least of which is the necessity of taking the fourier transform of the source signal. I'm trying to get as exact a solution as possible.
The ones I have tried suffer from the problems related to the CFL condition. To sum it up -if c*dt/dx is not exactly equal to one, problems arise. Greater than one and the method is unstable(horribleness). Equal to one and things are peachy. Unfortunately, less than one and the method, though stable, seems to suffer from either a numerical or some other more subtle type of instability. I'm not a numerical analysit, nor do I have time to probe further. This rules out these methods as c will be variable in any practical problem I use the code on. I'm also worried about other types of potential pitfalls; caustics, shocks, infinities, etc.
Which is exactly why I don't want to use those methods, or any method that requires me to nurse or otherwise "prep" the method before use. I intend to throw multiple simulated terrains at the method and I'd like it to perform well across all ranges. I was hoping that in this day and age such a solution existed, but I'm aware I may be asking for the impossible.
I posted the question because I was tired of unsuccessfully Googling and unwilling to waste more time playing lucky dip with tedious textbook monographs. The reason I've posted this question on Slashdot is because the comments on many a science story suggest that a lot of professional scientists do post comments here. I'm holding out that the question may catch the eye of a meteorologist or radio modeling specialist who has worked on such a problem, and who has precisely the right technique, program and visualization method I'm looking for. Here's hoping.
There's been a lot of good suggestions so
May the Maths Be with you!
The Galerkin finite element method is widely used to study problems with layered or otherwise inhomogeneous media. For the particular application to the wave equation, you may want to check out "Finite element analysis of acoustic scattering" by Frank Ihlenburg, but I can't recall if he discusses changing wavespeeds.
The one potential problem I see for both FE/FD is if you want to model a gradually changing wave speed. A discretized approximation _may_ introduce artificial scattering due to finite changes in the wave speed (as you are approximating the smoothly varying properties, for example on the Gauss points in FEA or grid points in FD).
This is coming from an electrical engineer who uses 3D numerical solvers every day at work. The best package is something called CST Microwave office. You can adjust it to fit your problem by creating different dielectric materials in different regions (and thereby adjusting the velocity of the EM waves). You can adjust the material parameters (mu and epsilon) to create any material you want, including materials with negative refractive index...very interesting from a physics/mathematics point of view. For broadband applications, CST is the fastest, most stable, and user-friendly in terms of parameterization, optimization, and learning curve. It has excellent post-processing of the results, including field distributions and animation. Other packages include XFDTD, SemCad, HFSS (FEM), Comsol (FEM). Writing the code to do this on your own is a big undertaking, especially for 3D, and you should expect to spend about 12-18 months being a code-monkey. There is free 3D fdtd source code written in fortran on the net and also part of the FDTD bible published about 12 years ago by Luebbers, et. al. Out of curiosity, does this problem have a direct application, or just solving it out of academic interest?
I'm currently getting my PhD in that area, and I'd recommend looking into Discontinuous Galerkin methods. Those are higher-order finite-element methods, and they work very well for hyperbolic problems. I can whole-heartedly recommend a book by my advisor: Nodal DG Methods (it comes out next month).
DG Methods take a little time to implement, but their accuracy and speed is well worth the effort. If you'd like some precooked software, check out http://git.tiker.net/?p=hedge.git;a=summary. (but be aware that there's little to no documentation just yet--don't be afraid to ask, though)
As an undergrad I wrote a general purpose action minimizer for the intention of approximating the shape of nuclei. If you figure out the action for the wave in four space, I can plug it in for you. Now I never got past 2d visualization, via a simple vb program making use of mschart, or exporting it in a list Mathematica could visualize. Its been 6 or so years since I've looked at it so it would take some time to figure it out. And looking back on it, I'm a bit embarrassed /impressed at the coding level. Its in raw c++ and includes a sloppily home brewed parser and custom templated linked list implementation.
Well.. maybe. Or Maybe not. But Definitely not sort of.
Exploration geophysics has published hundreds of papers on this topic, both for finite difference and Kirchhoff (ray tracing) methods. They refer to running the wave equation backwards in time as "migration". It corrects for the fact that seismic waves are recorded at the surface, and not at the geological reflectors. The velocity typically varies continuously, as you would expect within the earth.
Search for "wave equation" or "finite difference" here at the search site of the Society of Exploration Geophysics.
I don't know enough from the question to know if this would supply the answers he needs. My answer below requires any system equations, set up as an initial-value problem. However, I would like to suggest that he try looking at the Parker-Sochacki solution to the Picard iteration (officially written up here in Neural, Parallel & Scientific Computations, and mentioned here in Wikipedia, and explained here. This can give you a taylor series solution. It occurs to me that the system might be modifiable to give fourier series solutions... hmmm... interesting problem there. Anyhow, good luck.
Correct Horse Battery Staple: 72 bits of entropy. Enter "Correct H" into google. When it generates the phrase, that's
You might want to search IEEE Trans. Antenna and Propagation to find a related paper. You might need to modify FDTD for your purposes.
It's hard to say what's best, because you've given little info on the application.
The wave equation is a hyperbolic problem - I'd probably use something like Finite Volume - it's well-suited to this type of problem. People have suggested multigrid, etc - that probably won't work well.
Variable wave speeds sounds like you might end up with some shocks, depending on that velocity field. That's where FVM will really shine. I really like Randall Leveque's "Finite Volume Methods of Hyperbolic Problems". That has some info on FVM for the wave eqn.
Without more detail, that's all I can say, though - good luck!
> I move that the Chair recognize kdawson is an idiot.
Hey! Wait a minute! Let's not drag Ballmer into this!
As a matter of fact, I *am* an applied mathematician, and I do work in this field.
I am just a beginner, though. Here are is a solution of the shallow water wave equations in a circular tub:
http://platinum.linux.pl/~jordi/movies/sw-solution .ogg
(Ogg Theora. If you can't play it, get VLC or any other free software player.)
The method I used is a very flexible meshless method that is a relatively modern alternative to finite element methods. Btw, finite volumes are much more popular for fluid dynamical problems, but the other big two methods (finite elements and differences) are also widely used. The meshless method I used (of which there are also many available) is radial basis functions, what looks to me like a thriving area of modern research. Pros is that you avoid all the mesh generation that takes about 80% of the computational time with finite elements and you manage to keep the flexibility of meshes by allowing finer detail at problematic sites (just put more basis functions where the problems could happen). Cons is that you get ugly matrices, but if you play your method right, you can arrange it so that you only have to factorise the ugly matrix once and then just do forward and back substitutions at each iteration. I did unsymmetric collocation for my matrices, since experience seems to show that the extra work required to make the matrices symmetric yields only very small dividends. There are also ways of coupling this method with domain decomposition in order to get smaller matrices. This is in fact my thesis work. :-) If you're interested in more details and seeing my C++ source, contact me at jordigh@gmail.com
As for visualisation software, I indirectly used VTK through Octaviz, a visualisation addon for Octave. The movies I generated with mplayer's encoder, mencoder.
HTH :-)
You might take a look at what some of the astrophysics people are doing. At Northwestern they were using spectral methods to study the environment near event horizons.
In my own research modeling systems of laser cavities, non-linear absorbers/emitters and so forth, it was sometimes useful to start with the system and add the obstacle through a perturbation.
May the Maths Be with you!
For any questions about E&M wave equation solutions -- standing, boundary conditions, free propogation, etc., -- get a copy of this text:
h ird-David-Jackson/dp/047130932X
http://www.amazon.com/Classical-Electrodynamics-T
It's _the_ classic grad. level E&M textbook. Generations of physicists have learned much from (and dreaded exams on) this text. My old copy of Jackson had no info on numerical solutions, but I'm guessing you need some theoretical background, not a canned math method/computer code.
If you didn't know _anything_ about this textbook beforehand, you may not posess the background you need to solve the problem you're working on.... Sorry to be so blunt.
sigfault (core dumped)
use discontinuous galerkin http://en.wikipedia.org/wiki/Discontinuous_Galerki n_method, the hottest method in higher order method research today, an extremely flexible method that has all advantages of continuous FEM and finite volume methods (FVM) and can be applied on elliptic, parabolic and hyperbolic problems. the one metod that rules all types of problems.
I thought I told you not to try to get other people to do your graduate research for you.
Tut tut. Dr. Rastikov will be disappointed in you.
These systems are hyperbolic PDE's, solvable by C, C++, or MATLAB scripts. You need to satisfy the Courant-Friedrichs-Lewy condition for convergence, which is related to the speed of the fastest waves in the system and the granularity of your model. Your order of accuracy can easily reach 100% error for 2nd order difference methods unless you have a fair number of points per wavelength, like 30 or so. Modelling large systems can quickly lead to running out of RAM unless you have access to a supercomputer, thats why they teach classes about these equations at high performance computing centers. Check out this page for a 1 and 2 spatial dimension matlab implementation of the leap-frog difference method. Hope it helps!
Kharma is like a boomerang. Mine is broken.
Hello ObsessiveMathsFreak:
> Finally, when the numbers have all been crunched, how do you visualize your hard-earned data?
The project over at quaternions.sf.net will take a collection of 4 numbers, one for time, three for space, sort them by time, and then in the appropriate frame of the animation, place the dot at the right x, y, z location. The result is a 10 second gif. I found that a 3D animation was hard to understand, so I surround the quaternion animation with three complex planes: tx, ty, and tz. I also have the superpositions on the right side.
If you have a few thousand sets of 4 numbers you want to see animated as a quaternion and in 3 complex planes, feel free to contact me.
doug
Working on new views of old physics at http://VisualPhysics.org
Surfer works very well for multi-dimensional data sets, and slurps in reams of text file data without complaint.
I work in Hamilton-Jacobi Theory and numerical optimization so I've done some work on similar equations, albeit where the equation was part of a system of coupled equations. I found orthogonal collocation seemed promising, though a bit cumbersome since you need lots of Legendre polynomials. A backsweeping approach might work, not sure since I've only seen it in the pseudo-static framework. I don't think FEM will work so hot, but that's just my experience and it could just have been the forcing terms I had to work with when I was working on my stuff. You might look at stuff by Shi Jin from Wisconsin, he's done some work on discontinuous Hamiltonian and Liouville Equations and for them the wave speed is variable, i.e. v=c(x)^2 taking the notation from your mathworld link. Cheers and good luck
Before become ICt maniac, i practice in PHD Maths playground,
do you try multiscale wavelets wave numerical solution ?
a current standard textbook in this field is:
__Inverse Acoustic and Electromagnetic Scattering Theory 2nd Edition__
by David Colton and Rainer Kress
Springer Verlag, 1998.
The book is accurate and well written, and has extensive references.
Sounds like you need an "Approximation Method for Eigenvalues of Very Large Matrices".
Take a look at what is known as "symplectic integration" and also "discrete exterior calculus" (DEC). Both of these should work, and they use some heavy math to justify the methods. Its quite entertaining. The basic outline for DEC is that, in vacuum, you have four constraint equations which much be satisfied (there's not any stray electric or magnetic fields) and so the equations evolve in such a way as to strictly keep this at zero. The algebra of the constraints dictates where answers can be found from one timestep to the next, so it improves stability to use a calculus which makes sure that the algebraic properties of the constraints are maintained. I hope that helps. Feel free to email me.
Take a look at my Computational Electromagnetic Modeling Framework. The SmartView visualizer and Component View data processor would probably be most relevant. You'll also find some papers, articles, and presentations to download, and they may have some ideas you can use.
Don't be put off by the purchase price. If it can help you out, email me from the site, and I'll send you a copy without charge.
Have you tried Matlab?
Re-write your 1D second order equation as two first order equations (two advection equations traveling in opposite directions). At this point you can use finite volume methods, look up the most recent finite volume book by Randy LeVeque. The basic problem is 1D because you want to solve a Riemann problem across each face, you then do transformations to solve the N-D problem... Anway, it works great. If you want something more sophisticated and accurate try discontinuous Galerkin.
Matlab and more recently, matplotlib for python are great for looking at this kind of stuff.
Hi, I have solved second order equation in my structural Dyanamics and if you can throw some light on your problems i will try.Please mail me back to tcvenkatramani@hotmail.com Venkat
Isn't the number 42
Take a look at comsol multiphysics. It probably has the tools you need.
http://www.comsol.com/
This is my sig, show me yours
"Here here!"
What where?
Did you mean "Hear hear!" as in "Listen to this guy, he's making an excellent point!"?
Kind regards,
Non-mathematician AC who likes maths a lot
you might try solving the eqn for the configuration(s) first then getting the values. Perhaps Maxima or some of the other symbolic capable math programs might offer aide.
Otherwise, seems like the best book I've seen on practical handling of complex mathematics is Numerical Recipes which has versions in fortran, c and other languages.
seems like a good friend just finished teaching a graduate level partial differential equations class last spring that covered wave equations substantially. If you have a particular one and particular constraints - I might be able to enquire on it. Again, this is solving - not numerical methods.
in any case - good luck with that guff.
Well you could always go to a very small grid size and then run your solution on a very big computer! But seriously since there been so much work done in recent years in various fields solving non-linear PDE's you'd think this type of problem has already been dealt with, though perhaps in a different physical context. Maybe just need to find the best analog to your problem in an area that has already been well explored. Hydrodynamicist have been modelling non-linear surface waves recently, so this could be a starting point. M
I actually just finished a summer internship where I worked with methods to approximate the wave equation. Drop me a line and I'll be happy to go into more detail.
You appear to have had a few sips too many of a particularly delightful Scottish invention. :-)
I see even classic Slashdot is now pretty much unusable on dial up anymore.
No true Scotsman would make that claim.
New punctuation update "~" (no quotes) at the end of a line to indicate sarcasm. ~
Expanded moments i.e. dipole, quadrapole etc approximated into tensor. Reason: Tensor is matrix. Matrix is amenable to computer.
That should help with boundaries and EM etc.
As for the fact that finite difference "not working too well." Weird. It's pretty standard when it comes to Laplacian.
You can use the vast amount of numerical work regarding spherical harmonics, Bessel and Legendre etc. Just about everything in EM for N-dimensions breaks down to expansions in these special functions which happen to also correlate to... yep... you guessed it... multipole expansion!
All science is either physics or stamp-collecting.
Not to put to fine a point on it, but wouldn't it be better to rephrase your sig (w/ which I agree, partially) as, "Athletic Scholarships from universities make less sense than academic scholarships from sports teams might, if they were created to subsidize inner-city youth who excel in mental gymnastics."
Pro-activity could have benefits if it were channeled... off-air.
-- Potential is not what you make of it. --
Would this help: http://www.millsian.com/