-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in executing randomization of modulus reduction and damping ratio curves #19
Comments
Can you provide the complete script that causes this problem? |
Sure Here is the script: import numba Increased figure sizesplt.rcParams['figure.dpi'] = 120 def iter_geopsy_profiles(fname):
fname = 'data/ChamoliAftershock.AT2' calc = pystrata.propagation.EquivalentLinearCalculator() freqs = np.logspace(-1, 2, num=500) outputs = pystrata.output.OutputCollection([ fname = 'data/EQD_NoAPAll.txt' var_soiltypes = pystrata.variation.DarendeliVariation(-0.5) for o in outputs: The required input files are attached herewith. |
Please attach the actual file as the formatting is lost when you just paste the code as a comment. |
A few comments. In this cell: var_soiltypes = pystrata.variation.DarendeliVariation(-0.5)
count = 4
for geopsy_profile in iter_geopsy_profiles(fname):
for profile in pystrata.variation.iter_varied_profiles(
profile,
count,
var_thickness=None,
var_velocity=None,
var_soiltypes=var_soiltypes
):
calc(ts, profile, profile.location('outcrop', index=-1))
outputs(calc) You are only varying the last created var_soiltypes = pystrata.variation.DarendeliVariation(-0.5)
count = 4
for geopsy_profile in iter_geopsy_profiles(fname):
for p in pystrata.variation.iter_varied_profiles(
profile,
count,
var_thickness=None,
var_velocity=None,
var_soiltypes=var_soiltypes
):
calc(ts, p, p.location('outcrop', index=-1))
outputs(calc) |
It is working now. |
Hello.
I have been using PYSTRATA for a long time and it worked very well. However, I just downloaded the latest version of PYSTRATA and Python both. During an equivalent linear analysis based on one of your examples, I executed the following command to implement the randomization of modulus reduction and damping ratio curves:
var_soiltypes = pystrata.variation.DarendeliVariation(-0.5)
count = 4
for geopsy_profile in iter_geopsy_profiles(fname):
for profile in pystrata.variation.iter_varied_profiles(
profile,
count,
var_thickness=None,
var_velocity=None,
var_soiltypes=var_soiltypes
):
calc(ts, profile, profile.location('outcrop', index=-1))
outputs(calc)
In earlier versions, it used to show only this message:
C:\Users\ADMIN\anaconda3\lib\site-packages\pystrata\site.py:741: RuntimeWarning: divide by zero encountered in divide
err = 100.0 * np.max((self.previous - self.value) / self.value)
C:\Users\ADMIN\anaconda3\lib\site-packages\pystrata\site.py:741: RuntimeWarning: invalid value encountered in divide
err = 100.0 * np.max((self.previous - self.value) / self.value)
But, it used to work well and provided the results properly.
However, with the latest version, It showed this message:
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\site.py:804: RuntimeWarning: divide by zero encountered in divide
err = 100.0 * np.max((self.previous - self.value) / self.value)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\site.py:804: RuntimeWarning: invalid value encountered in divide
err = 100.0 * np.max((self.previous - self.value) / self.value)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:327: RuntimeWarning: overflow encountered in multiply
waves_a[i + 1, :] = 0.5 * waves_a[i] * (1 + cimped) * np.exp(
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:327: RuntimeWarning: invalid value encountered in multiply
waves_a[i + 1, :] = 0.5 * waves_a[i] * (1 + cimped) * np.exp(
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:329: RuntimeWarning: overflow encountered in multiply
) + 0.5 * waves_b[i] * (1 - cimped) * np.exp(-cterm)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:327: RuntimeWarning: invalid value encountered in add
waves_a[i + 1, :] = 0.5 * waves_a[i] * (1 + cimped) * np.exp(
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:330: RuntimeWarning: overflow encountered in multiply
waves_b[i + 1, :] = 0.5 * waves_a[i] * (1 - cimped) * np.exp(
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:330: RuntimeWarning: invalid value encountered in multiply
waves_b[i + 1, :] = 0.5 * waves_a[i] * (1 - cimped) * np.exp(
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:332: RuntimeWarning: overflow encountered in multiply
) + 0.5 * waves_b[i] * (1 + cimped) * np.exp(-cterm)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:330: RuntimeWarning: invalid value encountered in add
waves_b[i + 1, :] = 0.5 * waves_a[i] * (1 - cimped) * np.exp(
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:369: RuntimeWarning: overflow encountered in multiply
return 2 * self._waves_a[l.index] * np.exp(cterm)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:369: RuntimeWarning: invalid value encountered in multiply
return 2 * self._waves_a[l.index] * np.exp(cterm)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:455: RuntimeWarning: overflow encountered in multiply
denom = -(ang_freqs2) * self.wave_at_location(lin)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:455: RuntimeWarning: invalid value encountered in multiply
denom = -(ang_freqs2) * self.wave_at_location(lin)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:461: RuntimeWarning: invalid value encountered in divide
tf[mask] = GRAVITY * numer[mask] / denom[mask]
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:461: RuntimeWarning: overflow encountered in multiply
tf[mask] = GRAVITY * numer[mask] / denom[mask]
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:309: RuntimeWarning: invalid value encountered in divide
wave_nums[i, :] = angular_freqs / l.comp_shear_vel
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:329: RuntimeWarning: invalid value encountered in multiply
) + 0.5 * waves_b[i] * (1 - cimped) * np.exp(-cterm)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:332: RuntimeWarning: invalid value encountered in multiply
) + 0.5 * waves_b[i] * (1 + cimped) * np.exp(-cterm)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:451: RuntimeWarning: overflow encountered in multiply
self._waves_a[lout.index, :] * np.exp(cterm)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:451: RuntimeWarning: invalid value encountered in multiply
self._waves_a[lout.index, :] * np.exp(cterm)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:452: RuntimeWarning: invalid value encountered in multiply
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:448: RuntimeWarning: overflow encountered in multiply
1j
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:461: RuntimeWarning: invalid value encountered in multiply
tf[mask] = GRAVITY * numer[mask] / denom[mask]
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:327: RuntimeWarning: overflow encountered in exp
waves_a[i + 1, :] = 0.5 * waves_a[i] * (1 + cimped) * np.exp(
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:330: RuntimeWarning: overflow encountered in exp
waves_b[i + 1, :] = 0.5 * waves_a[i] * (1 - cimped) * np.exp(
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:448: RuntimeWarning: invalid value encountered in multiply
1j
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:451: RuntimeWarning: invalid value encountered in subtract
self._waves_a[lout.index, :] * np.exp(cterm)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:451: RuntimeWarning: overflow encountered in subtract
self._waves_a[lout.index, :] * np.exp(cterm)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:309: RuntimeWarning: divide by zero encountered in divide
wave_nums[i, :] = angular_freqs / l.comp_shear_vel
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:362: RuntimeWarning: invalid value encountered in multiply
cterm = 1j * self._wave_nums[l.index] * l.depth_within
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\site.py:804: RuntimeWarning: divide by zero encountered in double_scalars
err = 100.0 * np.max((self.previous - self.value) / self.value)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:387: RuntimeWarning: invalid value encountered in divide
tf = self.wave_at_location(lout) / self.wave_at_location(lin)
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\propagation.py:561: RuntimeWarning: divide by zero encountered in double_scalars
l.strain = self._motion.pgv / l.initial_shear_vel
C:\Users\ADMIN\miniconda3\lib\site-packages\pystrata\site.py:804: RuntimeWarning: invalid value encountered in double_scalars
err = 100.0 * np.max((self.previous - self.value) / self.value)
After that, it generated results, but in the output, the majority of the values are shown as 'NaN' and therefore, in the plots also, very few output curves are shown (Figure attached(Previous version and current)). I request you to kindly let me know how to rectify this error.
The text was updated successfully, but these errors were encountered: