-
Notifications
You must be signed in to change notification settings - Fork 18
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
Bug related to backbone curve #29
Comments
Hey Vahed, interesting. Yeah that last data point is very suspicious. Are you comfortable sharing any of your code so I can see if I can replicate the issue? |
Hi Mr. @cslotboom Source codeimport numpy as np
import matplotlib.pyplot as plt
import hysteresis as hys
hystFileName = r"hystersis data.csv"
data = np.loadtxt(hystFileName, delimiter=',', skiprows=1)
myHys = hys.Hysteresis(data)
LPsteps = [6,6,6,4,2,2,2,2]
bavg, _, _ = hys.getAvgBackbone(myHys, LPsteps, returnPeaks=True)
myEEEP = hys.fitEEEP(bavg)
fig, ax = plt.subplots()
line1 = myHys.plot(linewidth = 0.7, label = 'Hysteresis curve')
line2 = bavg.plot(linestyle = '-.', label = 'Avg. Backbone')
line3 = myEEEP.plot(color = 'black', label = 'EEEP Curve')
plt.minorticks_on()
ax.grid(which='major', color='grey', linewidth=0.5, alpha = 0.8)
ax.grid(which='minor', linewidth=0.5, alpha = 0.4)
# ax.legend(loc='lower right')
ax.legend()
ax.set_xlabel('Displacement (mm)')
ax.set_ylabel('Force (kN)') In the above code, two more steps should be defined in the LPsteps variable, which causes an error. The correct value of LPsteps is as follows: LPsteps = [6, 6, 6, 4, 2, 2, 2, 2, 2] Loading scheme according to SAC loading protocolAlso, myHys.cycles does not return a complete cycle of the hysteresis loop: fig, ax = plt.subplots()
cycle = myHys.cycles[-1]
curvexy = cycle.xy
ax.plot(curvexy[:, 0] , curvexy[:, 1])
fig, ax = plt.subplots()
for cycle in myHys.cycles[0:3]:
curvexy = cycle.xy
ax.plot(curvexy[:, 0] , curvexy[:, 1])
fig, ax = plt.subplots()
for cycle in myHys.cycles[4:6]:
curvexy = cycle.xy
ax.plot(curvexy[:, 0] , curvexy[:, 1]) |
So, I'm looking into this. On my end I was able to get this plot: Try to upgrade to the latest version, which is 2.0.1, and see if you get a plot similar to mine. You can upgrade in your console with:
Regarding the LPsteps, there does seem to be something slightly off with getAvgBackbone, I'm reviewing it, but for now I would use your temporary fix. Regrading the cycles - right now this is expected behavior. What we're plotting is probably more accurately defined as a "half-cycle". I'm realizing calling them cycles is confusing. I'm going to consider changing the name, but I need to be careful because many parts of the package reference this attribute. |
Hello Mr. @cslotboom I am busy now, but in the coming months I will try to help you in adding new features to the package. |
Glad this is working for you now. I'd love to add a additional function for ASCE/SEI 41-17 to convert to ideal bilinear. I discovered a "off by one" error with the backbone function on LP steps, that why you have to add less cycle than the correct amount. This has been fixed but I'm leaving the issue open until next time I update the package. |
Hello
I had a number of hysteresis charts that I drew the bone curve with the hysteresis library. In one of the hysteresis curves, there was a mistake in the bone drawing, which is probably related to the bug. I will upload the necessary data, please guide me if possible.
Download hystersis data -> hystersis data.csv
Download loading protocol -> SAC Loading protocol.csv
The text was updated successfully, but these errors were encountered: