你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-06 20:46:52 +08:00
Corrected issues with dispersion analysis for high values of dielectric, and for pulses with low power at low frequencies (affected finding highest frequency).
这个提交包含在:
@@ -21,6 +21,7 @@ from collections import OrderedDict
|
|||||||
from colorama import init, Fore, Style
|
from colorama import init, Fore, Style
|
||||||
init()
|
init()
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
np.seterr(invalid='raise')
|
||||||
|
|
||||||
from gprMax.constants import c, floattype, complextype
|
from gprMax.constants import c, floattype, complextype
|
||||||
from gprMax.materials import Material
|
from gprMax.materials import Material
|
||||||
@@ -193,9 +194,12 @@ def dispersion_analysis(G):
|
|||||||
|
|
||||||
# Shift powers so that frequency with maximum power is at zero decibels
|
# Shift powers so that frequency with maximum power is at zero decibels
|
||||||
power -= np.amax(power)
|
power -= np.amax(power)
|
||||||
|
|
||||||
|
# Get frequency for max power
|
||||||
|
freqmaxpower = np.where(power[1::] == np.amax(power[1::]))[0][0]
|
||||||
|
|
||||||
# Set maximum frequency to -60dB from maximum power, ignoring DC value
|
# Set maximum frequency to a threshold drop from maximum power, ignoring DC value
|
||||||
freq = np.where((np.amax(power[1::]) - power[1::]) > G.highestfreqthres)[0][0] + 1
|
freq = np.where((np.amax(power[freqmaxpower::]) - power[freqmaxpower::]) > G.highestfreqthres)[0][0] + 1
|
||||||
maxfreqs.append(freqs[freq])
|
maxfreqs.append(freqs[freq])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@@ -240,8 +244,14 @@ def dispersion_analysis(G):
|
|||||||
# Grid sampling density
|
# Grid sampling density
|
||||||
results['N'] = minwavelength / delta
|
results['N'] = minwavelength / delta
|
||||||
|
|
||||||
|
# If there is an invalid inverse sine value set to maximum, i.e. pi/2
|
||||||
|
try:
|
||||||
|
tmp = np.arcsin((1 / S) * np.sin((np.pi * S) / results['N']))
|
||||||
|
except FloatingPointError:
|
||||||
|
tmp = np.pi / 2
|
||||||
|
|
||||||
# Numerical phase velocity
|
# Numerical phase velocity
|
||||||
vp = np.pi / (results['N'] * np.arcsin((1 / S) * np.sin((np.pi * S) / results['N'])))
|
vp = np.pi / (results['N'] * tmp)
|
||||||
|
|
||||||
# Physical phase velocity error (percentage)
|
# Physical phase velocity error (percentage)
|
||||||
results['deltavp'] = (((vp * c) - c) / c) * 100
|
results['deltavp'] = (((vp * c) - c) / c) * 100
|
||||||
|
在新工单中引用
屏蔽一个用户