Re: [Yade-users] [Question #611087]: I got a wrong damage ratio
Question #611087 on Yade changed: https://answers.launchpad.net/yade/+question/611087 Status: Answered => Solved Huihuang Xia confirmed that the question is solved: Thanks Luc Scholtès, that solved my question. -- You received this question notification because your team yade-users is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #611087]: I got a wrong damage ratio
Question #611087 on Yade changed: https://answers.launchpad.net/yade/+question/611087 De zhang proposed the following answer: change the code as flowing: def addPlotData(): damageRatio=numBroCohBonds/float(numBroCohBonds+sumCohBonds) plot.addData(t=O.time,dr=damageRatio) haha~~ -- You received this question notification because your team yade-users is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #611087]: I got a wrong damage ratio
Question #611087 on Yade changed: https://answers.launchpad.net/yade/+question/611087 Luc Scholtès proposed the following answer: Sorry, for wrong use of keyboard shortcut... I try another time here: I see 2 potential reasons why you get your damage ratio >1: 1) you don't use the same condition for checking the nb of cohesive contacts at initialization and during the simulation: initialization: if cohesionBroken==True: continue sumCohBonds+=1 during simulation: if cohesionBroken==False: continue numBroCohBonds+=1 Why don't you use the same condition for both cases? 2) the test you use during the simulation might cause problem because you sum over interactions and look for those with cohesionBroken==True and this paramater is set to true by default, even for frictional interactions (if I understood correctly). Doing so, the newly created interactions are counted as being broken despite the fact that they appeared as a result of the interaction of particles after breakage of you specimen. For me, the solution would be to use the same condition for each case: if cohesionBroken==False: numCohBonds+=1 and to define InitialNumCohBonds in the initial loop and currentNumCohBonds in the current loop so that the damage ratio would be: damageRatio=currentNumCohBonds/initialNumCohBonds If, after that, you still have a damage ratio > 1, there might be a problem somewhere else... For instance, I have never used this contact law before but are you sure about the way you use the setCohesionNow flag? In your case, you define it equal to true in the engine list -> Does it mean that it will be always true or just for the first iteration of your simulation? From my understanding, the way you define it makes it true for all the duration of the simulation hence, you create cohesive contacts every time particles come into contact hence, your damage ratio > 1. -- You received this question notification because your team yade-users is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #611087]: I got a wrong damage ratio
Question #611087 on Yade changed: https://answers.launchpad.net/yade/+question/611087 Status: Open => Answered Luc Scholtès proposed the following answer: I see 2 potential problematic reasons why you get your damage ration >1: 1) you don't use the same condition for checking the nb of cohesive contacts at initialization and during the simulation -> Why? initialization: if b.phys.cohesionBroken==True: continue sumCohBonds+=1 during simulation: if br.phys.cohesionBroken==False: continue numBroCohBonds+=1 -- You received this question notification because your team yade-users is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #611087]: I got a wrong damage ratio
Question #611087 on Yade changed: https://answers.launchpad.net/yade/+question/611087 Status: Answered => Open Huihuang Xia is still having a problem: Hi Robert, Thanks for your patience, but your method also got a wrong result, as damage ratio was greater than 1 and number of broken bonds could not increase gradually, which violated the definition of damage ratio. -- You received this question notification because your team yade-users is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #611087]: I got a wrong damage ratio
Question #611087 on Yade changed: https://answers.launchpad.net/yade/+question/611087 Status: Open => Answered Robert Caulk proposed the following answer: Hello Huihuang, I recommend you read the final post of that thread more closely ;-). You [i]want[/i] to initialize numBroCohBonds to zero each time, because each time this function is called you are cycling through all of the interactions and summing all the brokenbonds. Maybe you misunderstood what I was recommending. Here it is: def damageRatio(): global numBroCohBonds numBroCohBonds=0 for br in O.interactions: if br.phys.cohesionBroken==False: continue numBroCohBonds+=1 # calculate broken bonds damageRatio=numBroCohBonds/float(sumCohBonds) print sumCohBonds,numBroCohBonds plot.saveDataTxt('data/damageratio.txt') Best, Robert -- You received this question notification because your team yade-users is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #611087]: I got a wrong damage ratio
Question #611087 on Yade changed: https://answers.launchpad.net/yade/+question/611087 Status: Answered => Open Huihuang Xia is still having a problem: Hi Robert, Thanks for your answer, but put the numBroCohBonds=0 inside the damageRatio() function is reallly a big mistake. You can refer to https://answers.launchpad.net/yade/+question/432617, in this question, it was stated that put the numBroCohBonds=0 inside the damageRatio() function led to a initialization of numBroCohBonds to zero each time. Damage ratio is the fraction of bonds broken relative to the total number of bonds originally created. In each time step, some new bonds broke, and number of bonds broken in damage ratio must be a sum of broken bonds in all time step before current time step. Thus, I still need an answer. Huihuang Xia -- You received this question notification because your team yade-users is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #611087]: I got a wrong damage ratio
Question #611087 on Yade changed: https://answers.launchpad.net/yade/+question/611087 Status: Open => Answered Robert Caulk proposed the following answer: Hello, It looks like you are summing through broken bonds at each timestep and adding it to the sum from the previous step. If you want your damage ratio to be relative to each timestep, the number of broken bonds needs to be reset before each timestep. So I would put the numBroCohBonds=0 inside the damageRatio() function. This way,the summation is reset each time damageRatio() is called. Robert -- You received this question notification because your team yade-users is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp