Wave Equation Amplication Issue
See original GitHub issueWhen I try to use the wave equation the amplitude of the wave is amplified by a lot over the duration of the simulation. Here is my code:
import numpy as np
from pde import FieldCollection
from pde import (DiffusionPDE, UnitGrid, ScalarField, MemoryStorage,
PlotTracker, PrintTracker, RealtimeIntervals, DataTracker)
from pde.visualization import movies
import math
import random
import pde
import pandas
import ffmpeg
import matplotlib.pyplot as plt; plt.rcdefaults()
import numpy as np
import matplotlib.pyplot as plt
storage = MemoryStorage()
trackers = [
'progress', # show progress bar during simulation
'steady_state', # abort when steady state is reached
storage.tracker(interval=1), # store data every simulation time unit
PlotTracker(show=True), # show images during simulation
]
grid = pde.UnitGrid([64, 64])
field1 = ScalarField.random_uniform(grid, 0, 0) # generate initial condition
field2 = ScalarField(grid);
field1.add_interpolated([48, 48], 1)
field1.add_interpolated([48,16], 1)
state = FieldCollection([field1,field2]); #first slot is the density field,
eq = pde.WavePDE(speed=1);
result = eq.solve(state, t_range=200, dt=1, tracker = trackers)
result.plot(colorbar = True, show = True) # plot the resulting field
movies.movie_multiple(storage, filename = r'C:\Users\matth\URECA Simulation\testfile.mp4')
and here is the file of the movie. In the movie the colorbar is at 10^90 and the wave can only be seen at the end of the movie, which means that the amplitude is increasing throughout the simulation. I looked at the documentation and I am not sure why this is happening.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Applications of wave equations
This section presents a range of wave equation models for different physical phenomena. Although many wave motion problems in physics can be modeled...
Read more >A CASE-STUDY ON WAVE EQUATION AND ITS APPLICATION
The main aim of the paper is to use partial differential equation in real life to solve world problems. Under partial differential equation,...
Read more >Wave equation - Wikipedia
The (two-way) wave equation is a second-order linear partial differential equation for the description of waves or standing wave fields — as they...
Read more >12.2: The Wave Equation - Mathematics LibreTexts
We motivate the study of the wave equation by considering its application to the vibrations of a string – such as a violin...
Read more >Wave Equation Example Problem - YouTube
An example problem using the wave equation is explained and worked out.By James Dann, Ph.D. for ck12.org CC BY NC SA.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not an expert on these methods but I would certainly welcome pull requests that implement more general solvers. A good starting point would probably be to look at the implementations of
pde.solvers.implicit
andpde.solvers.explicit
. I just realized that the explicit solver already supports Runge-Kutta 4/5, which is an explicit stepper. It would be great to have more methods available, either as extensions to the present solver classes or as a separateRungeKuttaSolver
class.I just reduced dt to .0001. I don’t think using the implicit and explicit methods changed it that much.